what is the Window number returned by EventWindow()?
The help does not specify what this will be but I always assumed it was the current window's number.
It appears that EventWindow() always returns 0 if PostEvent() is used without the optional window parameter.
Code: Select all
OpenWindow(10,0,0,250,200, "PostEvent & EventWindow", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_RightClick
PostEvent(#PB_Event_LeftClick) ;<-- this way generates EventWindow() = 0
;PostEvent(#PB_Event_LeftClick,10,#PB_Ignore) ;<-- this way works
Case #PB_Event_LeftClick
Ev_Window = EventWindow()
Debug "Event_LeftClick : EventWindow = " + Ev_Window
If Ev_Window <> 10 And Ev_Window <> -1
Debug "why? EventWindow() must be 10 or -1 "
EndIf
EndSelect
ForEver