Jump to content

PostMessage to tray


Recommended Posts

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?

Link to comment
Share on other sites

where ID_CLIENT is ID of the control of our app...

That doesn't sound right for some reason. Where did you get this ID from?

:(

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

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