Jaruzel.com

DoEvents_Sub Routine WITH the - GetInputState - API Call


'This will use GetInputState() to check whether there are
'any messages that needs to be processed and THEN it will
'call DoEvents() to process the messages. As a result, the
'code will be MANY times faster than if you used DoEvents()
'by itself.
'
'Add this API call to the Declaration section of your application.
Private Declare Function GetInputState Lib "user32" () As Integer

Do
'
'Checks if any messages are queued up before DoEvents()
'If there ARE messages that needs to be processed, THEN
'it will call DoEvents() and let the messages go ahead
'and process.
'
If GetInputState 0 Then Application.DoEvents()

Loop Until Me.Text = "Done"