ReactOS 0.4.16-dev-1946-g52006dd
run.c File Reference
#include "precomp.h"
Include dependency graph for run.c:

Go to the source code of this file.

Functions

void TaskManager_OnFileNew (void)
 

Function Documentation

◆ TaskManager_OnFileNew()

void TaskManager_OnFileNew ( void  )

Definition at line 11 of file run.c.

12{
15 WCHAR szTitle[40];
16 WCHAR szText[256];
17
18 /* If CTRL is held, start the user's command-line shell */
19 if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
20 {
21 STARTUPINFOW si = { sizeof(si) };
23 WCHAR szComSpec[MAX_PATH];
24 WCHAR fallbackCmd[] = L"cmd.exe";
25 DWORD cchEnv = GetEnvironmentVariableW(L"ComSpec", szComSpec, _countof(szComSpec));
26 if (cchEnv == 0 || cchEnv > _countof(szComSpec))
27 {
28 /* Couldn't get the environment variable, default to cmd.exe */
29 wcscpy(szComSpec, fallbackCmd);
30 }
32 szComSpec,
33 NULL,
34 NULL,
35 FALSE,
37 NULL,
38 NULL,
39 &si, &pi);
40 if (!result)
41 {
42 /* Couldn't start the user's command-line shell, fall back to cmd.exe */
44 fallbackCmd,
45 NULL,
46 NULL,
47 FALSE,
49 NULL,
50 NULL,
51 &si, &pi);
52 }
53 if (result)
54 {
55 CloseHandle(pi.hThread);
56 CloseHandle(pi.hProcess);
57 }
58 return;
59 }
60
61 /* Load language strings from resource file */
64
65 hShell32 = LoadLibraryW(L"SHELL32.DLL");
67
68 /* Show "Run..." dialog */
69 if (RunFileDlg)
70 {
72
73 /* NOTE - don't check whether running on win 9x or NT, let's just
74 assume that a unicode build only runs on NT */
76
78 }
79
81}
#define IDI_TASKMANAGER
Definition: resource.h:24
#define IDS_CREATENEWTASK_DESC
Definition: resource.h:245
#define IDS_CREATENEWTASK
Definition: resource.h:244
wcscpy
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
int(* FARPROC)()
Definition: compat.h:36
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define LoadLibraryW(x)
Definition: compat.h:747
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4600
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
void WINAPI RunFileDlg(HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
Definition: dialogs.cpp:400
#define L(x)
Definition: resources.c:13
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLuint64EXT * result
Definition: glext.h:11304
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
HWND hMainWnd
Definition: magnifier.c:32
static HICON
Definition: imagelist.c:80
static refpint_t pi[]
Definition: server.c:112
static HMODULE hShell32
Definition: string.c:34
HICON hIcon
Definition: msconfig.c:44
void(WINAPI * RUNFILEDLG)(HWND hwndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
Definition: run.h:22
#define RFF_CALCDIRECTORY
Definition: run.h:35
#define _countof(array)
Definition: sndvol32.h:70
#define CREATE_NEW_CONSOLE
Definition: winbase.h:184
#define VK_CONTROL
Definition: winuser.h:2239
SHORT WINAPI GetAsyncKeyState(_In_ int)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2427
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by TaskManagerWndProc().