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
42 #include "wine/winbase16.h"
43 #include "shell32_main.h"
44 #include "undocshell.h"
46 #include "wine/debug.h"
48 WINE_DEFAULT_DEBUG_CHANNEL(exec);
50 /***********************************************************************
51 * this function is supposed to expand the escape sequences found in the registry
52 * some diving reported that the following were used:
53 * + %1, %2... seem to report to parameter of index N in ShellExecute pmts
58 * %I adress of a global item ID (explorer switch /idlist)
59 * %L seems to be %1 as long filename followed by the 8+3 variation
61 * %* all following parameters (see batfile)
63 static BOOL argify(char* res, int len, const char* fmt, const char* lpFile)
80 if (!done || (*fmt == '1'))
82 if (SearchPathA(NULL, lpFile, ".exe", sizeof(xlpFile), xlpFile, NULL))
85 res += strlen(xlpFile);
90 res += strlen(lpFile);
94 default: FIXME("Unknown escape sequence %%%c\n", *fmt);
106 /*************************************************************************
107 * SHELL_ExecuteA [Internal]
110 static HINSTANCE SHELL_ExecuteA(char *lpCmd, LPSHELLEXECUTEINFOA sei, BOOL is32, BOOL shWait)
112 STARTUPINFOA startup;
113 PROCESS_INFORMATION info;
114 HINSTANCE retval = 31;
116 TRACE("Execute %s from directory %s\n", lpCmd, sei->lpDirectory);
117 ZeroMemory(&startup,sizeof(STARTUPINFOA));
118 startup.cb = sizeof(STARTUPINFOA);
119 startup.dwFlags = STARTF_USESHOWWINDOW;
120 startup.wShowWindow = sei->nShow;
123 if (CreateProcessA(NULL, lpCmd, NULL, NULL, FALSE, 0,
124 NULL, sei->lpDirectory, &startup, &info))
126 /* Give 30 seconds to the app to come up, if desired. Probably only needed
127 when starting app immediately before making a DDE connection. */
129 if (WaitForInputIdle( info.hProcess, 30000 ) == -1)
130 WARN("WaitForInputIdle failed: Error %ld\n", GetLastError() );
131 retval = (HINSTANCE)33;
132 if(sei->fMask & SEE_MASK_NOCLOSEPROCESS)
133 sei->hProcess = info.hProcess;
135 CloseHandle( info.hProcess );
136 CloseHandle( info.hThread );
138 else if ((retval = GetLastError()) >= (HINSTANCE)32)
140 FIXME("Strange error set by CreateProcess: %d\n", retval);
141 retval = (HINSTANCE)ERROR_BAD_FORMAT;
145 retval = WinExec16(lpCmd, sei->nShow);
147 sei->hInstApp = retval;
151 /*************************************************************************
152 * SHELL_FindExecutable [Internal]
154 * Utility for code sharing between FindExecutable and ShellExecute
156 * lpFile the name of a file
157 * lpOperation the operation on it (open)
159 * lpResult a buffer, big enough :-(, to store the command to do the
160 * operation on the file
161 * key a buffer, big enough, to get the key name to do actually the
162 * command (it'll be used afterwards for more information
165 static HINSTANCE SHELL_FindExecutable(LPCSTR lpPath, LPCSTR lpFile, LPCSTR lpOperation,
166 LPSTR lpResult, LPSTR key)
168 char *extension = NULL; /* pointer to file extension */
169 char tmpext[5]; /* local copy to mung as we please */
170 char filetype[256]; /* registry name for this filetype */
171 LONG filetypelen = 256; /* length of above */
172 char command[256]; /* command from registry */
173 LONG commandlen = 256; /* This is the most DOS can handle :) */
174 char buffer[256]; /* Used to GetProfileString */
175 HINSTANCE retval = 31; /* default - 'No association was found' */
176 char *tok; /* token pointer */
177 int i; /* random counter */
178 char xlpFile[256] = ""; /* result of SearchPath */
180 TRACE("%s\n", (lpFile != NULL) ? lpFile : "-");
182 lpResult[0] = '\0'; /* Start off with an empty return string */
184 /* trap NULL parameters on entry */
185 if ((lpFile == NULL) || (lpResult == NULL) || (lpOperation == NULL))
187 WARN("(lpFile=%s,lpResult=%s,lpOperation=%s): NULL parameter\n",
188 lpFile, lpOperation, lpResult);
189 return 2; /* File not found. Close enough, I guess. */
192 if (SearchPathA(lpPath, lpFile, ".exe", sizeof(xlpFile), xlpFile, NULL))
194 TRACE("SearchPathA returned non-zero\n");
198 /* First thing we need is the file's extension */
199 extension = strrchr(xlpFile, '.'); /* Assume last "." is the one; */
200 /* File->Run in progman uses */
202 TRACE("xlpFile=%s,extension=%s\n", xlpFile, extension);
204 if ((extension == NULL) || (extension == &xlpFile[strlen(xlpFile)]))
206 WARN("Returning 31 - No association\n");
207 return 31; /* no association */
210 /* Make local copy & lowercase it for reg & 'programs=' lookup */
211 lstrcpynA(tmpext, extension, 5);
213 TRACE("%s file\n", tmpext);
215 /* Three places to check: */
216 /* 1. win.ini, [windows], programs (NB no leading '.') */
217 /* 2. Registry, HKEY_CLASS_ROOT\<filetype>\shell\open\command */
218 /* 3. win.ini, [extensions], extension (NB no leading '.' */
219 /* All I know of the order is that registry is checked before */
220 /* extensions; however, it'd make sense to check the programs */
221 /* section first, so that's what happens here. */
223 if (key) *key = '\0';
225 /* See if it's a program - if GetProfileString fails, we skip this
226 * section. Actually, if GetProfileString fails, we've probably
227 * got a lot more to worry about than running a program... */
228 if (GetProfileStringA("windows", "programs", "exe pif bat com",
229 buffer, sizeof(buffer)) > 0)
231 for (i = 0;i<strlen(buffer); i++) buffer[i] = tolower(buffer[i]);
233 tok = strtok(buffer, " \t"); /* ? */
236 if (strcmp(tok, &tmpext[1]) == 0) /* have to skip the leading "." */
238 strcpy(lpResult, xlpFile);
239 /* Need to perhaps check that the file has a path
241 TRACE("found %s\n", lpResult);
244 /* Greater than 32 to indicate success FIXME According to the
245 * docs, I should be returning a handle for the
246 * executable. Does this mean I'm supposed to open the
247 * executable file or something? More RTFM, I guess... */
249 tok = strtok(NULL, " \t");
254 if (RegQueryValueA(HKEY_CLASSES_ROOT, tmpext, filetype,
255 &filetypelen) == ERROR_SUCCESS)
257 filetype[filetypelen] = '\0';
258 TRACE("File type: %s\n", filetype);
260 /* Looking for ...buffer\shell\lpOperation\command */
261 strcat(filetype, "\\shell\\");
262 strcat(filetype, lpOperation);
263 strcat(filetype, "\\command");
265 if (RegQueryValueA(HKEY_CLASSES_ROOT, filetype, command,
266 &commandlen) == ERROR_SUCCESS)
268 if (key) strcpy(key, filetype);
274 /* FIXME: it seems all Windows version don't behave the same here.
275 * the doc states that this ddeexec information can be found after
277 * on Win98, it doesn't appear, but I think it does on Win2k
279 /* Get the parameters needed by the application
280 from the associated ddeexec key */
281 tmp = strstr(filetype, "command");
283 strcat(filetype, "ddeexec");
285 if (RegQueryValueA(HKEY_CLASSES_ROOT, filetype, param, ¶mlen) == ERROR_SUCCESS)
287 strcat(command, " ");
288 strcat(command, param);
289 commandlen += paramlen;
292 command[commandlen] = '\0';
293 argify(lpResult, sizeof(lpResult), command, xlpFile);
294 retval = 33; /* FIXME see above */
297 else /* Check win.ini */
299 /* Toss the leading dot */
301 if (GetProfileStringA("extensions", extension, "", command,
302 sizeof(command)) > 0)
304 if (strlen(command) != 0)
306 strcpy(lpResult, command);
307 tok = strstr(lpResult, "^"); /* should be ^.extension? */
311 strcat(lpResult, xlpFile); /* what if no dir in xlpFile? */
312 tok = strstr(command, "^"); /* see above */
313 if ((tok != NULL) && (strlen(tok)>5))
315 strcat(lpResult, &tok[5]);
318 retval = 33; /* FIXME - see above */
323 TRACE("returning %s\n", lpResult);
327 /******************************************************************
330 * callback for the DDE connection. not really usefull
332 static HDDEDATA CALLBACK dde_cb(UINT uType, UINT uFmt, HCONV hConv,
334 HDDEDATA hData, DWORD dwData1, DWORD dwData2)
339 /******************************************************************
342 * ShellExecute helper. Used to do an operation with a DDE connection
344 * Handles both the direct connection (try #1), and if it fails,
345 * launching an application and trying (#2) to connect to it
348 static unsigned dde_connect(char* key, char* start, char* ddeexec,
350 LPSHELLEXECUTEINFOA sei, BOOL is32)
352 char* endkey = key + strlen(key);
353 char app[256], topic[256], ifexec[256], res[256];
354 LONG applen, topiclen, ifexeclen;
358 HSZ hszApp, hszTopic;
362 strcpy(endkey, "\\application");
363 applen = sizeof(app);
364 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, app, &applen) != ERROR_SUCCESS)
366 FIXME("default app name NIY %s\n", key);
370 strcpy(endkey, "\\topic");
371 topiclen = sizeof(topic);
372 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, topic, &topiclen) != ERROR_SUCCESS)
374 strcpy(topic, "System");
377 if (DdeInitializeA(&ddeInst, dde_cb, APPCMD_CLIENTONLY, 0L) != DMLERR_NO_ERROR)
382 hszApp = DdeCreateStringHandleA(ddeInst, app, CP_WINANSI);
383 hszTopic = DdeCreateStringHandleA(ddeInst, topic, CP_WINANSI);
385 hConv = DdeConnect(ddeInst, hszApp, hszTopic, NULL);
389 TRACE("Launching '%s'\n", start);
390 ret = SHELL_ExecuteA(start, sei, is32, TRUE);
393 TRACE("Couldn't launch\n");
396 hConv = DdeConnect(ddeInst, hszApp, hszTopic, NULL);
399 TRACE("Couldn't connect. ret=%d\n", ret);
400 ret = 30; /* whatever */
403 strcpy(endkey, "\\ifexec");
404 ifexeclen = sizeof(ifexec);
405 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, ifexec, &ifexeclen) == ERROR_SUCCESS)
411 argify(res, sizeof(res), exec, lpFile);
412 TRACE("%s %s => %s\n", exec, lpFile, res);
414 ret = (DdeClientTransaction(res, strlen(res) + 1, hConv, 0L, 0,
415 XTYP_EXECUTE, 10000, &tid) != DMLERR_NO_ERROR) ? 31 : 33;
416 DdeDisconnect(hConv);
418 DdeUninitialize(ddeInst);
422 /*************************************************************************
423 * execute_from_key [Internal]
425 static HINSTANCE execute_from_key(LPSTR key, LPCSTR lpFile, LPSHELLEXECUTEINFOA sei, BOOL is32)
428 LONG cmdlen = sizeof(cmd);
429 HINSTANCE retval = 31;
431 /* Get the application for the registry */
432 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, cmd, &cmdlen) == ERROR_SUCCESS)
435 char param[256] = "";
438 /* Get the parameters needed by the application
439 from the associated ddeexec key */
440 tmp = strstr(key, "command");
442 strcpy(tmp, "ddeexec");
444 if (RegQueryValueA(HKEY_CLASSES_ROOT, key, param, ¶mlen) == ERROR_SUCCESS)
446 TRACE("Got ddeexec %s => %s\n", key, param);
447 retval = dde_connect(key, cmd, param, lpFile, sei, is32);
451 /* Is there a replace() function anywhere? */
453 argify(param, sizeof(param), cmd, lpFile);
454 retval = SHELL_ExecuteA(param, sei, is32, FALSE);
457 else TRACE("ooch\n");
462 /*************************************************************************
463 * FindExecutableA [SHELL32.@]
465 HINSTANCE WINAPI FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult)
467 HINSTANCE retval = 31; /* default - 'No association was found' */
470 TRACE("File %s, Dir %s\n",
471 (lpFile != NULL ? lpFile : "-"), (lpDirectory != NULL ? lpDirectory : "-"));
473 lpResult[0] = '\0'; /* Start off with an empty return string */
475 /* trap NULL parameters on entry */
476 if ((lpFile == NULL) || (lpResult == NULL))
478 /* FIXME - should throw a warning, perhaps! */
479 return 2; /* File not found. Close enough, I guess. */
484 GetCurrentDirectoryA(sizeof(old_dir), old_dir);
485 SetCurrentDirectoryA(lpDirectory);
488 retval = SHELL_FindExecutable(lpDirectory, lpFile, "open", lpResult, NULL);
490 TRACE("returning %s\n", lpResult);
492 SetCurrentDirectoryA(old_dir);
496 /*************************************************************************
497 * FindExecutableW [SHELL32.@]
499 HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult)
501 FIXME("(%p,%p,%p): stub\n", lpFile, lpDirectory, lpResult);
502 return 31; /* default - 'No association was found' */
505 /*************************************************************************
506 * ShellExecuteExA32 [Internal]
508 BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, BOOL is32)
510 CHAR szApplicationName[MAX_PATH],szCommandline[MAX_PATH],szPidl[20],fileName[MAX_PATH];
513 char lpstrProtocol[256];
514 LPCSTR lpFile,lpOperation;
515 HINSTANCE retval = 31;
519 TRACE("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s\n",
520 sei->fMask, sei->hwnd, debugstr_a(sei->lpVerb),
521 debugstr_a(sei->lpFile), debugstr_a(sei->lpParameters),
522 debugstr_a(sei->lpDirectory), sei->nShow,
523 (sei->fMask & SEE_MASK_CLASSNAME) ? debugstr_a(sei->lpClass) : "not used");
525 sei->hProcess = (HANDLE)NULL;
526 ZeroMemory(szApplicationName,MAX_PATH);
528 strcpy(szApplicationName, sei->lpFile);
530 ZeroMemory(szCommandline,MAX_PATH);
531 if (sei->lpParameters)
532 strcpy(szCommandline, sei->lpParameters);
534 if (sei->fMask & ((SEE_MASK_CLASSKEY & ~SEE_MASK_CLASSNAME) |
535 SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
536 SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT |
537 SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE |
538 SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR ))
540 FIXME("flags ignored: 0x%08lx\n", sei->fMask);
543 /* process the IDList */
544 if ( (sei->fMask & SEE_MASK_INVOKEIDLIST) == SEE_MASK_INVOKEIDLIST) /*0x0c*/
546 SHGetPathFromIDListA (sei->lpIDList,szApplicationName);
547 TRACE("-- idlist=%p (%s)\n", sei->lpIDList, szApplicationName);
551 if (sei->fMask & SEE_MASK_IDLIST )
553 pos = strstr(szCommandline, "%I");
557 HGLOBAL hmem = SHAllocShared ( sei->lpIDList, ILGetSize(sei->lpIDList), 0);
558 pv = SHLockShared(hmem,0);
559 sprintf(szPidl,":%p",pv );
562 gap = strlen(szPidl);
564 memmove(pos+gap,pos+2,len);
565 memcpy(pos,szPidl,gap);
570 if (sei->fMask & SEE_MASK_CLASSNAME)
572 /* launch a document by fileclass like 'WordPad.Document.1' */
573 /* the Commandline contains 'c:\Path\wordpad.exe "%1"' */
574 /* FIXME: szCommandline should not be of a fixed size. Plus MAX_PATH is way too short! */
575 HCR_GetExecuteCommand(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, sizeof(szCommandline));
576 /* FIXME: get the extension of lpFile, check if it fits to the lpClass */
577 TRACE("SEE_MASK_CLASSNAME->'%s', doc->'%s'\n", szCommandline, szApplicationName);
580 done = argify(cmd, sizeof(cmd), szCommandline, szApplicationName);
581 if (!done && szApplicationName[0])
584 strcat(cmd, szApplicationName);
586 retval = SHELL_ExecuteA(cmd, sei, is32, FALSE);
593 /* We set the default to open, and that should generally work.
594 But that is not really the way the MS docs say to do it. */
595 if (sei->lpVerb == NULL)
596 lpOperation = "open";
598 lpOperation = sei->lpVerb;
600 /* Else, try to execute the filename */
601 TRACE("execute:'%s','%s'\n",szApplicationName, szCommandline);
603 strcpy(fileName, szApplicationName);
605 if (szCommandline[0]) {
606 strcat(szApplicationName, " ");
607 strcat(szApplicationName, szCommandline);
610 retval = SHELL_ExecuteA(szApplicationName, sei, is32, FALSE);
614 /* Else, try to find the executable */
616 retval = SHELL_FindExecutable(sei->lpDirectory, lpFile, lpOperation, cmd, lpstrProtocol);
617 if (retval > 32) /* Found */
619 if (szCommandline[0]) {
621 strcat(cmd, szCommandline);
623 TRACE("%s/%s => %s/%s\n", szApplicationName, lpOperation, cmd, lpstrProtocol);
625 retval = execute_from_key(lpstrProtocol, szApplicationName, sei, is32);
627 retval = SHELL_ExecuteA(cmd, sei, is32, FALSE);
629 else if (PathIsURLA((LPSTR)lpFile)) /* File not found, check for URL */
634 lpstrRes = strchr(lpFile, ':');
636 iSize = lpstrRes - lpFile;
638 iSize = strlen(lpFile);
640 TRACE("Got URL: %s\n", lpFile);
641 /* Looking for ...protocol\shell\lpOperation\command */
642 strncpy(lpstrProtocol, lpFile, iSize);
643 lpstrProtocol[iSize] = '\0';
644 strcat(lpstrProtocol, "\\shell\\");
645 strcat(lpstrProtocol, lpOperation);
646 strcat(lpstrProtocol, "\\command");
648 /* Remove File Protocol from lpFile */
649 /* In the case file://path/file */
650 if (!strncasecmp(lpFile, "file", iSize))
653 while (*lpFile == ':') lpFile++;
655 retval = execute_from_key(lpstrProtocol, lpFile, sei, is32);
657 /* Check if file specified is in the form www.??????.*** */
658 else if (!strncasecmp(lpFile, "www", 3))
660 /* if so, append lpFile http:// and call ShellExecute */
661 char lpstrTmpFile[256] = "http://" ;
662 strcat(lpstrTmpFile, lpFile);
663 retval = ShellExecuteA(sei->hwnd, lpOperation, lpstrTmpFile, NULL, NULL, 0);
668 sei->hInstApp = retval;
677 /*************************************************************************
678 * ShellExecute [SHELL.20]
680 HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
681 LPCSTR lpFile, LPCSTR lpParameters,
682 LPCSTR lpDirectory, INT16 iShowCmd )
684 SHELLEXECUTEINFOA sei;
687 sei.cbSize = sizeof(sei);
689 sei.hwnd = HWND_32(hWnd);
690 sei.lpVerb = lpOperation;
692 sei.lpParameters = lpParameters;
693 sei.lpDirectory = lpDirectory;
694 sei.nShow = iShowCmd;
699 sei.hProcess = hProcess;
701 ShellExecuteExA32 (&sei, FALSE);
702 return (HINSTANCE16)sei.hInstApp;
705 /*************************************************************************
706 * ShellExecuteA [SHELL32.290]
708 HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile,
709 LPCSTR lpParameters,LPCSTR lpDirectory, INT iShowCmd)
711 SHELLEXECUTEINFOA sei;
715 sei.cbSize = sizeof(sei);
718 sei.lpVerb = lpOperation;
720 sei.lpParameters = lpParameters;
721 sei.lpDirectory = lpDirectory;
722 sei.nShow = iShowCmd;
727 sei.hProcess = hProcess;
729 ShellExecuteExA32 (&sei, TRUE);
733 /*************************************************************************
734 * ShellExecuteEx [SHELL32.291]
737 BOOL WINAPI ShellExecuteExAW (LPVOID sei)
739 if (SHELL_OsIsUnicode())
740 return ShellExecuteExW (sei);
741 return ShellExecuteExA32 (sei, TRUE);
744 /*************************************************************************
745 * ShellExecuteExA [SHELL32.292]
748 BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
750 return ShellExecuteExA32 (sei, TRUE);
753 /*************************************************************************
754 * ShellExecuteExW [SHELL32.293]
757 BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei)
759 SHELLEXECUTEINFOA seiA;
764 memcpy(&seiA, sei, sizeof(SHELLEXECUTEINFOA));
767 seiA.lpVerb = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpVerb);
770 seiA.lpFile = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpFile);
772 if (sei->lpParameters)
773 seiA.lpParameters = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpParameters);
775 if (sei->lpDirectory)
776 seiA.lpDirectory = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpDirectory);
778 if ((sei->fMask & SEE_MASK_CLASSNAME) && sei->lpClass)
779 seiA.lpClass = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpClass);
783 ret = ShellExecuteExA(&seiA);
785 if (seiA.lpVerb) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpVerb );
786 if (seiA.lpFile) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpFile );
787 if (seiA.lpParameters) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpParameters );
788 if (seiA.lpDirectory) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpDirectory );
789 if (seiA.lpClass) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpClass );
794 /*************************************************************************
795 * ShellExecuteW [SHELL32.294]
797 * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation,
798 * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
800 HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile,
801 LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
803 SHELLEXECUTEINFOW sei;
807 sei.cbSize = sizeof(sei);
810 sei.lpVerb = lpOperation;
812 sei.lpParameters = lpParameters;
813 sei.lpDirectory = lpDirectory;
814 sei.nShow = nShowCmd;
819 sei.hProcess = hProcess;
821 ShellExecuteExW (&sei);