Has anyone used SendMessage API call successfully with Ruby? Any
information would be useful!
I've tried the following:
require "Win32API"
WM_SETTEXT=0xC
wnd = Win32API.new("user32", "FindWindow", ['P','P'], 'L')
snd = Win32API.new("user32", "SendMessage", ['L','L','L','L'], 'L')
snd.call(wnd.call(0,"TestAppTitle"), WM_SETTEXT, ... and then what?
I'm trying to fill some text boxes automatically on a dialog (whose
title is "TestAppTitle")
Thanks a lot!
csjuko
require "Win32API"
# Now find the window handle of this session
findWindow = Win32API.new("user32",
"FindWindow",
['P','P'], 'L')
hWnd = findWindow.call(0,"Untitled - Notepad")
puts hWnd if $DEBUG
raise 'open a "Notepad" window and then try again' if
(hWnd <= 0)
# And change the title
WM_SETTEXT=0xC
sendMessage = Win32API.new("user32", "SendMessage",
['L','L','L','P'], 'L')
b = sendMessage.call(hWnd, WM_SETTEXT,-1,"Hello
There")
puts b if $DEBUG
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com