j'ai le code suivant qui marche très bien
Code : Tout sélectionner
WindowE = GetForegroundWindow_()
OpenWindow(0, 200, 200, 500, 500, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #WS_CLIPCHILDREN, "Options")
SetParent_(WindowE, WindowID())
SetWindowLong_(WindowE, #GWL_EXSTYLE, GetWindowLong_(WindowE, #GWL_EXSTYLE) | #WS_EX_MDICHILD)
; SetWindowLong_(WindowE, #GWL_STYLE, GetWindowLong_(WindowE, #GWL_STYLE) | #WS_CHILD)
MoveWindow_(WindowE, 0, 0, 400, 400, 1)
Repeat
Event = WaitWindowEvent()
Until Event = #WM_CLOSE
; SetWindowLong_(WindowE, #GWL_STYLE, GetWindowLong_(WindowE, #GWL_STYLE) ! #WS_CHILD)
SetWindowLong_(WindowE, #GWL_EXSTYLE, GetWindowLong_(WindowE, #GWL_EXSTYLE) ! #WS_EX_MDICHILD)
SetParent_(WindowE, 0)
j'ai ceci qui permet de garder le focus mais ça va pas génial (plus accés au menu, prob de rapidé de la fenêtre au niveau du rafraichissement, etc)
Code : Tout sélectionner
WindowE = GetForegroundWindow_()
OpenWindow(0, 200, 200, 500, 500, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #WS_CLIPCHILDREN, "Options")
SetParent_(WindowE, WindowID())
SetWindowLong_(WindowE, #GWL_EXSTYLE, GetWindowLong_(WindowE, #GWL_EXSTYLE) | #WS_EX_MDICHILD)
SetWindowLong_(WindowE, #GWL_STYLE, GetWindowLong_(WindowE, #GWL_STYLE) | #WS_CHILD)
MoveWindow_(WindowE, 0, 0, 400, 400, 1)
Repeat
Event = WaitWindowEvent()
Until Event = #WM_CLOSE
SetWindowLong_(WindowE, #GWL_STYLE, GetWindowLong_(WindowE, #GWL_STYLE) ! #WS_CHILD)
SetWindowLong_(WindowE, #GWL_EXSTYLE, GetWindowLong_(WindowE, #GWL_EXSTYLE) ! #WS_EX_MDICHILD)
SetParent_(WindowE, 0)
Merci