what is the command in PB correspond to VB's "DoEvens&a
what is the command in PB correspond to VB's "DoEvens&a
Dear all,
Plz tell me what 's the command in PB correspond to VB's "DoEvens"?
And How to use it?
Thanks a lot!
Anne Hsieh
Plz tell me what 's the command in PB correspond to VB's "DoEvens"?
And How to use it?
Thanks a lot!
Anne Hsieh
Re: what is the command in PB correspond to VB's "DoEve
DoEvents = WindowEvent() in PB.annehsieh wrote:Dear all,
Plz tell me what 's the command in PB correspond to VB's "DoEvens"?
And How to use it?
Thanks a lot!
Anne Hsieh
Use it as the same, per example in loops, etc.
ARGENTINA WORLD CHAMPION
Re: what is the command in PB correspond to VB's "DoEve
Thanks!!!ricardo wrote:DoEvents = WindowEvent() in PB.annehsieh wrote:Dear all,
Plz tell me what 's the command in PB correspond to VB's "DoEvens"?
And How to use it?
Thanks a lot!
Anne Hsieh
Use it as the same, per example in loops, etc.
Almost right
The definition for Visual Basic's DoEvents is:
So is there possibly an API call that can duplicate the DoEvents command?
The definition for PureBasic's WindowEvent() is:DoEvents switches control to the operating-environment kernel. Control returns to your application as soon as all other applications in the environment have had a chance to respond to pending events.
Notice the difference? The DoEvents command gives control to the OS so it can process it's event que where the WindowEvent() command only checks for events relating to the openned windows (for the current PureBasic program?).Check if an event has occured on any of the opened windows.
So is there possibly an API call that can duplicate the DoEvents command?
The problem with that is that until an event for the PureBasic program occurs it stops the program, I want to be able to put this in a loop so the program won't hog the system. WindowEvent() works to a degree but it won't let me do anything with the PureBasic program window (like move or minimise it).Berikco wrote:Just use WaitWindowEvent()
After doing some digging on the Internet I ran across a page that shows how to implement the DoEvents in Visual Basic CE (which doesn't have the DoEvents command) using API calls.
http://www.vbce.com/code/vbce6/doevents/index.asp
I've converted it to PureBasic:
A C programmer friend who uses the API exclusively (says he doesn't like MFC) recommended I put the Sleep_ in there for good measure. I could have used Delay there but I wasn't sure if the Delay command was the same as Sleep_ and it was just as easy to type so...
http://www.vbce.com/code/vbce6/doevents/index.asp
I've converted it to PureBasic:
Code: Select all
Procedure DoEvents()
msg.MSG
If PeekMessage_(@msg,0,0,0,1)
TranslateMessage_(@msg)
DispatchMessage_(@msg)
Else
Sleep_(1)
EndIf
EndProcedure


