Page 2 of 2

Posted: Mon Sep 05, 2005 1:58 pm
by PB
> dont forget to put your cursor miles away of the window

Ah, now I see! :D I was actually moving the mouse in all the tests, because
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! :lol:

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

Posted: Mon Sep 05, 2005 2:01 pm
by nco2k
@PB
hehe yeah and now we can go drink some beers. :D

c ya,
nco2k

Posted: Mon Sep 05, 2005 2:04 pm
by PB
Image

;)