ProcessMessage - processes one message in the message queue;
ProcessMessages - processes all accumulated messages in the message queue for the window;
ProcessMessagesEx - the same as the previous method, but works better for cases where the application is minimized or is not a background application. Usually the previous method is sufficient. This method pre-sends the CM_PROCESS message to the window in order to "stir up" the message queue;
ProcessPendingMessages - similar to ProcessMessages, but if there are no messages from the mouse and keyboard in the queue, then an immediate return occurs and execution continues;
ProcessPaintMessages - the same as ProcessMessages, but messages are executed only as long as there is at least one message for drawing WM_PAINT windows in the queue, and if there are no such messages in the queue, control returns immediately;
OnQueryEndSession - an event for an applet that allows you to "respond" to a system request about the possibility of terminating the current session (and rebooting or turning off the power). During execution, the handler for this event can ask the user to write unsaved data to disk, for example, or to perform some other action. The handler can further parse the reasons for the request in the CloseQueryReason property;
|
Please note: if such a handler is not installed, and you yourself do not process such a message in any way, then when the Windows session ends, your application will be unloaded without warning, and the OnDestroy events will not even be triggered. The assignment of such a handler, even if it does nothing, increases the size of the application by more than a hundred bytes, but ensures the "correct" termination of the application, and if (your) additional code is present, it allows you to perform other actions, including prevent session termination. Note, however, that even if your application is working with documents or databases, it is not very good to ask questions of the user unnecessarily at the moment when he has already initiated shutdown. Just imagine the situation when you have a couple of dozen applications running, and when you try to log out, they all start asking a bunch of questions like "Are you sure? ...". This is annoying to say the least (and in an emergency it can lead to irreparable consequences!). In addition, completion without calling OnDestroy and other final handlers is by no means incorrect in all cases. There is a fairly wide class of applications (for which the KOL library was originally positioned) that can be terminated at any time. Since they do not perform modifications of data important for the user, their immediate termination does not threaten any troubles either for the user, or for the system, or for this application itself (if it is launched in the future). Even if your application saves any files or modifies the database or registry, consider immediately saving the application state without asking the user for permission: when the session ends, he may really have no time to deal with your questions. |
CloseQueryReason - contains one of the reasons for the request to end the session or to close the window (closing the window by the user, turning off the power, terminating the session by the user);
SupportMnemonics - this method provides processing by the form of pressing Alt + letter key combinations for mnemonics assigned to menu items, buttons, checkboxes (check box, radio box), and calling the OnClick handlers of the corresponding elements. If the method is called for an applet, then mnemonics are processed for all forms, and for each form this method is no longer required;
KeyPreview - for a form, provides preprocessing of keystrokes (for keys pressed on the keyboard when one of the form windows owns the input focus). For this property to work, you must also include the conditional compilation symbol KEY_PREVIEW in the project options;
ActiveControl - the active (i.e., keyboard focus) child visual object of the form.