GUI hooks in C#

Y

yoni

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
 
M

Michael A. Covington

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#.
 
M

Mattias Sjögren

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
 
J

John Sun

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.
 
L

leon.ioannides

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/library/system.windows.forms.form_events(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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top