How is the .NET event, Application.OnIdle, coded in Win32? (i.e. What is going on behind the scenes?).
How is the .NET event, Application.OnIdle, coded in Win32? (i.e. What is going on
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A classic Win32 message loop is something like this:
There is also a
PeekMessage()function that tests to see whether a message is available. With that, you can modify the message loop as:The above loop will call the translate/dispatch while there are still messages available to process, then when there are no more it will call
onIdle(). Then it returns to the outer loop to callGetMessage()again to wait for the next message.Note that this is one possible way to implement onIdle functionality in Win32. I don’t know whether this is the same way .NET does it.