VB 'Halt Command' until Win causes an event exist?
Posted on 1998-12-19
Is there such a command to have my running app "halt" at a specific point in my code until windows sneds back ANY kind of event destined for my program? The reason i ask is because i am using the "Winsock" control and noticed that i usually have to run a:
loop until Whatever=DONE
when i do this i notice that my CPU usage jumps up to 100% and NEVER drops down. I am looking for a more efficient way of controling my CPU usuage. Some of you may say just use the given winsock events ie. "Connect()" or "Close()" but i am also interested in actions like "Resolving Host", etc which are NOT an occuring event but part of the Winsock.state method which MUST be in an infinite loop to be able to tell what kind of state it is in at any one moment.
With a kind of "suspending" function i am hoping that it will reactivate my program at where it left off when an incoming winsock command does occur (specificaly "Resolving Host, etc).