2 * Shell Library Functions
4 * Copyright 1998 Marcus Meissner
5 * Copyright 2002 Eric Pouech
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43 #include "wine/winbase16.h"
44 #include "shell32_main.h"
45 #include "undocshell.h"
47 #include "wine/debug.h"
49 WINE_DEFAULT_DEBUG_CHANNEL(exec);
51 /***********************************************************************
52 * this function is supposed to expand the escape sequences found in the registry
53 * some diving reported that the following were used:
54 * + %1, %2... seem to report to parameter of index N in ShellExecute pmts
59 * %I adress of a global item ID (explorer switch /idlist)
60 * %L seems to be %1 as long filename followed by the 8+3 variation
62 * %* all following parameters (see batfile)
64 static BOOL argify(char* res, int len, const char* fmt, const char* lpFile)
81 if (!done || (*fmt == '1'))
83 if (SearchPathA(NULL, lpFile, ".exe", sizeof(xlpFile), xlpFile, NULL))
86 res += strlen(xlpFile);
91 res += strlen(lpFile);
95 default: FIXME("Unknown escape sequence %%%c\n", *fmt);
107 /*************************************************************************
108 * SHELL_ExecuteA [Internal]
111 static HINSTANCE SHELL_ExecuteA(char *lpCmd, LPSHELLEXECUTEINFOA sei, BOOL is32, BOOL shWait)
113 STARTUPINFOA startup;
114 PROCESS_INFORMATION info;
115 HINSTANCE retval = 31;
117 TRACE("Execute %s from directory %s\n", lpCmd, sei->lpDirectory);
118 ZeroMemory(&startup,sizeof(STARTUPINFOA));
119 startup.cb = sizeof(STARTUPINFOA);
120 startup.dwFlags = STARTF_USESHOWWINDOW;
121 startup.wShowWindow = sei->nShow;
124 if (CreateProcessA(NULL, lpCmd, NULL, NULL, FALSE, 0,
125 NULL, sei->lpDirectory, &startup, &info))
127 /* Give 30 seconds to the app to come up, if desired. Probably only needed
128 when starting app immediately before making a DDE connection. */
130 if (WaitForInputIdle( info.hProcess, 30000 ) == -1)
131 WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() );
132 retval = (HINSTANCE)33;
133 if(sei->fMask & SEE_MASK_NOCLOSEPROCESS)
134 sei->hProcess = info.hProcess;
136 CloseHandle( info.hProcess );
137 CloseHandle( info.hThread );
139 else if ((retval = GetLastError()) >= (HINSTANCE)32)
141 FIXME("Strange error set by CreateProcess: %d\n", retval);
142 retval = (HINSTANCE)ERROR_BAD_FORMAT;
146 retval = WinExec16(lpCmd, sei->nShow);
148 sei->hInstApp = retval;
152 /*************************************************************************
153 * SHELL_FindExecutable [Internal]
155 * Utility for code sharing between FindExecutable and ShellExecute
157 * lpFile the name of a file
158 * lpOperation the operation on it (open)
160 * lpResult a buffer, big enough :-(, to store the command to do the
161 * operation on the file
162 * key a buffer, big enough, to get the key name to do actually the
163 * command (it'll be used afterwards for more information
166 static HINSTANCE SHELL_FindExecutable(LPCSTR lpPath, LPCSTR lpFile, LPCSTR lpOperation,
167 LPSTR lpResult, LPSTR key)
169 char *extension = NULL; /* pointer to file extension */
170 char tmpext[5]; /* local copy to mung as we please */
171 char filetype[256]; /* registry name for this filetype */
172 LONG filetypelen = 256; /* length of above */
173 char command[256]; /* command from registry */
174 LONG commandlen = 256; /* This is the most DOS can handle :) */
175 char buffer[256]; /* Used to GetProfileString */
176 HINSTANCE retval = 31; /* default - 'No association was found' */
177 char *tok; /* token pointer */
178 int i; /* random counter */
179 char xlpFile[256] = ""; /* result of SearchPath */
181 TRACE("%s\n", (lpFile != NULL) ? lpFile : "-");
183 lpResult[0] = '\0'; /* Start off with an empty return string */
185 /* trap NULL parameters on entry */
186 if ((lpFile == NULL) || (lpResult == NULL) || (lpOperation == NULL))
188 WARN("(lpFile=%s,lpResult=%s,lpOperation=%s): NULL parameter\n",
189 lpFile, lpOperation, lpResult);
190 return 2; /* File not found. Close enough, I guess. */
193 if (SearchPathA(lpPath, lpFile, ".exe", sizeof(xlpFile), xlpFile, NULL))
195 TRACE("SearchPathA returned non-zero\n");
199 /* First thing we need is the file's extension */
200 extension = strrchr(xlpFile, '.'); /* Assume last "." is the one; */
201 /* File->Run in progman uses */
203 TRACE("xlpFile=%s,extension=%s\n", xlpFile, extension);
205 if ((extension == NULL) || (extension == &xlpFile[strlen(xlpFile)]))
207 WARN("Returning 31 - No association\n");
208 return 31; /* no association */
211 /* Make local copy & lowercase it for reg & 'programs=' lookup */
212 lstrcpynA(tmpext, extension, 5);
214 TRACE("%s file\n", tmpext);
216 /* Three places to check: */
217 /* 1. win.ini, [windows], programs (NB no leading '.') */
218 /* 2. Registry, HKEY_CLASS_ROOT\<filetype>\shell\open\command */
219 /* 3. win.ini, [extensions], extension (NB no leading '.' */
220 /* All I know of the order is that registry is checked before */
221 /* extensions; however, it'd make sense to check the programs */
222 /* section first, so that's what happens here. */
224 if (key) *key = '\0';
226 /* See if it's a program - if GetProfileString fails, we skip this
227 * section. Actually, if GetProfileString fails, we've probably
228 * got a lot more to worry about than running a program... */
229 if (GetProfileStringA("windows", "programs", "exe pif bat com",
230 buffer, sizeof(buffer)) > 0)
232 for (i = 0;i<strlen(buffer); i++) buffer[i] = tolower(buffer[i]);
234 tok = strtok(buffer, " \t"); /* ? */
237 if (strcmp(tok, &tmpext[1]) == 0) /* have to skip the leading "." */
239 strcpy(lpResult, xlpFile);
240 /* Need to perhaps check that the file has a path
242 TRACE("found %s\n", lpResult);
245 /* Greater than 32 to indicate success FIXME According to the
246 * docs, I should be returning a handle for the
247 * executable. Does this mean I'm supposed to open the
248 * executable file or something? More RTFM, I guess... */
250 tok = strtok(NULL, " \t");
255 if (RegQueryValueA(HKEY_CLASSES_ROOT, tmpext, filetype,
256 &filetypelen) == ERROR_SUCCESS)
258 filetype[filetypelen] = '\0';
259 TRACE("File type: %s\n", filetype);
261 /* Looking for ...buffer\shell\lpOperation\command */
262 strcat(filetype, "\\shell\\");
263 strcat(filetype, lpOperation);
264 strcat(filetype, "\\command");
266 if (RegQueryValueA(HKEY_CLASSES_ROOT, filetype, command,
267 &commandlen) == ERROR_SUCCESS)
269 if (key) strcpy(key, filetype);
275 /* FIXME: it seems all Windows version don't behave the same here.
276 * the doc states that this ddeexec information can be found after
278 * on Win98, it doesn't appear, but I think it does on Win2k
280 /* Get the parameters needed by the application
281 from the associated ddeexec key */
282 tmp = strstr(filetype, "command");
284 strcat(filetype, "ddeexec");
286 if (RegQueryValueA(HKEY_CLASSES_ROOT, filetype, param, ¶mlen) == ERROR_SUCCESS)
288 strcat(command, " ");
289 strcat(command, param);
290 commandlen += paramlen;
293 command[commandlen] = '\0';
294 argify(lpResult, sizeof(lpResult), command, xlpFile);
295 retval = 33; /* FIXME see above */
298 else /* Check win.ini */
300 /* Toss the leading dot */
302 if (GetProfileStringA("extensions", extension, "", command,
303 sizeof(command)) > 0)
305 if (strlen(command) != 0)
307 strcpy(lpResult, command);
308 tok = strstr(lpResult, "^"); /* should be ^.extension? */
312 strcat(lpResult, xlpFile); /* what if no dir in xlpFile? */
313 tok = strstr(command, "^"); /* see above */
314 if ((tok != NULL) && (strlen(tok)>5))
316 strcat(lpResult, &tok[5]);
319 retval = 33; /* FIXME - see above */
324 TRACE("returning %s\n", lpResult);
328 /******************************************************************
331 * callback for the DDE connection. not really usefull
333 static HDDEDATA CALLBACK dde_cb(UINT uType, UINT uFmt, HCONV hConv,
335 HDDEDATA hData, DWORD dwData1, DWORD dwData2)
340 /******************************************************************
343 * ShellExecute helper. Used to do an operation with a DDE connection
345 * Handles both the direct connection (try #1), and if it fails,
346 * launching an application and trying (#2) to connect to it
349 static unsigned dde_connect(char* key, char* start, char* ddeexec,
351 LPSHELLEXECUTEINFOA sei, BOOL is32)
353 char* endkey = key + strlen(key);
354 char app[256], topic[256], ifexec[256], res[256];
355 LONG applen, topiclen, ifexeclen;
359 HSZ hszApp, hszTopic;
363 strcpy(endkey, "\\application");
364 applen = sizeof(app);
365 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, app, &applen) != ERROR_SUCCESS)
367 FIXME("default app name NIY %s\n", key);
371 strcpy(endkey, "\\topic");
372 topiclen = sizeof(topic);
373 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, topic, &topiclen) != ERROR_SUCCESS)
375 strcpy(topic, "System");
378 if (DdeInitializeA(&ddeInst, dde_cb, APPCMD_CLIENTONLY, 0L) != DMLERR_NO_ERROR)
383 hszApp = DdeCreateStringHandleA(ddeInst, app, CP_WINANSI);
384 hszTopic = DdeCreateStringHandleA(ddeInst, topic, CP_WINANSI);
386 hConv = DdeConnect(ddeInst, hszApp, hszTopic, NULL);
390 TRACE("Launching '%s'\n", start);
391 ret = SHELL_ExecuteA(start, sei, is32, TRUE);
394 TRACE("Couldn't launch\n");
397 hConv = DdeConnect(ddeInst, hszApp, hszTopic, NULL);
400 TRACE("Couldn't connect. ret=%d\n", ret);
401 ret = 30; /* whatever */
404 strcpy(endkey, "\\ifexec");
405 ifexeclen = sizeof(ifexec);
406 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, ifexec, &ifexeclen) == ERROR_SUCCESS)
412 argify(res, sizeof(res), exec, lpFile);
413 TRACE("%s %s => %s\n", exec, lpFile, res);
415 ret = (DdeClientTransaction(res, strlen(res) + 1, hConv, 0L, 0,
416 XTYP_EXECUTE, 10000, &tid) != DMLERR_NO_ERROR) ? 31 : 33;
417 DdeDisconnect(hConv);
419 DdeUninitialize(ddeInst);
423 /*************************************************************************
424 * execute_from_key [Internal]
426 static HINSTANCE execute_from_key(LPSTR key, LPCSTR lpFile, LPSHELLEXECUTEINFOA sei, BOOL is32)
429 LONG cmdlen = sizeof(cmd);
430 HINSTANCE retval = 31;
432 /* Get the application for the registry */
433 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, cmd, &cmdlen) == ERROR_SUCCESS)
436 char param[256] = "";
439 /* Get the parameters needed by the application
440 from the associated ddeexec key */
441 tmp = strstr(key, "command");
443 strcpy(tmp, "ddeexec");
445 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, param, ¶mlen) == ERROR_SUCCESS)
447 TRACE("Got ddeexec %s => %s\n", key, param);
448 retval = dde_connect(key, cmd, param, lpFile, sei, is32);
452 /* Is there a replace() function anywhere? */
454 argify(param, sizeof(param), cmd, lpFile);
455 retval = SHELL_ExecuteA(param, sei, is32, FALSE);
458 else TRACE("ooch\n");
463 /*************************************************************************
464 * FindExecutableA [SHELL32.@]
466 HINSTANCE WINAPI FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult)
468 HINSTANCE retval = 31; /* default - 'No association was found' */
471 TRACE("File %s, Dir %s\n",
472 (lpFile != NULL ? lpFile : "-"), (lpDirectory != NULL ? lpDirectory : "-"));
474 lpResult[0] = '\0'; /* Start off with an empty return string */
476 /* trap NULL parameters on entry */
477 if ((lpFile == NULL) || (lpResult == NULL))
479 /* FIXME - should throw a warning, perhaps! */
480 return 2; /* File not found. Close enough, I guess. */
485 GetCurrentDirectoryA(sizeof(old_dir), old_dir);
486 SetCurrentDirectoryA(lpDirectory);
489 retval = SHELL_FindExecutable(lpDirectory, lpFile, "open", lpResult, NULL);
491 TRACE("returning %s\n", lpResult);
493 SetCurrentDirectoryA(old_dir);
497 /*************************************************************************
498 * FindExecutableW [SHELL32.@]
500 HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult)
502 FIXME("(%p,%p,%p): stub\n", lpFile, lpDirectory, lpResult);
503 return 31; /* default - 'No association was found' */
506 /*************************************************************************
507 * ShellExecuteExA32 [Internal]
509 BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, BOOL is32)
511 CHAR szApplicationName[MAX_PATH],szCommandline[MAX_PATH],szPidl[20],fileName[MAX_PATH];
514 char lpstrProtocol[256];
515 LPCSTR lpFile,lpOperation;
516 HINSTANCE retval = 31;
520 TRACE("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s\n",
521 sei->fMask, sei->hwnd, debugstr_a(sei->lpVerb),
522 debugstr_a(sei->lpFile), debugstr_a(sei->lpParameters),
523 debugstr_a(sei->lpDirectory), sei->nShow,
524 (sei->fMask & SEE_MASK_CLASSNAME) ? debugstr_a(sei->lpClass) : "not used");
526 sei->hProcess = (HANDLE)NULL;
527 ZeroMemory(szApplicationName,MAX_PATH);
529 strcpy(szApplicationName, sei->lpFile);
531 ZeroMemory(szCommandline,MAX_PATH);
532 if (sei->lpParameters)
533 strcpy(szCommandline, sei->lpParameters);
535 if (sei->fMask & ((SEE_MASK_CLASSKEY & ~SEE_MASK_CLASSNAME) |
536 SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
537 SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT |
538 SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE |
539 SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR ))
541 FIXME("flags ignored: 0x%08lx\n", sei->fMask);
544 /* process the IDList */
545 if ( (sei->fMask & SEE_MASK_INVOKEIDLIST) == SEE_MASK_INVOKEIDLIST) /*0x0c*/
547 SHGetPathFromIDListA (sei->lpIDList,szApplicationName);
548 TRACE("-- idlist=%p (%s)\n", sei->lpIDList, szApplicationName);
552 if (sei->fMask & SEE_MASK_IDLIST )
554 pos = strstr(szCommandline, "%I");
558 HGLOBAL hmem = SHAllocShared ( sei->lpIDList, ILGetSize(sei->lpIDList), 0);
559 pv = SHLockShared(hmem,0);
560 sprintf(szPidl,":%p",pv );
563 gap = strlen(szPidl);
565 memmove(pos+gap,pos+2,len);
566 memcpy(pos,szPidl,gap);
571 if (sei->fMask & SEE_MASK_CLASSNAME)
573 /* launch a document by fileclass like 'WordPad.Document.1' */
574 /* the Commandline contains 'c:\Path\wordpad.exe "%1"' */
575 /* FIXME: szCommandline should not be of a fixed size. Plus MAX_PATH is way too short! */
576 HCR_GetExecuteCommand(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, sizeof(szCommandline));
577 /* FIXME: get the extension of lpFile, check if it fits to the lpClass */
578 TRACE("SEE_MASK_CLASSNAME->'%s', doc->'%s'\n", szCommandline, szApplicationName);
581 done = argify(cmd, sizeof(cmd), szCommandline, szApplicationName);
582 if (!done && szApplicationName[0])
585 strcat(cmd, szApplicationName);
587 retval = SHELL_ExecuteA(cmd, sei, is32, FALSE);
594 /* We set the default to open, and that should generally work.
595 But that is not really the way the MS docs say to do it. */
596 if (sei->lpVerb == NULL)
597 lpOperation = "open";
599 lpOperation = sei->lpVerb;
601 /* Else, try to execute the filename */
602 TRACE("execute:'%s','%s'\n",szApplicationName, szCommandline);
604 strcpy(fileName, szApplicationName);
606 if (szCommandline[0]) {
607 strcat(szApplicationName, " ");
608 strcat(szApplicationName, szCommandline);
611 retval = SHELL_ExecuteA(szApplicationName, sei, is32, FALSE);
615 /* Else, try to find the executable */
617 retval = SHELL_FindExecutable(sei->lpDirectory, lpFile, lpOperation, cmd, lpstrProtocol);
618 if (retval > 32) /* Found */
620 if (szCommandline[0]) {
622 strcat(cmd, szCommandline);
624 TRACE("%s/%s => %s/%s\n", szApplicationName, lpOperation, cmd, lpstrProtocol);
626 retval = execute_from_key(lpstrProtocol, szApplicationName, sei, is32);
628 retval = SHELL_ExecuteA(cmd, sei, is32, FALSE);
630 else if (PathIsURLA((LPSTR)lpFile)) /* File not found, check for URL */
635 lpstrRes = strchr(lpFile, ':');
637 iSize = lpstrRes - lpFile;
639 iSize = strlen(lpFile);
641 TRACE("Got URL: %s\n", lpFile);
642 /* Looking for ...protocol\shell\lpOperation\command */
643 strncpy(lpstrProtocol, lpFile, iSize);
644 lpstrProtocol[iSize] = '\0';
645 strcat(lpstrProtocol, "\\shell\\");
646 strcat(lpstrProtocol, lpOperation);
647 strcat(lpstrProtocol, "\\command");
649 /* Remove File Protocol from lpFile */
650 /* In the case file://path/file */
651 if (!strncasecmp(lpFile, "file", iSize))
654 while (*lpFile == ':') lpFile++;
656 retval = execute_from_key(lpstrProtocol, lpFile, sei, is32);
658 /* Check if file specified is in the form www.??????.*** */
659 else if (!strncasecmp(lpFile, "www", 3))
661 /* if so, append lpFile http:// and call ShellExecute */
662 char lpstrTmpFile[256] = "http://" ;
663 strcat(lpstrTmpFile, lpFile);
664 retval = ShellExecuteA(sei->hwnd, lpOperation, lpstrTmpFile, NULL, NULL, 0);
669 sei->hInstApp = retval;
678 /*************************************************************************
679 * ShellExecute [SHELL.20]
681 HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
682 LPCSTR lpFile, LPCSTR lpParameters,
683 LPCSTR lpDirectory, INT16 iShowCmd )
685 SHELLEXECUTEINFOA sei;
688 sei.cbSize = sizeof(sei);
690 sei.hwnd = HWND_32(hWnd);
691 sei.lpVerb = lpOperation;
693 sei.lpParameters = lpParameters;
694 sei.lpDirectory = lpDirectory;
695 sei.nShow = iShowCmd;
700 sei.hProcess = hProcess;
702 ShellExecuteExA32 (&sei, FALSE);
703 return (HINSTANCE16)sei.hInstApp;
706 /*************************************************************************
707 * ShellExecuteA [SHELL32.290]
709 HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile,
710 LPCSTR lpParameters,LPCSTR lpDirectory, INT iShowCmd)
712 SHELLEXECUTEINFOA sei;
716 sei.cbSize = sizeof(sei);
719 sei.lpVerb = lpOperation;
721 sei.lpParameters = lpParameters;
722 sei.lpDirectory = lpDirectory;
723 sei.nShow = iShowCmd;
728 sei.hProcess = hProcess;
730 ShellExecuteExA32 (&sei, TRUE);
734 /*************************************************************************
735 * ShellExecuteEx [SHELL32.291]
738 BOOL WINAPI ShellExecuteExAW (LPVOID sei)
740 if (SHELL_OsIsUnicode())
741 return ShellExecuteExW (sei);
742 return ShellExecuteExA32 (sei, TRUE);
745 /*************************************************************************
746 * ShellExecuteExA [SHELL32.292]
749 BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
751 return ShellExecuteExA32 (sei, TRUE);
754 /*************************************************************************
755 * ShellExecuteExW [SHELL32.293]
758 BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei)
760 SHELLEXECUTEINFOA seiA;
765 memcpy(&seiA, sei, sizeof(SHELLEXECUTEINFOA));
768 seiA.lpVerb = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpVerb);
771 seiA.lpFile = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpFile);
773 if (sei->lpParameters)
774 seiA.lpParameters = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpParameters);
776 if (sei->lpDirectory)
777 seiA.lpDirectory = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpDirectory);
779 if ((sei->fMask & SEE_MASK_CLASSNAME) && sei->lpClass)
780 seiA.lpClass = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpClass);
784 ret = ShellExecuteExA(&seiA);
786 if (seiA.lpVerb) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpVerb );
787 if (seiA.lpFile) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpFile );
788 if (seiA.lpParameters) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpParameters );
789 if (seiA.lpDirectory) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpDirectory );
790 if (seiA.lpClass) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpClass );
795 /*************************************************************************
796 * ShellExecuteW [SHELL32.294]
798 * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation,
799 * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
801 HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile,
802 LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
804 SHELLEXECUTEINFOW sei;
808 sei.cbSize = sizeof(sei);
811 sei.lpVerb = lpOperation;
813 sei.lpParameters = lpParameters;
814 sei.lpDirectory = lpDirectory;
815 sei.nShow = nShowCmd;
820 sei.hProcess = hProcess;
822 ShellExecuteExW (&sei);