Jump to content

Recommended Posts

Posted

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...

Posted (edited)

PeekMessage isn't intended to hook into the message queue of another process, if that's what you're trying to do.

Edited by Siao

"be smart, drink your wine"

Posted

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?

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...