In this post, you’ll learn how to use the HandleMessage method or DelphiVCL.Application.HandleMessage to interrupt the execution of an application while Windows processes a message in the Windows message queue. Learning more about the HandleMessage method will help you build a Python project more easily in the future.
HandleMessage interrupts the execution of the application so that Windows can process a single message from the Windows message queue before returning control to the application. If the message queue is empty, HandleMessage generates an OnIdle event and starts the process of updating the actions in the application.
Note: If the application goes idle, HandleMessage may take a long time to return. Therefore, do not call HandleMessage when waiting for something message-based while priority actions are also being processed. Instead, call ProcessMessages when processing more than just messages.
Let’s browse all the properties and methods of the DelphiVCL.Application.HandleMessage using dir() command:
1 2 3 |
import DelphiVCL dir(DelphiVCL.Application.HandleMessage) |
See the responses in our Windows command prompt:
You can also read short information about the DelphiVCL.Application.HandleMessage using the print() command:
1 2 |
print(DelphiVCL.Application.HandleMessage) print(DelphiVCL.Application.HandleMessage.__doc__) |
See the responses in our Windows command prompt:
Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.