which is the WM_SYSCOMMAND that gets fired when clicked on the taskbar window ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zacksoniar
    New Member
    • Sep 2007
    • 45

    which is the WM_SYSCOMMAND that gets fired when clicked on the taskbar window ?

    Hello,

    I need a wnd SYSCOMMAND that gets fired reliably when clicked on the window which is sitting on the taskbar or when that window enters in focus after pressing Alt+tab
    I have already tried below commands but it dint help me.
    some of the commands are fired but not reliably.

    Code:
             const int MYKEYID = 0; 
             const int WM_MOUSEACTIVATE = 0x0021;
             const int WM_HOTKEY = 0x312;
             const int MOD_ALT = 1;
             const int MOD_CONTROL = 2;
             const int MOD_SHIFT = 4;
             const int WM_SYSCOMMAND = 0x0112;
             const int SC_MAXIMIZE = 0xF030;
             const int SC_RESTORE = 0xF120;
    
    if (message.Msg == WM_MOUSEACTIVATE || (message.Msg == WM_HOTKEY && message.WParam.ToInt32() == MYKEYID) || (message.Msg == WM_SYSCOMMAND && message.WParam.ToInt32() == SC_MAXIMIZE || message.WParam.ToInt32() == SC_RESTORE)))
    {
         FormClicked();
    }
Working...