WINDOW_CHILD & WINDOW_MENU
BlitzMax Forums/BlitzMax Programming/WINDOW_CHILD & WINDOW_MENU
| ||
For some reason WINDOW_MENU wont work with WINDOW_CHILD, is there a way to get it to work?Global Wnd_Main:TGadget = CreateWindow("Wnd_Main", 0, 0, 1024, 768, Desktop(), WINDOW_TITLEBAR | WINDOW_MENU | WINDOW_RESIZABLE) Global Wnd_File:TGadget = CreateWindow("Wnd_File", 0, 0, 400, 350, Wnd_Main, WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_CHILD | WINDOW_MENU) Repeat Select WaitEvent() Case EVENT_WINDOWCLOSE End End Select Forever |
| ||
... is there a way to get it to work? |
| ||
Yeah - this is a big problem I experienced and after doing some research, I found that the Windows API doesn't allow child windows to have menus as the idea is that they are supposed to use the parent window's menu instead. The Windows API command used to create the window allows you to pass either a menu container or a parent window in a parameter, but obviously not both... Therefore unless you can work out how to process events, and draw the device context yourself, you are stuck. You might want to try messing around with WS_POPUP instead of WS_CHILD instead, but the window has slightly different behaviour and requires a few module tweaks in Win32MaxGUI - however, I think they support menus. Check out MSDN for more info. |