Jump to content

Recommended Posts


I'm trying to use the function _WinAPI_SetWindowsHookEx with the flag $WH_SYSMSGFILTER to catch messages generated by input in different inputboxes and so on..

I want to "read" an installation wizard step-by-step when a user interacts with it. Lets say the user checks some boxes and scrolls down a list and types something like a destination path for the installation, I want to catch the events (or as much information as possible) like name of the combobox what the input was etc..

Don't know if this is possible with autoit though.

I read an article (Cognitive Agent for Automated Software Installation - CAASI) and I want to do something simular.

In the article they describe:


Following are the basics that are required to understand how installation of software

works on Microsoft Windows [17]. The following discussion is with reference to

Microsoft Windows (any version released after year 2000).

  • Every application has one or more windows with one as parent window and each window has unique identifier known as handle. Buttons (Next or Back) or controls (Text box, combo box etc) within the window are referred as child windows.
  • Each application has a message queue and message loop. Occurred events (clicks, keystrokes, etc) are stored in message queue and message loop is responsible to retrieve the events from the message queue and dispatch (deliver) them to the appropriate window which has a procedure to process these messages.
  • All the messages / events (keyboard input, mouse movement, signals etc) are stored in the System message queue and the System is responsible to forward these to the appropriate application message queue.



I guess they use this in some way to create some kind of answer/response file-ish.

What I'm having trouble with is understanding the _WinAPI_SetWindowsHookEx function. I can run the example for the function that handles keyboard input. And I understand whats happening. But it seems I can't get it to work when i'm trying to use the other hooks.

Can anyone post an example of the usage of the different hooks or explain how they work?


Link to post
Share on other sites

You should take a look at the UI Automation framework. It's the perfect tool for monitoring an installation wizard.

Download the two UDFs in bottom of first post, and download and run the code in the "Simple spy demo" codebox in the middle of first post.

To verify that a control can be identified place the mouse cursor over the control and press Ctrl+w. You can see an example here.

Note that the framework is based on COM interface objects (created with ObjCreateInterface), so it's not just as easy to use as most built-in commands. But it's not more difficult than using hook procedures.

Read the posts in the UI Automation framework and go through some of the examples. In post 112 and post 150 you can see how to use event handlers. This is high level events like clicking a button or opening a menu (and not low level events like WM_PAINT, WM_KEYDOWN or WM_KEYUP).

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...