Method:
1. First write the registry SoftwareMicrosoftWindowsCurrentVersionRun
2. Add a sub-Key and set the value
3. Instantiate window specific window (CXDlg)
4. Run with the window hidden
CXDlg dlg;
m_pMainWnd = &dlg;
dlg.Create(CXDlg::IDD, NULL);//Create window
dlg.ShowWindow(SW_HIDE); //Hide operation
dlg.RunModalLoop(); //Simulate DoModal
My self-starting method is to add scheduled tasks.
If you want the program to be hidden, you need to add a parameter when compiling:
-ldflags=”-Hwindowsgui”
Method:
1. First write the registry SoftwareMicrosoftWindowsCurrentVersionRun
2. Add a sub-Key and set the value
3. Instantiate window specific window (CXDlg)
4. Run with the window hidden
CXDlg dlg;
m_pMainWnd = &dlg;
dlg.Create(CXDlg::IDD, NULL);//Create window
dlg.ShowWindow(SW_HIDE); //Hide operation
dlg.RunModalLoop(); //Simulate DoModal
SW_HIDE is simple and practical. Why do you want to use other methods?