ReactOS  0.4.12-dev-36-g472787f
run.c
Go to the documentation of this file.
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 
27 {
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  hShell32 = LoadLibraryW(L"SHELL32.DLL");
38  RunFileDlg = (RUNFILEDLG)(FARPROC)GetProcAddress(hShell32, (LPCSTR)61);
39 
40  /* Show "Run..." dialog */
41  if (RunFileDlg)
42  {
44 
45  /* NOTE - don't check whether running on win 9x or NT, let's just
46  assume that a unicode build only runs on NT */
47  RunFileDlg(hMainWnd, hIcon, NULL, szTitle, szText, RFF_CALCDIRECTORY);
48 
49  DeleteObject(hIcon);
50  }
51 
52  FreeLibrary(hShell32);
53 }
static HICON
Definition: imagelist.c:84
#define IDS_CREATENEWTASK_DESC
Definition: resource.h:239
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static const WCHAR szText[]
Definition: dialog.c:139
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
void WINAPI RunFileDlg(HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
Definition: dialogs.cpp:397
#define FreeLibrary(x)
Definition: compat.h:405
#define IDS_CREATENEWTASK
Definition: resource.h:238
void(WINAPI * RUNFILEDLG)(HWND hwndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
Definition: run.h:35
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:36
#define IDI_TASKMANAGER
Definition: resource.h:17
HWND hMainWnd
Definition: magnifier.c:33
static const WCHAR L[]
Definition: oid.c:1087
#define RFF_CALCDIRECTORY
Definition: run.h:48
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
void TaskManager_OnFileNew(void)
Definition: run.c:26
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define GetProcAddress(x, y)
Definition: compat.h:410
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static HMODULE hShell32
Definition: string.c:34
int(* FARPROC)()
Definition: compat.h:28