c# - Hide task bar in maximized state when WindowStyle is SingleBorderWindow -
i'm putting option in settings window user choose whether show windows task bar or go fullscreen when maximize window.
i tried this
static readonly intptr hwnd_topmost = new intptr(-1); const uint swp_nosize = 0x0001; const uint swp_nomove = 0x0002; const uint swp_showwindow = 0x0040; public static void setformtopmost() { intptr windowhandle = new windowinterophelper(application.current.mainwindow).handle; setwindowpos(windowhandle, hwnd_topmost, 0, 0, 0, 0, swp_nomove | swp_nosize | swp_showwindow); }
but not working. not making topmost..
you can try method:
public void maximizewindow(bool isfullscreenwithtaskbar) { if (isfullscreenwithtaskbar) { this.maxheight = systemparameters.maximizedprimaryscreenheight; } this.windowstyle = windowstyle.singleborderwindow; this.resizemode = resizemode.noresize; this.windowstate = windowstate.maximized; }
Comments
Post a Comment