Apparently it can be done in PureBasic with the following code:
Code: Select all
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_CloseWindowCode: Select all
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
WendMy question is what are the parameters PureBasic uses internally when creating a window with the API command CreateWindow() or CreateWindowEx()? Is there anything else that might make BlitzMax windows not work with this style, while PureBasic windows do?


