Bon alors ça cette fois ça devrait aller, impossible de désactiver la fenêtre tant que tu cliques pas sur le bouton. Pas visible dans le Gestionnaire de Tâches, visible avec Alt + Tab, mais ne peut normalement pas perdre le focus :
Code : Tout sélectionner
OpenLibrary(0, "user32.dll")
Procedure.s WindowsEnu()
Static Flag,hWnd
Repeat
If Flag=0
hWnd = CallFunction(0, "FindWindowA", 0, 0 )
Flag=1
Else
hWnd = CallFunction(0, "GetWindow", hWnd, 2)
EndIf
If hWnd <> 0
If CallFunction(0, "GetWindowLongA", hWnd, -16) & $10000000 = $10000000; pour lister que les fenêtres visibles
If CallFunction(0, "GetWindowLongA", hWnd, -20) & 256 <> 256 ; pour lister que les fenêtres qui ne sont pas des ToolWindow ou barre d'outils
retour.s = Space(256)
CallFunction(0, "GetWindowTextA", hWnd, retour, 256)
If retour<>"" : Break : EndIf
EndIf
EndIf
Else
Flag=0
EndIf
Until hWnd=0
ProcedureReturn retour
EndProcedure
Procedure GetHandl(WindowsName.s)
retour= CallFunction(0, "FindWindowA", 0, WindowsName)
ProcedureReturn retour
EndProcedure
Procedure Tim()
CallFunction(0, "SetForegroundWindow", WindowID())
EndProcedure
Procedure Time(TimerId,Delay,ProcedureAdress)
CallFunction(0, "SetTimer", WindowID(),TimerId,Delay,ProcedureAdress)
EndProcedure
Procedure TimeKill(TimerId)
CallFunction(0, "KillTimer", WindowID(),TimerId)
EndProcedure
OpenWindow(1, 0, 0, 0, 0, #PB_Window_Invisible, "", CallFunction(0, "GetDesktopWindow"))
OpenWindow(0, 0, 0, 500, 500, #PB_Window_ScreenCentered, "test", WindowID(1))
CreateGadgetList(WindowID())
ButtonGadget(0, 0, 0, 50, 20, "Ok")
Procedure MakeRequester(WindowId, State)
State = 1 - State
If state = 0
Time(0, 1, @tim())
Else
TimeKill(0)
EndIf
x.s = WindowsEnu()
While x
If GetHandl(x) <> WindowId
CallFunction(0, "EnableWindow", GetHandle(x), State)
EndIf
x = WindowsEnu()
Wend
EndProcedure
MakeRequester(WindowID(), #True)
Repeat
Until WaitWindowEvent() = #PB_Event_Gadget And EventGadgetID() = 0
MakeRequester(WindowID(), #False)
S'il y a besoin d'expliquation ( et bien sur que c'est ca que tu cherches

), demande et j'essayerais de répondre