Runtime removing menu and status bar(Hiding)

BlitzMax Forums/MaxGUI Module/Runtime removing menu and status bar(Hiding)

LAB[au](Posted 2007) [#1]
Hello,

Does somebody knows if it's possible to hide the menu and the status bar from a window without recreating it?

What I am trying to achieve is to have a normal menu/status "windowed" window expand to fullscreen and in this mode have the menu and status disappearing.

some code win32 only



grable(Posted 2007) [#2]
To remove the menubar:
Extern "Win32"
  Function SetMenu:Int( hwnd:Int, menu:Int)
EndExtern
SetMenu( hwnd, Null)

And the statusbar
Extern "Win32"
	Function FindWindowExA:Int( parent:Int, childafter:Int, classname$z, windowtitle$z)
EndExtern
Local statushwnd:Int = FindWindowExA( hwnd, 0, "msctls_statusbar32", "")
If statushwnd <> 0 Then ShowWindow( statushwnd, SW_HIDE)

Btw you should realy use GetWindowLong to get the style and remove what you dont want, as you never know what flags are set.
Something like...
Style = GetWindowLong( hwnd, GWL_STYLE)  ~ WS_CAPTION ~ WS_BORDER

Hope that helps =)


LAB[au](Posted 2007) [#3]
Thanks for the advice on window's style. The 2 functions work , I can hide or show the status bar however if I hide the menu I can't seem to have it back, is there a way other than recreating it to hide/show the menu?


grable(Posted 2007) [#4]
Yeah, try this:
SetMenu( hwnd, WindowMenu(window).Query(QUERY_HWND))
UpdateWindowMenu(window)



LAB[au](Posted 2007) [#5]
Thanks a lot ... if anybody needs it here are 4 functions (Win32 only). ShowWindowMenu, HideWindowMenu, ShowWindowStatusbar, HideWindowStatusbar




LAB[au](Posted 2007) [#6]
Anybody knows how to do the same on Mac OS and Linux?


JoshK(Posted 2007) [#7]
You have SW_HIDE and SW_SHOW switched in the show and hide status bar functions.

I was able to hide the statusbar, but I cannot seem to resize the window client area. Now I just a have a blank spot where the statusbar used to be.


LAB[au](Posted 2007) [#8]
You need maybe to resize your canvas and redraw the window?

Thanks for spotting the switch, edited in above code.


remz(Posted 2007) [#9]
Now I just a have a blank spot where the statusbar used to be.

Any new info on this topic Leadwerks?
I'm experiencing the same thing: I'm trying to have an app going from normal windowed mode to fullscreen mode, but only by maximising the window and hiding stuff, not really switch video mode and the likes.

It works fine, except for the status bar portion at the bottom: the status bar does hide (big thanks to grable and LAB[au]!), but the empty space is always 'blank', i.e.: no gadget can be shown in that area. From looking at the win32 code, I can see that there is in fact *another* window being created when using the WINDOW_STATUS flag in CreateWindow, for a total of 3 windows:
1) The good old visible one with the menu bar and stuff
2) The status bar itself
3) The invisible 'client portion' of the real window minus the status bar height. This is the window actually being used when creating a gadget inside the window.

This is why everything gets clipped at the bottom even when using HideWindowStatusbar trick. It doesn't seem easy to fix, unless MaxGUI would provide functions to alter the style of a window after its creation, such as:
ChangeWindowStyle(add, remove)
i.e.: ChangeWindowStyle(0, WINDOW_STATUS)
would remove the status bar along with every necessary internal stuff to keep the gadget in a consistent state.