c# - Hide Taskbar in Windows 8 -


up now, able use following c# code hide windows taskbar:

[dllimport("user32.dll")] private static extern int findwindow(string classname, string windowtext); [dllimport("user32.dll")] private static extern int showwindow(int hwnd, int command);  private const int sw_hide = 0; private const int sw_show = 1;  ...  int hwnd = findwindow("shell_traywnd", ""); showwindow(hwnd, sw_show); 

but when using windows 8, code hides taskbar on primary monitor, not on second, taskbar visible.

how may hide taskbar on screen windows being shown?

make use of findwindowex. allows pass in window search after in z order well.

ergo:

dllimport("user32.dll")] private static extern int findwindowex(int parent, int afterwindow, string classname, string windowtext);  // start first child, continue windows of same class after int hwnd = 0; while (hwnd = findwindowex(0, hwnd, "shell_traywnd", ""))     showwindow(hwnd, sw_show); 

if want hide task bar on specific screen only, use getwindowrect , check bounds screen window on, , call showwindow on window on current screen.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -