发布网友 发布时间:2024-03-10 05:08
共1个回答
热心网友 时间:2024-03-20 08:47
ShellExecute(this->m_hWnd,"Open","WordPad.exe","C:\\AutoExec.bat",NULL,SW_SHOWNORMAL); MSDN的函数解释为 ShellExecute Performs an operation on a specified file. HINSTANCE ShellExecute( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd ); Parameters hwnd [in] Handle to a parent window. This window receives any message boxes that an application produces, such as error reporting. lpOperation [in] Pointer to a null-terminated string, referred to in this case as a verb, that specifies the action to be performed. The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's shortcut menu are available verbs. For more information about verbs and their availability, see Object Verbs. See Extending Shortcut Menus for further discussion of shortcut menus. The following verbs are commonly used. Verb Description edit Launches an editor and opens the document for editing. If lpFile is not a document file, the function will fail. explore Explores the folder specified by lpFile. find Initiates a search starting from the specified directory. open Opens the file specified by the lpFile parameter. The file can be an executable file, a document file, or a folder. print Prints the document file specified by lpFile. If lpFile is not a document file, the function will fail. If you set this parameter to NULL: For systems prior to Microsoft® Windows® 2000, the default verb is used if it is valid and available in the registry. If not, the "open" verb is used. For Windows 2000 and later systems, the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first 查看原帖>>