Sign in to follow this  
Followers 0
evilertoaster

PeekMessage from user32.dll

6 posts in this topic

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

Share this post


Link to post
Share on other sites



bump

Share this post


Link to post
Share on other sites

#3 ·  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"

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks :)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0