strange event on StringGadget/EditorGadget

Windows specific forum
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

strange event on StringGadget/EditorGadget

Post by breeze4me »

I should do something while there are no events, but strange event is occurred on the StringGadget or EditorGadget focussed.

If the timeout value of WaitWindowEvent() is very low, then event 0 is retured, but with high value, value 280 is returned instead of 0.

What's that event?

Tested on XP SP2, PB v4.40 b6 x86. (compile with unicode option)

Code: Select all

Procedure wndproc(h, m, w, l)
  res = #PB_ProcessPureBasicEvents
  Debug "wndproc " + Str(m)
  ProcedureReturn res
EndProcedure

If OpenWindow(0, 0, 0, 230, 190, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  
  ;SetWindowCallback(@wndproc())
  
  StringGadget(1, 10, 10, 200, 20, "")
  SetActiveGadget(1)
  EditorGadget(2, 10, 40, 200, 120)
  ;SetActiveGadget(2)
  
  Repeat
    ;Event = WaitWindowEvent(100)
    Event = WaitWindowEvent(2000)
    ;Event = WaitWindowEvent(4000)
    
    Debug "main " + Str(Event)
    
    If Event = 0
      Debug "do something..."
    ElseIf Event = #PB_Event_Gadget
      Debug EventGadget()
    EndIf
  Until Event = #PB_Event_CloseWindow
EndIf

debug result. (timeout = 2000)
...
...
[21:29:39] main 280
[21:29:40] main 280
[21:29:40] main 280
[21:29:41] main 280
[21:29:42] main 280
[21:29:42] main 280
[21:29:43] main 280
[21:29:43] main 280
[21:29:44] main 280
[21:29:44] main 280
[21:29:45] main 280
[21:29:45] main 280
[21:29:46] main 280
[21:29:46] main 280
[21:29:47] main 280
[21:29:47] main 280
[21:29:48] main 280
...
...

debug (timeout = 100)
[21:54:27] main 0
[21:54:27] do something...
[21:54:27] main 0
[21:54:27] do something...
[21:54:27] main 280 <----
[21:54:27] main 0
[21:54:27] do something...
[21:54:27] main 0
[21:54:27] do something...
[21:54:27] main 0
[21:54:27] do something...
[21:54:27] main 0
[21:54:27] do something...
[21:54:27] main 0
[21:54:27] do something...
[21:54:27] main 280 <----
[21:54:27] main 0
[21:54:27] do something...
[21:54:28] main 0
[21:54:28] do something...
[21:54:28] main 0
[21:54:28] do something...
[21:54:28] main 0
[21:54:28] do something...
[21:54:28] main 0
[21:54:28] do something...
[21:54:28] main 280 <----
[21:54:28] main 0
[21:54:28] do something...
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Re: strange event on StringGadget/EditorGadget

Post by Arctic Fox »

I think it's the undocumented WM_SYSTIMER event which is sent when the caret blinks.
http://social.msdn.microsoft.com/forums ... a0ed0d2e0a
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: strange event on StringGadget/EditorGadget

Post by breeze4me »

Thank you. :D
Post Reply