Communicate with other programs

For general discussion related FlowStone
Post Reply
radido
Posts: 12
Joined: Wed Feb 18, 2009 12:33 pm
Location: Germany

Communicate with other programs

Post 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
radido
Posts: 12
Joined: Wed Feb 18, 2009 12:33 pm
Location: Germany

Re: Communicate with other programs

Post by radido »

Hi Everybody,

it has to wait for a response appropriate?

Are there news?
User avatar
support
Posts: 151
Joined: Fri Sep 07, 2012 2:10 pm

Re: Communicate with other programs

Post 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

radido
Posts: 12
Joined: Wed Feb 18, 2009 12:33 pm
Location: Germany

Re: Communicate with other programs

Post by radido »

Hi everyone,
received is now cleared but one example of the transmitter is still bulged

Please do not leave me hanging :o
Post Reply