Une fenetre modale sans trop de problème je pense !
Code : Tout sélectionner
Enumeration
#Win0 : #WinM : #BP0 : #Image0
EndEnumeration
ExamineDesktops()
Procedure Open_Window_0()
OpenWindow (#Win0, 0, 0, 200, 80, "Fenetre Modale" , #PB_Window_SystemMenu|#PB_Window_ScreenCentered )
CreateGadgetList(WindowID(#Win0))
ButtonGadget(#BP0, 30, 20, 140, 30, "Fermer cette fenêtre")
EndProcedure
Procedure Modal(Win, Options)
HideWindow(Win,1)
Static WinA, Image
If Options = 1
#CAPTUREBLT = $40000000
Image = CreateImage ( #PB_Any, DesktopWidth (0), DesktopHeight (0))
dc_bur = GetDC_ (0)
DC_im = StartDrawing ( ImageOutput ( Image ))
BitBlt_ (DC_im,0,0 , DesktopWidth (0), DesktopHeight (0), dc_bur , 0,0 , #SRCPAINT|#CAPTUREBLT )
StopDrawing ()
ReleaseDC_ (0, dc_bur)
WinA = OpenWindow(#PB_Any,0, 0, DesktopWidth(0),DesktopHeight(0),"", #PB_Window_BorderLess|#PB_Window_Invisible )
Fond.LOGBRUSH\lbStyle=3 : Fond\lbColor=0 : Fond\lbHatch=ImageID(Image)
SetClassLong_(WindowID(WinA),-10,CreateBrushIndirect_(Fond))
HideWindow(WinA,0)
DisableWindow(WinA,1)
HideWindow(Win,0)
StickyWindow(Win,1)
ElseIf Options = 0
HideWindow(WinA,1)
StickyWindow(Win,0)
CloseWindow(WinA)
CloseWindow(Win)
EndIf
EndProcedure
Open_Window_0()
Modal(#Win0,1 )
Repeat
Event = WaitWindowEvent()
GadgetID = EventGadget()
If Event = #PB_Event_Gadget
If GadgetID = #BP0
Modal(#Win0,0 )
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
End