I am trying to write a test program to detect the windows events, such as mouseclick , text entered in a textfield, a dialogue box opened, etc.
Could I use the default WIN32 API to detect all windows events?
How do I do it?
Printable View
I am trying to write a test program to detect the windows events, such as mouseclick , text entered in a textfield, a dialogue box opened, etc.
Could I use the default WIN32 API to detect all windows events?
How do I do it?
You can't hook an external app with VB :(, the good news is c++ can so you can learn that and do loads of cool stuff :)
You can however obtain the handle to the window or button on the window in another app and then process it accordingly.
For example if you get the handle to the OK button on a form you can then send the appropriate message from VB to click this button and it will be processed accordingly. This will require you to search for the button to obtain the handle.
I find this works well. The only thing I have not found you can do is inject a message between when the window is created and the window is shown in another App during startup of the other App.
If Nucleus or anyone else knows how this can be done using C++
let me know.
Thanks Nucleus.
EMail Megatron for source code but haven't received.
Thanks Guys,
I have posted this in another forum and they have recommended a book regarding Hooking in VB. The title is " SubClassing and Hooking in VB" by O'Reilly.
I am new to API and hooking, any books that you could recommend?