6 * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
43 // Show "Run..." dialog
47 RUNFILEDLG RunFileDlg
;
48 OSVERSIONINFO versionInfo
;
51 CHAR szTitle
[40] = "Create New Task";
52 CHAR szText
[256] = "Type the name of a program, folder, document, or Internet resource, and Task Manager will open it for you.";
54 hShell32
= LoadLibrary(_T("SHELL32.DLL"));
55 RunFileDlg
= (RUNFILEDLG
)(FARPROC
)GetProcAddress(hShell32
, (CHAR
*)((long)0x3D));
57 versionInfo
.dwOSVersionInfoSize
= sizeof(OSVERSIONINFO
);
58 GetVersionEx(&versionInfo
);
59 if (versionInfo
.dwPlatformId
== VER_PLATFORM_WIN32_NT
) {
60 MultiByteToWideChar(CP_ACP
, MB_PRECOMPOSED
, szTitle
, -1, wTitle
, 40);
61 MultiByteToWideChar(CP_ACP
, MB_PRECOMPOSED
, szText
, -1, wText
, 256);
62 RunFileDlg(Globals
.hMainWnd
, 0, NULL
, (LPCSTR
)wTitle
, (LPCSTR
)wText
, RFF_CALCDIRECTORY
);
64 RunFileDlg(Globals
.hMainWnd
, 0, NULL
, szTitle
, szText
, RFF_CALCDIRECTORY
);
67 FreeLibrary(hShell32
);
72 typedef struct _SHELLEXECUTEINFO{
93 } SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;
96 BOOL
OpenTarget(HWND hWnd
, TCHAR
* target
)
99 SHELLEXECUTEINFO shExecInfo
;
101 memset(&shExecInfo
, 0, sizeof(shExecInfo
));
102 shExecInfo
.cbSize
= sizeof(shExecInfo
);
103 shExecInfo
.fMask
= 0;
104 shExecInfo
.hwnd
= hWnd
;
105 shExecInfo
.lpVerb
= NULL
;
106 shExecInfo
.lpFile
= target
;
107 shExecInfo
.lpParameters
= NULL
;
108 shExecInfo
.lpDirectory
= NULL
;
109 shExecInfo
.nShow
= SW_SHOW
;
110 shExecInfo
.hInstApp
= 0;
112 result
= ShellExecuteEx(&shExecInfo
);