c# - How to keep window visible at all times, but not force it to be on top -


i'm creating "desktop gadget" of sorts, i've disabled manual minimizing of window, there problem: system can still hide window if user presses windows+d, example.

when hidden way, no usual minimize/resize/visibility events fired. want topmost, without forcing window order.

maybe it's possible install global shortcut event using win32 api, , briefly set topmost true, sounds hackish.

i found 1 solution, not seem work on windows 10: keeping window visible through "show desktop"/win+d other common option, writing actual desktop gadget, not possible on windows 10, given deprecation.

are there other methods keep window visible (but not on top of screen) @ moments?

this function working me:

bool fixshowdesktop(hwnd hwnd) {     hwnd hwndtmp = findwindowex(null, null, l"progman", null);     if (hwndtmp)     {         hwndtmp = findwindowex(hwndtmp, null, l"shelldll_defview", null);         if (hwndtmp)         {             setwindowlongptr(hwnd, -8, (long_ptr)hwndtmp);             return true;         }     }     return false; } 

note, code bit better keeping window visible through "show desktop"/win+d because window can overflowed other windows (like other window). using setparent places window under other windows.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -