Through configuration, the MFC dialog box is automatically hidden when the program starts

1. Configuration parameters

 Write the configuration parameters into the configuration file, first read the configuration file in OnInitDialog, and assign the corresponding parameters to: m_GlobalPara.m_HideWindow.

2. Add code

Add code in OnInitDialog as follows:

Among them: ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW) is to hide the taskbar icon;

WINDOWPLACEMENT wp;
        wp.length = sizeof(WINDOWPLACEMENT);
        wp.flags = WPF_RESTORETOMAXIMIZED;
        wp.showCmd = SW_HIDE;
        SetWindowPlacement(&wp);

By setting the structure parameters of the window position, the window is hidden

 

 

 

 

Guess you like

Origin blog.csdn.net/zhoufm260613/article/details/107616551