Code : Tout sélectionner
Procedure Open_PopupMenu(x.l, y.l)
#TailleX = 118
#TailleY = 118
If OpenWindow(0, x, y, #TailleX - 1, #TailleY - 1, #PB_Window_Invisible, "Découpeur")
SetWindowLong_(WindowID(), #GWL_EXSTYLE, GetWindowLong_(WindowID(), #GWL_EXSTYLE) ! #WS_EX_TOOLWINDOW) ; choix de la barre d'outil réduite
ShowWindow_(WindowID(), #SW_SHOW) ; montre la fenêtre
ResizeWindow(#TailleX, #TailleY)
ResizeWindow(#TailleX, #TailleY * 2 - WindowHeight()) ; redimensionne la fenetre
SetWindowPos_(WindowID(), -1, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE) ; mets la fenêtre toujours au premier plan
EndIf
EndProcedure
Open_PopupMenu(300, 300)
Repeat : Until WaitWindowEvent() = #PB_EventCloseWindow