2024年3月30日发(作者:)

1. system方法:

原型:

view plain

1. int __cdecl system(const char *);

例如:

view plain

1. system("ipconfig");

2. WinExec方法:

相比于system方法,WinExec方法多了一个窗口参数:

原型:

view plain

1. UINT WinExec(

2. LPCSTR lpCmdLine,

3. UINT uCmdShow

4. );

例如:

WinExec("ipconfig", SW_SHOW);

参数可以是:SW_SHOW,,SW_SHOWMAXIMIZED,SW_SHOWMINIMIZED等等,

总体用法是差不多的。

3. ShellExecute方法:

这个方法主要用于open,edit,find等方法的操作:

原型:

view plain

1. HINSTANCE ShellExecute(

2. HWND hwnd,

3. LPCTSTR lpOperation,

4. LPCTSTR lpFile,