This is what I got
Code: Select all
OpenWindow(0, 550, 350, 0, 0, "", #PB_Window_BorderLess)
ButtonGadget(2,0,0,320,200,"button")
;\\
SetWindowLongPtr_(WindowID(0), #GWL_STYLE, GetWindowLongPtr_(WindowID(0), #GWL_STYLE) | #WS_SIZEBOX );
;\\
ResizeWindow(0,#PB_Ignore,#PB_Ignore,320,200)
While WaitWindowEvent() <> #PB_Event_CloseWindow : Wend
Code: Select all
Global oldProc, DWMEnabled
Procedure WndCallback(hWnd, Msg, wParam, lParam)
Select Msg
Case #WM_NCCALCSIZE
If wParam
ProcedureReturn 1
EndIf
EndSelect
ProcedureReturn #PB_ProcessPureBasicEvents ;CallWindowProc_(oldProc, hWnd, Msg, wParam, lParam)
EndProcedure
OpenWindow(0, 550, 350, 0, 0, "", #PB_Window_BorderLess)
ButtonGadget(2,0,0,320,200,"button")
SetWindowCallback(@WndCallback(), 0)
SetRect_(@Margin.RECT, 1, 0, 1, 0)
If OpenLibrary(0, "dwmapi.dll")
CallFunction(0, "DwmExtendFrameIntoClientArea", WindowID(0), @Margin)
CallFunction(0, "DwmIsCompositionEnabled", @DWMEnabled)
If DWMEnabled=0
MessageRequester("Info", "Desktop composition is disabled! Sorry, no shadow...")
SetWindowTheme_(WindowID(0), "", "")
EndIf
CloseLibrary(0)
EndIf
SetWindowLongPtr_(WindowID(0), #GWL_STYLE, GetWindowLongPtr_(WindowID(0), #GWL_STYLE) | #WS_SIZEBOX );
SetWindowPos_(WindowID(0), 0, 0, 0, 0, 0, #SWP_NOSIZE|#SWP_NOMOVE|#SWP_FRAMECHANGED|#SWP_SHOWWINDOW)
;\\
ResizeWindow(0,#PB_Ignore,#PB_Ignore,320,200)
While WaitWindowEvent() <> #PB_Event_CloseWindow : Wend