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

Eliza 21 Reputation points
2021-09-12T17:36:53.643+00:00

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 API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,422 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,527 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 81,721 Reputation points
    2021-09-12T18:28:46.333+00:00

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


1 additional answer

Sort by: Most helpful
  1. Eliza 21 Reputation points
    2021-09-12T18:42:49.567+00:00

    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?