用WinExec API函数可以实现。
原型如下:
UINT WinExec(
LPCSTR lpCmdLine, // command line
UINT uCmdShow // window style
);
详见MSDN。
原型如下:
UINT WinExec(
LPCSTR lpCmdLine, // command line
UINT uCmdShow // window style
);
详见MSDN。
HWND hwnd,
LPCTSTR lpVerb,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);详细看MSDN
::WinExec("C:\\Winnt\\system32\\calc.exe",SW_SHOWNORMAL);
可以打开计算器。
第二个参数指明窗口出现时的状态,可以参考ShowWindow函数的参数.
哈哈,谢谢指点,今天我又学到不少知识。