That's better, but the lack of a close button really bugs me. It's got to be possible, because I see applications that have the top-left icon removed, all the time. The Firefox options window is one example.
Apparently, someone over at PureBasic was able to do this by adding WS_EX_DLGMODALFRAME to the GWL_EXSTYLE:
However, it doesn't work in BlitzMax:
Now that I stopped and noticed how almost every program uses child windows without that top-left-corner icon, this is bugging me a lot. Open Paint Shop Pro or FireFox, and everything uses the same icon-less child window.
Apparently, someone over at PureBasic was able to do this by adding WS_EX_DLGMODALFRAME to the GWL_EXSTYLE:
OpenWindow(0, 0, 0, 240, 100, "Modal frame", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered | #PB_Window_Invisible) SetWindowLong_(WindowID(0), #GWL_EXSTYLE, GetWindowLong_(WindowID(0), #GWL_EXSTYLE) | #WS_EX_DLGMODALFRAME) HideWindow(0, 0) Repeat Until WaitWindowEvent() = #PB_Event_CloseWindow
However, it doesn't work in BlitzMax:
Extern "win32" Function SetWindowLong:Int(hwnd:Int,index:Int,value:Int)="SetWindowLongA@12" Function GetWindowLong:Int(hWnd:Int, index:Int)="GetWindowLongA@8" EndExtern Local w=400 Local h=300 Local win:TGadget=CreateWindow("Window",(Desktop().ClientWidth()-w)/2,(Desktop().ClientHeight()-h)/2,w,h,Null,WINDOW_HIDDEN+WINDOW_TITLEBAR) Local hWnd:Int = QueryGadget(win,QUERY_HWND) SetWindowLong hWnd,GWL_EXSTYLE,GetWindowLong(hwnd,GWL_EXSTYLE)+WS_EX_DLGMODALFRAME SetWindowPos( hWnd, 0,0,0,0,0, SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER ) ShowGadget win While WaitEvent()<>EVENT_WINDOWCLOSE Wend
Now that I stopped and noticed how almost every program uses child windows without that top-left-corner icon, this is bugging me a lot. Open Paint Shop Pro or FireFox, and everything uses the same icon-less child window.