Can I use onmessage to monitor messages sent to another program?
Say I have a program called program.exe and I want to monitor to see when a specific message is sent to that program, is that possible without messing up program.exe?
OnMessage Question
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
Re: OnMessage Question
This is regarding your question whether a compiled script's Control command can be captured by another compiled script correct?
If so, yes a compiled script can capture a Windows Message from another script. However, not all Control commands send Windows Messages.
For instance, your receiving script can capture ControlSend to an embedded control structured like:
Receiving Script:
Sending Script:Using a Windows message spy will reveal a given message being received if any.
Note: To test my structure in the way you were originally asking, obviously you have to compile at least the receiving script
htms
If so, yes a compiled script can capture a Windows Message from another script. However, not all Control commands send Windows Messages.
For instance, your receiving script can capture ControlSend to an embedded control structured like:
Receiving Script:
Code: Select all
WM_COMMAND = 0x111 ; Windows Message
OnMessage( WM_COMMAND, "MessageFunc" )
Gui, Add, Button,, Test
Gui, Show, w300 h300, Receiving Script
Return
MessageFunc()
{
ToolTip Test Control Clicked
}
GuiClose:
ExitApp
Code: Select all
F1::ControlSend, Button1, {Enter}, Receiving Script
Esc::ExitApp ; Press Escape To Exit
Note: To test my structure in the way you were originally asking, obviously you have to compile at least the receiving script
htms
Who is online
Users browsing this forum: Google [Bot], RandomBoy and 253 guests