Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

SendMessage Win32API function

0 Aufrufe
Direkt zur ersten ungelesenen Nachricht

csjuko

ungelesen,
09.05.2003, 05:37:1709.05.03
an
Hi,

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

Shashank Date

ungelesen,
09.05.2003, 12:34:3309.05.03
an
# On Win 2K: ruby 1.6.8 (2002-12-24) [i586-mswin32]
# Open a Notepad window BEFORE running this script

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

0 neue Nachrichten