[REACTOS]
[reactos.git] / reactos / base / applications / taskmgr / run.c
1 /*
2 * ReactOS Task Manager
3 *
4 * run.c
5 *
6 * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
7 * 2005 Klemens Friedl <frik85@reactos.at>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #include "precomp.h"
25
26 void TaskManager_OnFileNew(void)
27 {
28 HMODULE hShell32;
29 RUNFILEDLG RunFileDlg;
30 WCHAR szTitle[40];
31 WCHAR szText[256];
32
33 /* Load language strings from resource file */
34 LoadStringW(hInst, IDS_CREATENEWTASK, szTitle, sizeof(szTitle) / sizeof(szTitle[0]));
35 LoadStringW(hInst, IDS_CREATENEWTASK_DESC, szText, sizeof(szText) / sizeof(szText[0]));
36
37
38 hShell32 = LoadLibraryW(L"SHELL32.DLL");
39 RunFileDlg = (RUNFILEDLG)(FARPROC)GetProcAddress(hShell32, (LPCSTR)0x3D);
40
41 /* Show "Run..." dialog */
42 if (RunFileDlg)
43 {
44 /* NOTE - don't check whether running on win 9x or NT, let's just
45 assume that a unicode build only runs on NT */
46 RunFileDlg(hMainWnd, 0, NULL, NULL, szText, RFF_CALCDIRECTORY);
47 }
48
49 FreeLibrary(hShell32);
50 }