Jump to content

Help me with GETMESSAGE


Recommended Posts

Help me, Please!

I do not know why, when this command crash.

$ msg = DllStructCreate ('HWND hwnd; UINT message; WPARAM wParam; LPARAM lParam; DWORD time; ptr pt')

DllCall ('user32.dll', 'bool', 'GetMessageW', 'ptr', DllStructGetPtr ($ msg))

I want to get messages from the queue by an application, how? Please help me, I am very thankful!

Link to post
Share on other sites

Yes, I know. But type "LPMSG" in Window to AutoIt is What?

I think it's "ptr". And tagMsg in Window is

typedef struct tagMSG {

HWND hwnd;

UINT message;

WPARAM wParam;

LPARAM lParam;

DWORD time;

POINT pt;

} MSG, *PMSG, *LPMSG;

To AutoIt I write "$msg = DllStructCreate('HWND hwnd;UINT message;WPARAM wParam;LPARAM lParam;DWORD time;ptr pt')".

It true or false?

Thank, Richard Robertson!

Link to post
Share on other sites

Yes, I fix code into:

$msg = DllStructCreate('HWND hwnd;UINT message;WPARAM wParam;LPARAM lParam;DWORD time;ptr pt')

DllCall('user32.dll','bool','GetMessageW','ptr',DllStructGetPtr($msg),"HWND","0x000A0288","UINT","0x0100","UINT","0x0101")

It can not exit. What can I do to get the message?

Link to post
Share on other sites

Hi,

as far as I know (and from my experiences) you can not create a message loop with GetMessage in AutoIt.

Because the main function of the AutoIt-Interpreter has already a message loop for the running thread.

If you still do it, AutoIt crashes or never stops running.

But you can call GetMessage sporadically, that's OK.

Regards

Greenhorn

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...