question

Elizza avatar image
0 Votes"
Elizza asked Castorix31 commented

Disabling a window from being activated by clicking in her taskbar button

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.

windows-apic++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
0 Votes"
Castorix31 answered Castorix31 commented

WM_QUERYOPEN and return FALSE
(Tested on Notepad on Windows 10, by subclassing it with a WH_GETMESSAGE hook (DLL)



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What tool do you use to monitor winapi messages?

0 Votes 0 ·

Spy++ : Using Spy++
I saw the messages :

WM_ACTIVATEAPP
WM_NCACTIVATE
WM_ACTIVATE
WM_SYSCOMMAND with SC_RESTORE
WM_QUERYOPEN



1 Vote 1 ·
Elizza avatar image
0 Votes"
Elizza answered RLWA32-6355 commented

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?

· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is your intent only to prevent a minimized window from being restored?

0 Votes 0 ·

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.

0 Votes 0 ·

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?

0 Votes 0 ·
Show more comments