Ah, now I see!

I thought you needed to ensure the window "worked" during the wait. When
I don't move the mouse (eg. if I just hit F5 to compile/run and do nothing else)
then yes, the MessageRequester NEVER pops up.

I'm glad you finally made me see the light!

I'd just do it like this (which doesn't need PostMessage or a callback):
Code: Select all
Global ThreadEnd.l
Procedure Thread()
Delay(Random(4000)+1000)
ThreadEnd = #True
EndProcedure
If OpenWindow(0, 300, 200, 480, 320, #PB_Window_SystemMenu, "test")
If CreateThread(@Thread(), 0)
Repeat
Select WindowEvent()
Case 0
Delay(1) ; To not use 100% CPU.
Case #PB_Event_CloseWindow
End
EndSelect
If ThreadEnd = #True
Break
EndIf
ForEver
MessageRequester("test", "test")
EndIf
EndIf