WinLoadSecondaryWindow and WinSecondaryWindow create secondary windows from dialog templates in a resource file. WinSecondaryWindow creates a modal window and supports the processing and destruction of the modal dialog window. WinSecondaryWindow is equivalent to the the following code sequence.
hwndSW = WinLoadSecondaryWindow(...); usResult = WinProcessSecondaryWindow(hwndSW); WinDestroySecondaryWindow(hwndSW);
WinSecondaryWindow and WinProcessSecondaryWindow functions do not return until WinDismissSecondaryWindow is called. If your secondary window procedure handles WM_COMMAND messages, it must call WinDismissSecondaryWindow after calling the WinSecondaryWindow or the WinProcessSecondaryWindow function. Optionally, your window procedure can pass WM_COMMAND messages to WinDefSecondaryWindowProc, which calls WinDismissSecondaryWindow.
WinDismissSecondaryWindow hides the secondary window and returns a result code for a WM_COMMAND message, causing WinSecondaryWindow and WinProcessSecondaryWindow to return. For example, if the user selects the OK button, your window procedure passes the DID_OK code with WinDismissSecondaryWindow. Although the secondary window is hidden, it still exists. In the case of WinProcessSecondaryWindow, the window procedure must call WinDestroySecondaryWindow. Before WinSecondaryWindow returns, it destroys the secondary window.