Jump to content

Recommended Posts

Posted

My application is minimized to tray & I am trying to use PostMessage to open it. The code in C++ would be:

::PostMessage(m_hwndTray, WM_COMMAND,  MAKEWPARAM(ID_CLIENT, 0), 0);

where ID_CLIENT is ID of the control of our app, which forces the window to open or show. I am trying to do the same in AutoIT & here is my snippet:

#include <WinAPI.au3>
#include <WindowsConstants.au3>

$hWnd = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]')
$ID_CLIENT = 32788 ; this is the ID of the control to which message will be sent.

_WinAPI_PostMessage($hWnd, $WM_COMMAND, $ID_CLIENT, 0))

The only problem I have is the MAKEWPARAM macro which gives me the wParam from the ID of the control. How to do this in AutoIT?

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
×
×
  • Create New...