测试
afx_msg LRESULT CMainFrame::OnMsgResartCamera(WPARAM wParam, LPARAM lParam) {
/*OnMsgDisconnectCamera(0, 0);*/
//this->SendMessage(MSG_CONNECT_CAMERA);
//OnCmdStartGrab();
::PostMessage(AfxGetMainWnd()->m_hWnd, WM_SYSCOMMAND, SC_CLOSE, NULL);
//获取exe程序当前路径
TCHAR szAppName[MAX_PATH];
::GetModuleFileName(theApp.m_hInstance, szAppName, MAX_PATH);
CString strAppFullName;
strAppFullName.Format(_T("%s"), szAppName);
//重启程序
STARTUPINFO StartInfo;
PROCESS_INFORMATION procStruct;
memset(&StartInfo, 0, sizeof(STARTUPINFO));
StartInfo.cb = sizeof(STARTUPINFO);
::CreateProcess(
(LPCTSTR)strAppFullName,
NULL,
NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&StartInfo,
&procStruct);
return 0;
}