Don't ask me again

BlitzMax Forums/BlitzMax GUI Programming/Don't ask me again

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

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:
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.