473,513 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GUI hooks in C#

Hi
I am a veteran programmer trying to go into the territory of GUI
system hooks in C#. in short, i need to know when windows open,
closed, moved, buttons on them clicked, etc...

can those things be done in C#, or do i have to stick with C++? and if
yes, if anybody can lead me to any place where there's any
documentation on this, and hopefully sample code, well it would be
very... helpfull :)

thanks
Jonathan

May 16 '07 #1
5 4166
Ya,

You can use C# or C++.Net, even VB.net

Just goto here and download the express IDE.
http://msdn.microsoft.com/vstudio/express/default.aspx

--
cheers,
RL
<yo**@nobhillsoft.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
Hi
I am a veteran programmer trying to go into the territory of GUI
system hooks in C#. in short, i need to know when windows open,
closed, moved, buttons on them clicked, etc...

can those things be done in C#, or do i have to stick with C++? and if
yes, if anybody can lead me to any place where there's any
documentation on this, and hopefully sample code, well it would be
very... helpfull :)

thanks
Jonathan

May 16 '07 #2

<yo**@nobhillsoft.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
Hi
I am a veteran programmer trying to go into the territory of GUI
system hooks in C#. in short, i need to know when windows open,
closed, moved, buttons on them clicked, etc...

can those things be done in C#, or do i have to stick with C++? and if
yes, if anybody can lead me to any place where there's any
documentation on this, and hopefully sample code, well it would be
very... helpfull :)
Just write handlers for the appropriate events. These things are very easy
to do in C#.
May 16 '07 #3
>I am a veteran programmer trying to go into the territory of GUI
>system hooks in C#. in short, i need to know when windows open,
closed, moved, buttons on them clicked, etc...

can those things be done in C#, or do i have to stick with C++?
If you mean global system hooks, you generally can't implement those
in managed code. Stick to plain C.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
May 16 '07 #4
On May 16, 3:06 pm, y...@nobhillsoft.com wrote:
Hi
I am a veteran programmer trying to go into the territory of GUI
system hooks in C#. in short, i need to know when windows open,
closed, moved, buttons on them clicked, etc...

can those things be done in C#, or do i have to stick with C++? and if
yes, if anybody can lead me to any place where there's any
documentation on this, and hopefully sample code, well it would be
very... helpfull :)

thanks
Jonathan
I am not exactly sure what you want, but you should be able to hook up
any windows events pretty easily in C#, if you have a button on a
form, you can simply double click that button and hook up the click
event for the button.

You can also hook up all other events for the different controls by
selecting properties of that control, and event property tab, and set
up all your event pretty easily there.

HTH.

May 17 '07 #5
Jonothan
I am a veteran programmer trying to go into the territory of GUI
system hooks in C#. in short, i need to know when windows open,
closed, moved, buttons on them clicked, etc...

can those things be done in C#, or do i have to stick with C++? and if
yes, if anybody can lead me to any place where there's any
documentation on this, and hopefully sample code, well it would be
very... helpfull :)

thanks
Jonathan
You can do all of this and much more, and not just in C#, but any .Net
language. The System.Windows.Forms namespace provides a range of
events that you can hook (or subscribe to) in your .Net code. Check
out the MSDN documentation on you stock standard Form class class at

http://msdn2.microsoft.com/en-us/lib...ts(vs.80).aspx

You would subscribe to the Closed event once the form is closed, or
Closing event if the form is trying to close (and can cancel this
event also). Once you start deviling with the library you will find
out how amazingly rich it is.

The only documentation you should need is MSDN (and a few websearches
won't go astray), but once you figure out how to navigate MSDN it will
answer the majority of your questions.

May 17 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12570
by: paul francis | last post by:
Hi Please help because I'm really stuck: I'm trying to write an application in C# which can be used to track the mouse pointer position on any window. I'm trying to use a Global mouse hook to...
5
1912
by: Jim Hubbard | last post by:
I don't think you can hook system events outside your application in .Net without using an unmanaged DLL, but I thought I'd ask. Jim Hubbard
9
5722
by: Chris Tacke, eMVP | last post by:
I'm not sure whether this is a C# or C++ question, so I'm asking in both groups. Here's my scenario: I need to get all text added to a ListBox that is in another process that I have no control...
0
5114
by: yaktipper | last post by:
WH_JOURNALPLAYBACK and WH_JOURNALRECORD These hooks are difficult to get working in C#, but after much piecing together of various code snippets from different language examples across the Net,...
1
1442
by: Jigar mehta | last post by:
Hye, How to create systemwide hooks for keyboard for keys like WIN, ALT+TAB, CTRL+ALT+DEL even when the application does not have the focus on it... Thanks,
3
2237
by: cichy83 | last post by:
Hi! I have a problem with global hooks under these two OS. I'm using three following types of hooks: CBT Hokk, Keyboard Hook, Mouse Hooks. I'm using BCB 6, under Win XP everything works fine...
13
3174
by: Hema | last post by:
hello all, I am working on a project related to Internet Explorer. I want my application to be invoked by a keypress( single key stroke or a combination). But this must get invoked only when the...
6
6164
by: Mythran | last post by:
Is it possible to attach Windows WndProc hooks into a Console application window? Thanks, Mythran
0
2172
by: effone | last post by:
I have two addins installed in my Outlook 2003, both have their specific functionality, I would like to integrate the functionality of both thru global mouse hooks, here is my senerio 1) Lets say...
0
2620
by: ramon.talavera | last post by:
Hello, I am trying to read rawinput as I have to distinguish between two devices (mice), I have found several examples and I am able to detect Raw Input in the local window, but cannot...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.