我同意bugs的<br>SHELLEXECUTEINFO<br>Contains information used by ShellExecuteEx. <br><br>typedef struct _SHELLEXECUTEINFO{<br> DWORD cbSize; <br> ULONG fMask; <br> HWND hwnd; <br> LPCTSTR lpVerb; <br> LPCTSTR lpFile; <br> LPCTSTR lpParameters; <br> LPCTSTR lpDirectory; <br> int nShow; <br> HINSTANCE hInstApp; <br> <br> // Optional members <br> LPVOID lpIDList; <br> LPCSTR lpClass; <br> HKEY hkeyClass; <br> DWORD dwHotKey; <br> union {<br> HANDLE hIcon;<br> HANDLE hMonitor;<br> };<br> HANDLE hProcess; <br>} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO; <br> <br>Members<br>cbSize <br>Size of the structure, in bytes. <br>fMask <br>Array of flags that indicate the content and validity of the other structure members. This can be a combination of the following values. SEE_MASK_CLASSKEY Use the class key given by the hkeyClass member. <br>SEE_MASK_CLASSNAME Use the class name given by the lpClass member. <br>SEE_MASK_CONNECTNETDRV Validate the share and connect to a drive letter. The lpFile member is a Universal Naming Convention (UNC) path of a file on a network. <br>SEE_MASK_DOENVSUBST Expand any environment variables specified in the string given by the lpDirectory or lpFile member. <br>SEE_MASK_FLAG_DDEWAIT Wait for the DDE conversation to terminate before returning (if the ShellExecuteEx function causes a DDE conversation to start). For circumstances in which this flag is necessary, see the Remarks section. <br>SEE_MASK_FLAG_NO_UI Do not display an error message box if an error occurs. <br>SEE_MASK_HMONITOR Use this flag when specifying a monitor on multimonitor systems. The monitor is specified in the hMonitor member. This flag cannot be combined with SEE_MASK_ICON. <br>SEE_MASK_HOTKEY Use the hot key given by the dwHotKey member. <br>SEE_MASK_ICON Use the icon given by the hIcon member. This flag cannot be combined with SEE_MASK_HMONITOR. <br>SEE_MASK_IDLIST Use the item identifier list given by the lpIDList member. The lpIDList member must point to an ITEMIDLIST structure. <br>SEE_MASK_INVOKEIDLIST Use the IContextMenu interface of the selected item's context menu handler. Use either lpFile to identify the item by its file system path or lpIDList to identify the item by its PIDL. This flag allows applications to use ShellExecuteEx to invoke verbs from context menu extensions instead of the static verbs listed in the registry. <br>SEE_MASK_NOCLOSEPROCESS Use to indicate that the hProcess member receives the process handle. This handle is typically used to allow an application to find out when a process created with ShellExecuteEx terminates. In some cases, such as when execution is satisfied through a DDE conversation, no handle will be returned. The calling application is responsible for closing the handle when it is no longer needed. <br>SEE_MASK_NO_CONSOLE Use to create a console for the new process instead of having it inherit the parent's console. It is equivalent to using a CREATE_NEW_CONSOLE flag with CreateProcess. <br>SEE_MASK_UNICODE Use this flag to indicate a Unicode application. <br><br>hwnd <br>Window handle to any message boxes that the system might produce while executing this function. <br>lpVerb <br>String, referred to 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 context menu are available verbs. For more specific information about verbs, see Object Verbs. For further discussion of context menus, see Extending Context Menus. The following verbs are commonly used. edit Launches an editor and opens the document for editing. If lpFile is not a document file, the function will fail. <br>explore Explores the folder specified by lpFile. <br>find Initiates a search starting from the specified directory. <br>open Opens the file specified by the lpFile parameter. The file can be an executable file, a document file, or a folder. <br>print Prints the document file specified by lpFile. If lpFile is not a document file, the function will fail. <br>properties Displays the file or folder's properties. <br><br>If you set this parameter to NULL:<br><br>For systems prior to Microsoft&reg; Windows&reg; 2000, the default verb is used if it is valid and available in the registry. If not, the "open" verb is used. <br>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 verb listed in the registry. <br>lpFile <br>Address of a null-terminated string that specifies the name of the file or object on which ShellExecuteEx will perform the action specified by the lpVerb parameter. The system registry verbs that are supported by the ShellExecuteEx function include "open" for executable files and document files and "print" for document files for which a print handler has been registered. Other applications might have added shell verbs through the system registry, such as "play" for AVI and WAV files. To specify a shell namespace object, pass the fully qualified parse name and set the SEE_MASK_INVOKEIDLIST flag in the fMask parameter. <br>Note If the path is not included with the name, the current directory is assumed. <br><br>lpParameters <br>Address of a null-terminated string that contains the application parameters. The parameters must be separated by spaces. To include double quotation marks, enclose each mark in a pair of quotation marks, as in the following example. <br>sei.lpParameters = "An example: /"/"/"quoted text/"/"/"";<br><br>In this case, the application receives three parameters: An, example:, and "quoted text".<br><br>If the lpFile member specifies a document file, this member should be NULL. <br><br>lpDirectory <br>Address of a null-terminated string that specifies the name of the working directory. If this member is not specified, the current directory is used as the working directory. <br>nShow <br>Flags that specify how an application is to be shown when it is opened. It can be one of the SW_ values listed for the ShellExecute function. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it. <br>hInstApp <br>If the function succeeds, it sets this member to a value greater than 32. If the function fails, it is set to an SE_ERR_XXX error value that indicates the cause of the failure. Although hInstApp is declared as an HINSTANCE for compatibility with 16-bit Windows applications, it is not a true HINSTANCE. It can be cast only to an integer and compared to either 32 or the following SE_ERR_XXX error codes. SE_ERR_FNF File not found. <br>SE_ERR_PNF Path not found. <br>SE_ERR_ACCESSDENIED Access denied. <br>SE_ERR_OOM Out of memory. <br>SE_ERR_DLLNOTFOUND Dynamic-link library not found. <br>SE_ERR_SHARE Cannot share an open file. <br>SE_ERR_ASSOCINCOMPLETE File association information not complete. <br>SE_ERR_DDETIMEOUT DDE operation timed out. <br>SE_ERR_DDEFAIL DDE operation failed. <br>SE_ERR_DDEBUSY DDE operation is busy. <br>SE_ERR_NOASSOC File association not available. <br><br>lpIDList <br>Address of an ITEMIDLIST structure to contain an item identifier list uniquely identifying the file to execute. This member is ignored if the fMask member does not include SEE_MASK_IDLIST. <br>lpClass <br>Address of a null-terminated string that specifies the name of a file class or a globally unique identifier (GUID). This member is ignored if fMask does not include SEE_MASK_CLASSNAME. <br>hkeyClass <br>Handle to the registry key for the file class. This member is ignored if fMask does not include SEE_MASK_CLASSKEY. <br>dwHotKey <br>Hot key to associate with the application. The low-order word is the virtual key code, and the high-order word is a modifier flag (HOTKEYF_). For a list of modifier flags, see the description of the WM_SETHOTKEY message. This member is ignored if fMask does not include SEE_MASK_HOTKEY. <br>hIcon <br>Handle to the icon for the file class. This member is ignored if fMask does not include SEE_MASK_ICON. <br>hMonitor <br>Handle to the monitor upon which the document is to be displayed. This member is ignored if fMask does not include SEE_MASK_HMONITOR. <br>hProcess <br>Handle to the newly started application. This member is set on return and is always NULL unless fMask is set to SEE_MASK_NOCLOSEPROCESS. Even if fMask is set to SEE_MASK_NOCLOSEPROCESS, hProcess will be NULL if no process was launched. For example, if a document to be launched is a URL and an instance of Microsoft&reg; Internet Explorer is already running, it will display the document. No new process is launched, and hProcess will be NULL. <br>Remarks<br>The SEE_MASK_DDEWAIT flag must be specified if the thread calling ShellExecuteEx does not have a message loop or if the thread or process will terminate soon after ShellExecuteEx returns. Under such conditions, the calling thread will not be available to complete the DDE conversation, so it is important that ShellExecuteEx complete the conversation before returning control to the caller. Failure to complete the conversation can result in an unsuccessful launch of the document.<br><br>If the calling thread has a message loop and will exist for some time after the call to ShellExecuteEx returns, the SEE_MASK_DDEWAIT flag is optional. If the flag is omitted, the calling thread's message pump will be used to complete the DDE conversation. The calling application regains control sooner, since the DDE conversation can be completed in the background. <br><br>Requirements <br> Windows NT/2000: Requires Windows NT 3.51 or later. <br> Windows 95/98: Requires Windows 95 or later. <br> Header: Declared in Shellapi.h. <br>------------------------------------------------------------以上是结构<br><br><br>ShellExecuteEx<br>Performs an action on a file. <br><br><br><br>BOOL ShellExecuteEx(<br> LPSHELLEXECUTEINFO lpExecInfo<br>);<br><br>Parameters<br>lpExecInfo <br>Address of a SHELLEXECUTEINFO structure that contains and receives information about the application being executed. <br>Return Values<br>Returns TRUE if successful, or FALSE otherwise. Call GetLastError for error information. <br><br>Remarks<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 Windows applications, it is not a true HINSTANCE. It can only be cast to an integer and compared to either 32 or the SE_ERR_XXX error codes.<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_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 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>See Also<br>IShellExecuteHook<br><br>Requirements <br> Version 4.00 and later of Shell32.dll<br><br> Windows NT/2000: Requires Windows NT 4.0 or later. <br> Windows 95/98: Requires Windows 95 or later. <br> Header: Declared in shellapi.h. <br> Import Library: shell32.lib<br>---------------------------------------------以上是api<br>