Page 1 of 1
Loop in Win9x (solved)
Posted: Wed May 17, 2006 7:40 pm
by PureBaser
Code: Select all
OpenWindow(0,0,0,200,200,"Loop Test",#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget)
CreateGadgetList(WindowID(0))
ButtonGadget(0,0,80,25,20,"Ok")
CheckBoxGadget(1,0,180,60,20,"Loop")
SetActiveWindow(0)
Repeat
Ereignis = WaitWindowEvent()
Select Ereignis
Case #PB_Event_Gadget
If EventGadget() = 0
HideWindow(0,1)
If GetGadgetState(1) = 1
Repeat
MessageRequester("blah","blubberlub")
Until GetAsyncKeyState_(#VK_SHIFT)
Else
MessageRequester("blah","blubberlub")
EndIf
HideWindow(0,0)
EndIf
EndSelect
Until Ereignis = #PB_Event_CloseWindow
CloseWindow(0)
End
The loop in Win9x System does function spontaenous (sometimes its loop, sometimes not)! In WinXP is always ok. "$8000" is not helpful...
Posted: Wed May 17, 2006 8:06 pm
by ABBKlaus
does this help :
Code: Select all
GetAsyncKeyState_(#VK_SHIFT) & $8000
If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior
Posted: Wed May 17, 2006 9:43 pm
by josku_x
Use GetKeyState_() instead of GetAsyncKeyState_()
Posted: Thu May 18, 2006 12:25 pm
by PureBaser
I bet, that I tried the & $8000 and that didn't help a few time ago... But that was with PB 3.94 - so I had to try retry - and it's perfect

The Loop is correct!