@TSSOFT
Thanks TsSoft for your quick answer

In fact it's in a big code ...so big...even me i'm lost in it

I have a window with animation inside
And the only way i found for catch a right click on it, it's use callback
At the beginning i have put a variable to #true for quit the program
And take a look on this variable for see if she is at true for quit
This an example a little bit like my code, but in simple
Code:
Global Quit
Procedure WinCallback(WindowID, Message, wParam, lParam)
Result.l = #PB_ProcessPureBasicEvents
If Message = #WM_SIZE
Select wParam
Case #SIZE_MINIMIZED
MessageRequester( "info", "minimizé", 0)
HideWindow(1, 0)
Case #SIZE_MAXIMIZED
MessageRequester( "info", "maximizé", 0)
Case #SIZE_RESTORED
MessageRequester(" info", "restoré", 0)
EndSelect
ElseIf Message = #WM_RBUTTONDOWN
Reponse = MessageRequester("", "Do you want to quit ?", #PB_MessageRequester_YesNo)
If Reponse = 6
Quit = #True
EndIf
EndIf
ProcedureReturn Result
EndProcedure
If OpenWindow(0, 0, 0, 300, 300, "CallBack", #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
SetWindowCallback(@WinCallback())
Repeat
Event = WaitWindowEvent()
Until Event = #WM_CLOSE Or Quit
EndIf
But the CallBack is more faster and she run several time before the event see the value of Quit
So i do like this, put the END inside the Callback
Code:
Procedure WinCallback(WindowID, Message, wParam, lParam)
Result.l = #PB_ProcessPureBasicEvents
If Message = #WM_SIZE
Select wParam
Case #SIZE_MINIMIZED
MessageRequester( "info", "minimizé", 0)
HideWindow(1, 0)
Case #SIZE_MAXIMIZED
MessageRequester( "info", "maximizé", 0)
Case #SIZE_RESTORED
MessageRequester(" info", "restoré", 0)
EndSelect
ElseIf Message = #WM_RBUTTONDOWN
Reponse = MessageRequester("", "Do you want to quit ?", #PB_MessageRequester_YesNo)
If Reponse = 6
End
EndIf
EndIf
ProcedureReturn Result
EndProcedure
If OpenWindow(0, 0, 0, 300, 300, "CallBack", #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
SetWindowCallback(@WinCallback())
Repeat
Event = WaitWindowEvent()
Until Event = #WM_CLOSE
EndIf
@SROD
Oooooh SROD is here too

Very very very glad to can talk to you since all this time

You got me scared with your disease

A little bit like a man who lost his head....because you remember in the team...i'm the legs

(And again, I am polite, because I'm rather the asshole)
Quote:
Safer than sticking your head in a lion's mouth, but only marginally more desirable!

I see you not lost your humor.....
Apparently..the answer is
