Prevent window from disapearing when hovering another application thumbnail on windows taskbar

Julia Otranto Aulicino 20 Reputation points
2023-05-12T02:20:01.2366667+00:00

Hi everybody.

I'm working on a presentation app (it has 2 windows, one for each monitor). In the main monitor there's the presentation controls, on second window there is the presentation (just like power point).

However, if the user takes the mouse to the windows taskbar, point to another app, and hover over the another app thumbnail, the other app is shown and the presentation window disapears, remaining only the desktop background image. (This is a problem to me, because sometimes users have to switch to other apps while presenting to search files, copy some things, find some lyrics on google, and every time they do this the screen on the projector blinks)

I want to know is there's any way to prevent this behavior and keep my presentation window always on front.

(Just for curiosity, I tried this running power point and it disapears too)

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,637 questions
{count} votes

Accepted answer
  1. RLWA32 43,381 Reputation points
    2023-05-12T18:44:34.1533333+00:00

    You can disable Aero Peek for a specific window to keep it visible by calling the DwmSetWindowAttribute function as follows-

    BOOL bExclude{ TRUE };
    HRESULT hr = DwmSetWindowAttribute(hwnd, DWMWA_EXCLUDED_FROM_PEEK, &bExclude, sizeof bExclude);
    

0 additional answers

Sort by: Most helpful