At any time, there is always a front-end window on the Windows desktop. Simply put, the title bar is the window that turns into a dark blue, this window is the foreground window, and other windows are the background window ). The thread used to create the foreground window is the foreground thread, which is not necessarily the main thread of the application.
The thread maintains the current active window and focus window. The focus window is actually only an attribute of the window, in fact, "focus state" is a property of the window, and the top-level window of the Focus window is an active window. For example, a dialog box contains a button. When the button gets the focus, this button is the focus window, And the dialog box containing this button is the activity window. If window nesting occurs, the most root window is the activity window.
The above two paragraphs have already described the foreground window, the activity window and the focus window, but what is the difference between the foreground window and the activity window?
The focus window is just a local concept. Not all focus windows can obtain Keyboard Events. Only the focus window of the foreground thread can obtain the keyboard event (So setfocus () from the system queue, and the active window in the foreground thread is the foreground window. There may be only one activated window in the system at any time, which is the foreground window. This answers the question in the previous section: the thread connected to the system queue is the foreground thread, and the window that can get the keyboard event is the focus window of the foreground thread. (The above text is quoted from the beginning of the article)
I believe that understanding these descriptions can help you.
Although the isdialogmessage function is extended for a non-modal dialog box, it can be used in any window containing control. When isdialogmessage processes a message, it detects the keyboard information and converts them toSelect command. For example, when you press tab, select the next control group or control group. When you press down, select the next control group. Because the isdialogmessage function needs to perform all necessary changes and transmission of messages, the messages processed by the isdialogmessage function do not have to be transferred to the translatemessage or dispatchmessage function for processing. The isdialogmessage function sends wm_getdlgetdlgcode to the dialog box application and determines which key to process. The lsdialogmessage function sends the dma_etdefid and dm_setdefid messages to the window. These messages are defined as wm_user and wm_user + 1 in the winuserh header file. Therefore, messages with the same value as those defined by the application conflict.
For details about how to explain the return values of wndproc, depending on different messages, refer to specific message descriptions.
How to explain the return values of wndproc depends on different messages. For details, refer to specific message descriptions.