Would like to ask if someone know which message or function i could hook to 'intercept' a window from being activated by clicking at her 'taskbar button'.
Im hooking explorer.exe but i could not find any useful info yet.
Would like to ask if someone know which message or function i could hook to 'intercept' a window from being activated by clicking at her 'taskbar button'.
Im hooking explorer.exe but i could not find any useful info yet.
WM_QUERYOPEN and return FALSE
(Tested on Notepad on Windows 10, by subclassing it with a WH_GETMESSAGE hook (DLL)
Spy++ : Using Spy++
I saw the messages :
WM_ACTIVATEAPP
WM_NCACTIVATE
WM_ACTIVATE
WM_SYSCOMMAND with SC_RESTORE
WM_QUERYOPEN
Great! I had find that hooking explorer.exe message SwitchToThisWindow works. Its better to hook directly the target app than the taskbar.
Do you also know how to avoid the taskbar window button from getting highlighted?
No my intent is to detect when the user click at the window taskbar button, but being able to differentiate a real user click from the window being minimized/focused because another window got minimized above it.
Help me understand a bit better. Lets say that a process A has foreground window on the desktop. Process B has a window that is below the process A window in the z-order. When the user clicks the taskbar button for process B what do you want to happen? Should the process B window remain covered by the process A window but still be able to receive input? What if Alt-Tab is used to switch between windows? What if the user clicks the process B window with the mouse?
6 people are following this question.