?? subject_50621.htm
字號:
<p>
序號:50621 發表者:petpet 發表日期:2003-08-25 10:52:00
<br>主題:請問怎么在vc++里調用xp里的cmd的命令?。。?<br>內容:我想在vc++里調用xp命令提示符下的可以用的好象netsh -f c:\ll.txt這樣的命令應該怎么辦??!
<br><a href="javascript:history.go(-1)">返回上頁</a><br><a href=http://www.copathway.com/cndevforum/>訪問論壇</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回復者:iamhere 回復日期:2003-08-25 10:55:26
<br>內容:使用ShellExecute,你的情況試試下面的調用:<BR>ShellExecute( NULL , "open" , "netsh" , "-f C:\\ll.txt" , NULL , SW_SHOW );
<br>
<a href="javascript:history.go(-1)">返回上頁</a><br><a href=http://www.copathway.com/cndevforum/>訪問論壇</a></p></blockquote>
<hr size=1>
<blockquote><p>
回復者:michael 回復日期:2003-08-25 11:03:54
<br>內容:ShellExecuteEx Function<BR><BR>--------------------------------------------------------------------------------<BR><BR>Performs an action on a file. <BR><BR>Syntax<BR><BR>BOOL ShellExecuteEx( LPSHELLEXECUTEINFO lpExecInfo<BR>);<BR>Parameters<BR><BR>lpExecInfo<BR>Address of a SHELLEXECUTEINFO structure that contains and receives information about the application being executed. <BR>Return Value<BR><BR>Returns TRUE if successful, or FALSE otherwise. Call GetLastError for error information. <BR><BR>Remarks<BR><BR>With multiple monitors, if you specify an HWND and set the lpVerb member of lpExecInfo to "Properties", any windows created by ShellExecuteEx may not appear in the correct position. <BR><BR>If the function succeeds, it sets the hInstApp member of the SHELLEXECUTEINFO structure to a value greater than 32. If the function fails, hInstApp is set to the SE_ERR_XXX error value that best indicates the cause of the failure. Although hInstApp is declared as an HINSTANCE for compatibility with 16-bit Microsoft&reg; Windows&reg; applications, it is not a true HINSTANCE. It can only be cast to an int and compared to either 32 or the SE_ERR_XXX error codes.<BR><BR><BR>Note The SE_ERR_XXX error values are provided for compatibility with ShellExecute. To retrieve more accurate error information, use GetLastError. It may return one of the following values:<BR><BR>Error Description <BR>ERROR_FILE_NOT_FOUND The specified file was not found. <BR>ERROR_PATH_NOT_FOUND The specified path was not found. <BR>ERROR_DDE_FAIL The Dynamic Data Exchange (DDE) transaction failed. <BR>ERROR_NO_ASSOCIATION There is no application associated with the given file name extension. <BR>ERROR_ACCESS_DENIED Access to the specified file is denied. <BR>ERROR_DLL_NOT_FOUND One of the library files necessary to run the application can't be found. <BR>ERROR_CANCELLED The function prompted the user for additional information, but the user canceled the request. <BR>ERROR_NOT_ENOUGH_MEMORY There is not enough memory to perform the specified action. <BR>ERROR_SHARING_VIOLATION A sharing violation occurred. <BR><BR><BR>Windows 95/98/Me: ShellExecuteEx is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.<BR><BR>Function Information<BR><BR>Minimum DLL Version shell32.dll version 4.0 or later <BR>Custom Implementation No <BR>Header shellapi.h <BR>Import library shell32.lib <BR>Minimum operating systems Windows NT 4.0, Windows 95 <BR><BR> 摘自MSDN
<br>
<a href="javascript:history.go(-1)">返回上頁</a><br><a href=http://www.copathway.com/cndevforum/>訪問論壇</a></p></blockquote>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -