You should look into GetWindowLongA and SetWindowLongA, with those two functions you can change a windows style and many other things like its wndproc.
THIS IS WINDOWS ONLY
heres a short example:SuperStrict
Global win:TGadget = CreateWindow( "Window", 0,0, 128,128, Null, WINDOW_RESIZABLE | WINDOW_TITLEBAR)
Global btn:TGadget = CreateButton( "Test", 32,32, 75,25, win)
Global btn2:TGadget = CreateButton( "Exit", 32,64, 75,25, win)
While WaitEvent()
Select EventID()
Case EVENT_GADGETACTION
Select EventSource()
Case btn
' change window style
Local hwnd:Int = QueryGadget( win, QUERY_HWND)
Local style:Int = GetWindowLongA( hwnd, GWL_STYLE)
SetWindowLongA( hwnd, GWL_STYLE, style & ~( WS_CAPTION | WS_BORDER | WS_THICKFRAME))
' only way i could get it to update itself
SetGadgetShape( win, GadgetX(win),GadgetY(win), GadgetWidth(win) + 1,GadgetHeight(win) + 1)
SetGadgetShape( win, GadgetX(win),GadgetY(win), GadgetWidth(win) - 1,GadgetHeight(win) - 1)
Case btn2
Exit
EndSelect
Case EVENT_WINDOWCLOSE
Exit
EndSelect
Wend
End Note, i could not get the window to update itself after the change, no matter which invalidate/redraw/whatever functions i tried. so i resorted to resizing it instead, which is allmost garuanteed ;)
|