Page 1 of 1
Communicate with other programs
Posted: Tue Jan 22, 2013 3:32 pm
by radido
Hello,
is it possible to communicate with other programs via Windows messaging?
For example:
SendMessage(Handle, WM_COMMAND, $A004, 0);
with best regards
Dietmar
Re: Communicate with other programs
Posted: Mon Jan 28, 2013 11:47 am
by radido
Hi Everybody,
it has to wait for a response appropriate?
Are there news?
Re: Communicate with other programs
Posted: Mon Jan 28, 2013 5:02 pm
by support
Sure - you can do this using Win32API.
Here's some code that should get you going.
Code: Select all
require 'win32api'
# This finds a window by caption and stores the handle
findWindow = Win32API.new("user32", "FindWindow", ['P','P'], 'L')
handle = findWindow.Call(nil,"Untitled - Notepad")
watch "handle",handle
# This sends a WM_COMMAND (273 = 0x111) message with the ID for File|Open
sendMessage = Win32API.new("user32", "SendMessage", ['L'] * 4, 'L')
sendMessage.Call(handle, 273, 1, 0)
# This gets the caption of a window from a handle
s = ' '*64
getWindowText = Win32API.new("user32", "GetWindowText", ['L','P','L'], 'L')
getWindowText.Call(handle,s,64)
watch "caption",s
Re: Communicate with other programs
Posted: Fri Mar 08, 2013 2:27 pm
by radido
Hi everyone,
received is now cleared but one example of the transmitter is still bulged
Please do not leave me hanging
