evilertoaster Posted June 19, 2008 Posted June 19, 2008 Has anyone got a successfull implmentation of the PeekMessage function from user32.dll? Previous posts about the subject never really resolved anything- here's my attempt: $msgStruct=DllStructCreate("hwnd Handle;uint message;wparam wParam;lparam lParam;dword Time;ptr Point") while 1 $result=DllCall("user32.dll","int","PeekMessage","ptr",DllStructGetPtr($msgStruct),"hwnd",WinGetHandle("SomeTitle"),"int",0,"int",0,"int",0) MsgBox(0,@error,DllStructGetData($msgStruct,1)&@CRLF&DllStructGetData($msgStruct,2)&@CRLF&DllStructGetData($msgStruct,3)&@CRLF&DllStructGetData($msgStruct,4)) Sleep(4000) WEndoÝ÷ ÚëvÚ zØ^¯Øb²Ç+ZºÚ"µÍÕRPÜX]J ][ÝÔÛÛYU]I][ÝÊBÕRTÙ]Ý]J BÚ[HBTÛY L BÑ[ So far no results...
Siao Posted June 24, 2008 Posted June 24, 2008 (edited) PeekMessage isn't intended to hook into the message queue of another process, if that's what you're trying to do. Edited June 24, 2008 by Siao "be smart, drink your wine"
evilertoaster Posted June 24, 2008 Author Posted June 24, 2008 The end-result intent was for another thread... I'm not sure what limitations apply... I was using autoit just to test the API function before I actually try and use it... Will it be able to get messages from windows in another thread or child-process?
ProgAndy Posted June 24, 2008 Posted June 24, 2008 You have to hook the Msg with _WINAPI_SetWindowLong and $GWL_WNDPROC *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now