Jump to content

SendMessage: Discover messages an application accepts?


Guest
 Share

Recommended Posts

Hi all,

I want to control a commercial application via SendMessage commands. How can I find out which messages are accepted by this app? I´d prefer using messages over simulating keystrokes but I don´t know which messages I can use...

Greets,

Rob

Link to comment
Share on other sites

The messages are generally sent to the GUI, not directly to the app. If the GUI and controls are standard Windows API, then MSDN describes the messages used.

If the elements are not Windows API (Flash, Grid controls, owner-drawn, etc.), or you really want to send inter-proc messages straight to the app, then you need to contact the author of the application for documentation.

:blink:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

PsaltyDS, thanks for your reply. Unfortunately, it does not help me the way I expect. Maybe I have not made my problem clear enough or I do not understand the concepts of SendMessage well enough, so let me explain in more detail:

For a customer, I need to automatically insert / delete local firewall rules in the McAfee Host Intrusion Prevention System Version 7 (HIPS7). For this, I need to execute commands like "Unlock User Interface", provide the password, change visual tabs, enter commands like "Add rule" and fill out dialog forms etc.

As far as I understand, even if the HIPS7 complies with the standard Windows API, there must be special parameters (lparam, wparam) to tell HIPS7 which action is to perferm. I now need to know how to find out which params I have to provide in SendMessage to call a specific functionality of the HIPS7.

I hope this clarifies better what I try to accomplish.

Regards,

Rob

Link to comment
Share on other sites

He already told you, if it is Windows API it is described in MSDN. If you want any specifics you need to give us a specific question.

Now I have a question. Why SendMessage()? It sounds to me that you want ControlClick() and ControlSend().

Edit: added sentence

Edited by AdmiralAlkex
Link to comment
Share on other sites

He already told you, if it is Windows API it is described in MSDN. If you want any specifics you need to give us a specific question.

Yes, I understood that I have to look up the proper message command in the Windows API, lets say 0x111 for WM_COMMAND. I "simply" need the wParam and lParam values to call a specific command from the HIPS7 application, i.e. the "Unlock User Interface" command.

Now I have a question. Why SendMessage()? It sounds to me that you want ControlClick() and ControlSend().

Of course I can control everything of the application by using ControlSend / ControlClick or by simulating key presses (this is how it´s done in the current version of the script that controls the application), but I would rather use SendMessage because I think it does not require opening dialog windows to call various functionalities (like unlocking the interface or adding rules) and therefore is faster and less prone to errors.

Finally, I found http://www.autohotkey.com/forum/topic126.html which explains how find these values using the software "Windows Spy".

Thanks for your time,

Rob

Link to comment
Share on other sites

Why reinvent the wheel? You just described the Control...() functions.

Of course I don´t want to do a job that´s already done - my dream was to call for example the "Unlock User Interface" function and directly provide the password within this call, so that no dialog window is opening (that asks for the pw) but the interface gets immediately unlocked. By using Control*(), I can only execute the command to open that window and then put in the pw... Or did I miss something?

Regards,

Rob

Link to comment
Share on other sites

No you have not missed something. But as SendMessage is the same thing why not use the easier alternative?

That is to say, unless you actually need SendMessage for some reason you have not told us, then ignore me.

I'm hungry.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...