je crée une fenetre par openwindow avec le parametre #PB_Window_SystemMenu
si je veux par la suite lui rajouter le parametre #PB_Window_SizeGadget
comment fais-je ?
avec des sendmessage, je suppose ?
pat
changer les options #PB_Window_... à l'execution
Yep, ya pas d'autres solutions que de passer par l'api win32 sauf pour StickyWindow() dans PB4
Un tout petit example :
Un tout petit example :
Code : Tout sélectionner
If OpenWindow(1,0,0,320,240,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"style")
hWnd1 = WindowID(1)
If CreateGadgetList(hWnd1)
ButtonGadget(1,50,50,100,22,"style",#PB_Button_Toggle)
EndIf
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case 1
Select GetGadgetState(1)
Case 0
Style = GetWindowLong_(hWnd1,#GWL_STYLE) | #WS_DLGFRAME
ExStyle = GetWindowLong_(hWnd1,#GWL_EXSTYLE) | #WS_EX_WINDOWEDGE
SetWindowLong_(hWnd1,#GWL_STYLE,Style)
SetWindowLong_(hWnd1,#GWL_EXSTYLE,ExStyle)
SetWindowPos_(hWnd1,#HWND_TOPMOST,0,0,0,0,#SWP_FRAMECHANGED|#SWP_NOMOVE|#SWP_NOSIZE)
Case 1
Style = GetWindowLong_(hWnd1,#GWL_STYLE) - #WS_DLGFRAME
ExStyle = GetWindowLong_(hWnd1,#GWL_EXSTYLE) - #WS_EX_WINDOWEDGE
SetWindowLong_(hWnd1,#GWL_STYLE,Style)
SetWindowLong_(hWnd1,#GWL_EXSTYLE,ExStyle)
SetWindowPos_(hWnd1,#HWND_TOPMOST,0,0,0,0,#SWP_FRAMECHANGED|#SWP_NOMOVE|#SWP_NOSIZE)
EndSelect
EndSelect
EndSelect
ForEver
EndIf