Windows起動パラメータ付きexe
1428 ワード
Windowsでexeを起動するには3つの一般的なAPIがあります:WinExec ShellExecute createprocessasuser C:Program FilesGuest Toolstest.exeの例:
WinExec :
UINT WinExec(
LPCSTR lpCmdLine, //
UINT uCmdShow //
);
WinExec("Notepad.exe", SW_SHOW); //
WinExec("cmd.exe /c \"C:\\Program Files\\Guest Tools\\test.exe\" 33",0); // 33 。
ShellExecute
:
HINSTANCE ShellExecute(
HWND hwnd, //
LPCTSTR lpOperation, // , "edit","explore","open","find","print","NULL"
LPCTSTR lpFile, // ,
LPCTSTR lpParameters, //
LPCTSTR lpDirectory, //
INT nShowCmd //
);
ShellExecute(NULL,"open","C:\\Program Files\\Guest Tools\\test.exe","33",NULL, SW_SHOW);
createprocessasuser !!!