ReactOS 0.4.15-dev-7953-g1f49173
console.c File Reference
#include "precomp.h"
#include <shellapi.h>
#include <stdlib.h>
#include <strsafe.h>
#include "resource.h"
#include <debug.h>
Include dependency graph for console.c:

Go to the source code of this file.

Classes

struct  _CONSOLE_MAINFRAME_WND
 
struct  _CONSOLE_CHILDFRM_WND
 

Macros

#define NDEBUG
 

Typedefs

typedef struct _CONSOLE_MAINFRAME_WND CONSOLE_MAINFRAME_WND
 
typedef struct _CONSOLE_MAINFRAME_WNDPCONSOLE_MAINFRAME_WND
 
typedef struct _CONSOLE_CHILDFRM_WND CONSOLE_CHILDFRM_WND
 
typedef struct _CONSOLE_CHILDFRM_WNDPCONSOLE_CHILDFRM_WND
 

Functions

PCONSOLE_CHILDFRM_WND GetActiveChildInfo (VOID)
 
static LPTSTR CreateNewConsoleTitle (VOID)
 
HWND CreateNewMDIChild (PCONSOLE_MAINFRAME_WND Info, HWND hwndMDIClient)
 
static LRESULT FrameOnCreate (HWND hwnd, LPARAM lParam)
 
static VOID SetFileName (PCONSOLE_CHILDFRM_WND Info, PWSTR pFileName)
 
static BOOL DoSaveFileAs (HWND hWnd, PCONSOLE_CHILDFRM_WND pChildInfo)
 
static BOOL DoSaveFile (HWND hWnd, PCONSOLE_CHILDFRM_WND pChildInfo)
 
static BOOL FrameOnSave (HWND hWnd)
 
static BOOL FrameOnSaveAs (HWND hWnd)
 
static VOID FrameOnCommand (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID FrameOnSize (HWND hMainWnd, WORD cx, WORD cy)
 
static LRESULT CALLBACK ConsoleMainFrameWndProc (IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static LRESULT CALLBACK ConsoleChildFrmProc (IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
BOOL RegisterMMCWndClasses (VOID)
 
VOID UnregisterMMCWndClasses (VOID)
 
HWND CreateConsoleWindow (IN LPCTSTR lpFileName OPTIONAL, int nCmdShow)
 

Variables

static const TCHAR szMMCMainFrame [] = TEXT("MMCMainFrame")
 
static const TCHAR szMMCChildFrm [] = TEXT("MMCChildFrm")
 
static ULONG NewConsoleCount = 0
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 27 of file console.c.

Typedef Documentation

◆ CONSOLE_CHILDFRM_WND

◆ CONSOLE_MAINFRAME_WND

◆ PCONSOLE_CHILDFRM_WND

◆ PCONSOLE_MAINFRAME_WND

Function Documentation

◆ ConsoleChildFrmProc()

static LRESULT CALLBACK ConsoleChildFrmProc ( IN HWND  hwnd,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 479 of file console.c.

483{
485
487 0);
488
489 switch (uMsg)
490 {
491 case WM_CREATE:
494 sizeof(CONSOLE_CHILDFRM_WND));
495 if (Info != NULL)
496 {
497 Info->hwnd = hwnd;
498
500 0,
501 (LONG_PTR)Info);
502 }
503 break;
504
505 case WM_DESTROY:
506 if (Info != NULL)
507 {
508 if (Info->pFileName)
509 HeapFree(hAppHeap, 0, Info->pFileName);
510
512 }
513
515 break;
516
517 default:
518 return DefMDIChildProc(hwnd, uMsg, wParam, lParam);
519 }
520
521 return 0;
522}
struct _CONSOLE_CHILDFRM_WND * PCONSOLE_CHILDFRM_WND
HANDLE hAppHeap
Definition: mmc.c:24
HWND hwndMainConsole
Definition: mmc.c:25
#define WM_USER_CLOSE_CHILD
Definition: precomp.h:14
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define DefMDIChildProc
Definition: ros2win.h:33
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WM_CREATE
Definition: winuser.h:1608
#define PostMessage
Definition: winuser.h:5832
#define WM_DESTROY
Definition: winuser.h:1609

Referenced by RegisterMMCWndClasses().

◆ ConsoleMainFrameWndProc()

static LRESULT CALLBACK ConsoleMainFrameWndProc ( IN HWND  hwnd,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 398 of file console.c.

402{
404
406 0);
407
408 switch (uMsg)
409 {
410 case WM_CREATE:
411 return FrameOnCreate(hwnd,
412 lParam);
413
414 case WM_COMMAND:
416 uMsg,
417 wParam,
418 lParam);
419 break;
420
421 case WM_SIZE:
423 LOWORD(lParam),
424 HIWORD(lParam));
425 break;
426
427 case WM_CLOSE:
429 break;
430
431 case WM_DESTROY:
432 if (Info != NULL)
433 {
434 SetMenu(Info->hwnd,
435 NULL);
436
437 if (Info->hMenuConsoleSmall != NULL)
438 {
439 DestroyMenu(Info->hMenuConsoleSmall);
440 Info->hMenuConsoleSmall = NULL;
441 }
442
443 if (Info->hMenuConsoleLarge != NULL)
444 {
445 DestroyMenu(Info->hMenuConsoleLarge);
446 Info->hMenuConsoleLarge = NULL;
447 }
448
450 0,
451 Info);
452 }
453
455 break;
456
458 Info->nConsoleCount--;
459 if (Info->nConsoleCount == 0)
460 {
461 SetMenu(Info->hwnd,
462 Info->hMenuConsoleSmall);
463 }
464 break;
465
466 default:
467 return DefFrameProc(hwnd,
469 uMsg,
470 wParam,
471 lParam);
472 }
473
474 return 0;
475}
static VOID FrameOnCommand(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: console.c:308
struct _CONSOLE_MAINFRAME_WND * PCONSOLE_MAINFRAME_WND
static VOID FrameOnSize(HWND hMainWnd, WORD cx, WORD cy)
Definition: console.c:367
static LRESULT FrameOnCreate(HWND hwnd, LPARAM lParam)
Definition: console.c:114
HWND hwndMDIClient
Definition: mmc.c:26
#define LOWORD(l)
Definition: pedump.c:82
#define DefFrameProc
Definition: ros2win.h:32
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_CLOSE
Definition: winuser.h:1621
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1740
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by RegisterMMCWndClasses().

◆ CreateConsoleWindow()

HWND CreateConsoleWindow ( IN LPCTSTR lpFileName  OPTIONAL,
int  nCmdShow 
)

Definition at line 585 of file console.c.

587{
588 HWND hWndConsole;
590
591 hWndConsole = CreateWindowEx(WS_EX_WINDOWEDGE,
593 NULL,
599 NULL,
600 NULL,
602 (PVOID)FileName);
603
604 if (hWndConsole != NULL)
605 {
606 ShowWindow(hWndConsole, nCmdShow);
607 }
608
609 return hWndConsole;
610}
static const TCHAR szMMCMainFrame[]
Definition: console.c:55
HINSTANCE hAppInstance
Definition: mmc.c:23
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define LONG_PTR
Definition: treelist.c:79
_In_ LPCSTR lpFileName
Definition: winbase.h:3071
#define CreateWindowEx
Definition: winuser.h:5755
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define CW_USEDEFAULT
Definition: winuser.h:225

Referenced by _tWinMain().

◆ CreateNewConsoleTitle()

static LPTSTR CreateNewConsoleTitle ( VOID  )
static

Definition at line 74 of file console.c.

75{
77
80 &lpTitle,
81 ++NewConsoleCount) == 0)
82 {
83 lpTitle = NULL;
84 }
85
86 return lpTitle;
87}
static ULONG NewConsoleCount
Definition: console.c:58
DWORD LoadAndFormatString(IN HINSTANCE hInstance, IN UINT uID, OUT LPTSTR *lpTarget,...)
Definition: misc.c:85
#define IDS_CONSOLETITLE
Definition: resource.h:4
TCHAR lpTitle[80]
Definition: ctm.c:69
CHAR * LPTSTR
Definition: xmlstorage.h:192

Referenced by CreateNewMDIChild().

◆ CreateNewMDIChild()

HWND CreateNewMDIChild ( PCONSOLE_MAINFRAME_WND  Info,
HWND  hwndMDIClient 
)

Definition at line 90 of file console.c.

92{
95
96 mcs.szTitle = CreateNewConsoleTitle();
97 mcs.szClass = szMMCChildFrm;
98 mcs.hOwner = GetModuleHandle(NULL);
99 mcs.x = mcs.cx = CW_USEDEFAULT;
100 mcs.y = mcs.cy = CW_USEDEFAULT;
101 mcs.style = MDIS_ALLCHILDSTYLES;
102
104 if (hChild)
105 {
106 Info->nConsoleCount++;
107 }
108
109 return hChild;
110}
static struct myctx * mcs
Definition: adnstest.c:53
static const TCHAR szMMCChildFrm[]
Definition: console.c:56
static LPTSTR CreateNewConsoleTitle(VOID)
Definition: console.c:74
HANDLE HWND
Definition: compat.h:19
static HTREEITEM hChild
Definition: treeview.c:381
#define GetModuleHandle
Definition: winbase.h:3827
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_MDICREATE
Definition: winuser.h:1812
#define MDIS_ALLCHILDSTYLES
Definition: winuser.h:253
#define SendMessage
Definition: winuser.h:5843

Referenced by FrameOnCommand().

◆ DoSaveFile()

static BOOL DoSaveFile ( HWND  hWnd,
PCONSOLE_CHILDFRM_WND  pChildInfo 
)
static

Definition at line 208 of file console.c.

211{
212 DPRINT1("pChildInfo %p\n", pChildInfo);
213
214 DPRINT1("FileName %S\n", pChildInfo->pFileName);
215
216 if (pChildInfo->pFileName == NULL)
217 return DoSaveFileAs(hWnd, pChildInfo);
218
219 /* FIXME: Save the console here! */
220
221 return TRUE;
222}
HWND hWnd
Definition: settings.c:17
static BOOL DoSaveFileAs(HWND hWnd, PCONSOLE_CHILDFRM_WND pChildInfo)
Definition: console.c:225
#define DPRINT1
Definition: precomp.h:8
#define TRUE
Definition: types.h:120

Referenced by DoFileSave(), DoSaveFileAs(), and FrameOnSave().

◆ DoSaveFileAs()

static BOOL DoSaveFileAs ( HWND  hWnd,
PCONSOLE_CHILDFRM_WND  pChildInfo 
)
static

Definition at line 225 of file console.c.

228{
229 OPENFILENAME saveas;
231
232 DPRINT1("pChildInfo %p\n", pChildInfo);
233 DPRINT1("FileName %S\n", pChildInfo->pFileName);
234
235 ZeroMemory(&saveas, sizeof(saveas));
236
237 if (pChildInfo->pFileName != NULL)
238 {
239 StringCbCopy(szPath, sizeof(szPath), pChildInfo->pFileName);
240 }
241 else
242 {
243 GetWindowText(pChildInfo->hwnd, szPath, _countof(szPath));
244 StringCbCat(szPath, sizeof(szPath), TEXT(".msc"));
245 }
246
247 saveas.lStructSize = sizeof(OPENFILENAME);
248 saveas.hwndOwner = hWnd;
249 saveas.hInstance = hAppInstance;
250 saveas.lpstrFilter = L"MSC Files\0*.msc\0";
251 saveas.lpstrFile = szPath;
252 saveas.nMaxFile = MAX_PATH;
254 saveas.lpstrDefExt = L"msc";
255
256 if (GetSaveFileName(&saveas))
257 {
258 /* HACK: Because in ROS, Save-As boxes don't check the validity
259 * of file names and thus, here, szPath can be invalid !! We only
260 * see its validity when we call DoSaveFile()... */
261 SetFileName(pChildInfo, szPath);
262
263 if (DoSaveFile(hWnd, pChildInfo))
264 {
265// UpdateWindowCaption();
266 return TRUE;
267 }
268 else
269 {
270 SetFileName(pChildInfo, NULL);
271 return FALSE;
272 }
273 }
274 else
275 {
276 return FALSE;
277 }
278}
static BOOL DoSaveFile(HWND hWnd, PCONSOLE_CHILDFRM_WND pChildInfo)
Definition: console.c:208
static VOID SetFileName(PCONSOLE_CHILDFRM_WND Info, PWSTR pFileName)
Definition: console.c:180
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define GetSaveFileName
Definition: commdlg.h:666
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
#define TEXT(s)
Definition: k32.h:26
LPCWSTR szPath
Definition: env.c:37
#define L(x)
Definition: ntvdm.h:50
#define _countof(array)
Definition: sndvol32.h:68
#define StringCbCat
Definition: strsafe.h:334
#define StringCbCopy
Definition: strsafe.h:155
LPCSTR lpstrDefExt
Definition: commdlg.h:345
HWND hwndOwner
Definition: commdlg.h:330
HINSTANCE hInstance
Definition: commdlg.h:331
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
#define ZeroMemory
Definition: winbase.h:1712
#define GetWindowText
Definition: winuser.h:5798
char TCHAR
Definition: xmlstorage.h:189

Referenced by DoSaveFile(), and FrameOnSaveAs().

◆ FrameOnCommand()

static VOID FrameOnCommand ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 308 of file console.c.

312{
314 HWND hChild;
316
318
319 switch (LOWORD(wParam))
320 {
321 case IDM_FILE_NEW:
323 SetMenu(Info->hwnd,
324 Info->hMenuConsoleLarge);
325 break;
326
327 case IDM_FILE_SAVE:
329 break;
330
331 case IDM_FILE_SAVEAS:
333 break;
334
335 case IDM_FILE_EXIT:
336 PostMessage(hwnd, WM_CLOSE, 0, 0);
337 break;
338
339 case IDM_HELP_ABOUT:
341 {
345 }
346 break;
347
348 default:
350 {
352 }
353 else
354 {
356 if (hChild)
357 {
359 }
360 }
361 break;
362 }
363}
#define IDM_HELP_ABOUT
Definition: resource.h:387
static BOOL FrameOnSaveAs(HWND hWnd)
Definition: console.c:295
HWND CreateNewMDIChild(PCONSOLE_MAINFRAME_WND Info, HWND hwndMDIClient)
Definition: console.c:90
static BOOL FrameOnSave(HWND hWnd)
Definition: console.c:281
INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:59
#define IDI_MAINAPP
Definition: resource.h:6
#define IDM_FILE_NEW
Definition: resource.h:11
#define IDM_FILE_SAVE
Definition: resource.h:13
#define IDM_MDI_FIRSTCHILD
Definition: resource.h:19
#define IDM_FILE_SAVEAS
Definition: resource.h:14
#define IDM_FILE_EXIT
Definition: resource.h:15
#define IDS_APPTITLE
Definition: resource.h:3
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define ShellAbout
Definition: shellapi.h:692
#define LoadIcon
Definition: winuser.h:5813
#define WM_MDIGETACTIVE
Definition: winuser.h:1821
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by ConsoleMainFrameWndProc().

◆ FrameOnCreate()

static LRESULT FrameOnCreate ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 114 of file console.c.

116{
119 LPCTSTR lpFileName = (LPCTSTR)(((LPCREATESTRUCT)lParam)->lpCreateParams);
120
123 sizeof(CONSOLE_MAINFRAME_WND));
124 if (Info == NULL)
125 return -1;
126
127 Info->hwnd = hwnd;
128
130 0,
131 (LONG_PTR)Info);
132
133 Info->hMenuConsoleSmall = LoadMenu(hAppInstance,
135
136 Info->hMenuConsoleLarge = LoadMenu(hAppInstance,
138
139 if (lpFileName == NULL)
140 {
141 /* FIXME */
142 Info->AppAuthorMode = TRUE;
143// Info->lpConsoleTitle = TEXT("ReactOS Management Console");
144 }
145 else
146 {
147 Info->AppAuthorMode = TRUE;
148// Info->lpConsoleTitle = CreateNewConsoleTitle();
149 }
150
151 SetMenu(Info->hwnd,
152 Info->hMenuConsoleSmall);
153
154 SetWindowText(Info->hwnd, TEXT("ReactOS Management Console"));
155
156 ccs.hWindowMenu = GetSubMenu(Info->hMenuConsoleLarge, 1);
158
159 /* Create the MDI client window */
161 L"MDICLIENT",
162 (LPCTSTR)NULL,
168 hwnd,
169 (HMENU)0xCAC,
171 (LPVOID)&ccs);
172
173 ShowWindow(Info->hwndMDIClient, SW_SHOW);
174
175 return 0;
176}
#define IDM_CONSOLE_SMALL
Definition: resource.h:8
#define IDM_CONSOLE_LARGE
Definition: resource.h:9
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define WS_CHILD
Definition: pedump.c:617
#define WS_BORDER
Definition: pedump.c:625
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_HSCROLL
Definition: pedump.c:628
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define LoadMenu
Definition: winuser.h:5817
#define SW_SHOW
Definition: winuser.h:775
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define SetWindowText
Definition: winuser.h:5857
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

Referenced by ConsoleMainFrameWndProc().

◆ FrameOnSave()

static BOOL FrameOnSave ( HWND  hWnd)
static

Definition at line 281 of file console.c.

283{
284 PCONSOLE_CHILDFRM_WND pChildInfo;
285
286 pChildInfo = GetActiveChildInfo();
287 if (pChildInfo == NULL)
288 return FALSE;
289
290 return DoSaveFile(hWnd, pChildInfo);
291}
PCONSOLE_CHILDFRM_WND GetActiveChildInfo(VOID)
Definition: console.c:61

Referenced by FrameOnCommand().

◆ FrameOnSaveAs()

static BOOL FrameOnSaveAs ( HWND  hWnd)
static

Definition at line 295 of file console.c.

297{
298 PCONSOLE_CHILDFRM_WND pChildInfo;
299
300 pChildInfo = GetActiveChildInfo();
301 if (pChildInfo == NULL)
302 return FALSE;
303
304 return DoSaveFileAs(hWnd, pChildInfo);
305}

Referenced by FrameOnCommand().

◆ FrameOnSize()

static VOID FrameOnSize ( HWND  hMainWnd,
WORD  cx,
WORD  cy 
)
static

Definition at line 367 of file console.c.

370{
371 RECT rcClient; //, rcTool, rcStatus;
372// int lvHeight, iToolHeight, iStatusHeight;
373
374 /* Size toolbar and get height */
375// SendMessage(Info->hTool, TB_AUTOSIZE, 0, 0);
376// GetWindowRect(Info->hTool, &rcTool);
377// iToolHeight = rcTool.bottom - rcTool.top;
378
379 /* Size status bar and get height */
380// SendMessage(Info->hStatus, WM_SIZE, 0, 0);
381// GetWindowRect(Info->hStatus, &rcStatus);
382// iStatusHeight = rcStatus.bottom - rcStatus.top;
383
384 /* Calculate remaining height and size list view */
385 GetClientRect(hMainWnd, &rcClient);
386// lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;
387 SetWindowPos(hwndMDIClient, //Info->hTreeView,
388 NULL,
389 0,
390 0, //iToolHeight,
391 rcClient.right,
392 rcClient.bottom, //lvHeight,
394}
HWND hMainWnd
Definition: magnifier.c:32
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOZORDER
Definition: winuser.h:1247

Referenced by ConsoleMainFrameWndProc().

◆ GetActiveChildInfo()

PCONSOLE_CHILDFRM_WND GetActiveChildInfo ( VOID  )

Definition at line 61 of file console.c.

62{
63 HWND hWndMDIChild;
64
65 hWndMDIChild = (HWND)SendMessageW(hwndMDIClient, WM_MDIGETACTIVE, 0, 0);
66 if (hWndMDIChild == NULL)
67 return NULL;
68
69 return (PCONSOLE_CHILDFRM_WND)GetWindowLongPtr(hWndMDIChild, 0);
70}
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by FrameOnSave(), and FrameOnSaveAs().

◆ RegisterMMCWndClasses()

BOOL RegisterMMCWndClasses ( VOID  )

Definition at line 526 of file console.c.

527{
528 WNDCLASSEX wc = {0};
529 BOOL Ret;
530
531 /* Register the MMCMainFrame window class */
532 wc.cbSize = sizeof(WNDCLASSEX);
533 wc.style = 0;
535 wc.cbClsExtra = 0;
542 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
543 wc.lpszMenuName = NULL;
545
546 Ret = (RegisterClassEx(&wc) != (ATOM)0);
547
548 if (Ret)
549 {
550 /* Register the MMCChildFrm window class */
551 wc.cbSize = sizeof(WNDCLASSEX);
554 wc.cbClsExtra = 0;
559 wc.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
560 wc.lpszMenuName = NULL;
563
564 Ret = (RegisterClassEx(&wc) != (ATOM)0);
565 if (!Ret)
566 {
569 }
570 }
571
572 return Ret;
573}
static LRESULT CALLBACK ConsoleChildFrmProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: console.c:479
static LRESULT CALLBACK ConsoleMainFrameWndProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: console.c:398
WORD ATOM
Definition: dimm.idl:113
unsigned int BOOL
Definition: ntddk_ex.h:94
int cbClsExtra
Definition: winuser.h:3204
HINSTANCE hInstance
Definition: winuser.h:3206
HCURSOR hCursor
Definition: winuser.h:3208
LPCSTR lpszMenuName
Definition: winuser.h:3210
HICON hIconSm
Definition: winuser.h:3212
UINT style
Definition: winuser.h:3202
int cbWndExtra
Definition: winuser.h:3205
UINT cbSize
Definition: winuser.h:3201
WNDPROC lpfnWndProc
Definition: winuser.h:3203
LPCSTR lpszClassName
Definition: winuser.h:3211
HICON hIcon
Definition: winuser.h:3207
HBRUSH hbrBackground
Definition: winuser.h:3209
#define CS_VREDRAW
Definition: winuser.h:658
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
#define UnregisterClass
Definition: winuser.h:5861
#define IDI_APPLICATION
Definition: winuser.h:704
#define RegisterClassEx
Definition: winuser.h:5837
#define LoadCursor
Definition: winuser.h:5812
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5719
#define COLOR_BTNFACE
Definition: winuser.h:928
#define COLOR_3DFACE
Definition: winuser.h:929

Referenced by _tWinMain().

◆ SetFileName()

static VOID SetFileName ( PCONSOLE_CHILDFRM_WND  Info,
PWSTR  pFileName 
)
static

Definition at line 180 of file console.c.

183{
184 DPRINT1("SetFileName(&p \'%S\')\n", Info, pFileName);
185
186 if (Info->pFileName != NULL)
187 {
188 HeapFree(GetProcessHeap(), 0, Info->pFileName);
189 Info->pFileName = NULL;
190 }
191
192 if (pFileName != NULL)
193 {
194 Info->pFileName = HeapAlloc(GetProcessHeap(),
195 0,
196 (_tcslen(pFileName) + 1) * sizeof(TCHAR));
197 if (Info->pFileName != NULL)
198 _tcscpy(Info->pFileName, pFileName);
199 }
200}
#define GetProcessHeap()
Definition: compat.h:736
#define _tcscpy
Definition: tchar.h:623
#define _tcslen
Definition: xmlstorage.h:198

Referenced by DIALOG_FileSaveAs(), DoCloseFile(), DoOpenFile(), DoSaveFile(), and DoSaveFileAs().

◆ UnregisterMMCWndClasses()

VOID UnregisterMMCWndClasses ( VOID  )

Definition at line 576 of file console.c.

Referenced by _tWinMain().

Variable Documentation

◆ NewConsoleCount

ULONG NewConsoleCount = 0
static

Definition at line 58 of file console.c.

Referenced by CreateNewConsoleTitle().

◆ szMMCChildFrm

const TCHAR szMMCChildFrm[] = TEXT("MMCChildFrm")
static

Definition at line 56 of file console.c.

Referenced by CreateNewMDIChild(), RegisterMMCWndClasses(), and UnregisterMMCWndClasses().

◆ szMMCMainFrame

const TCHAR szMMCMainFrame[] = TEXT("MMCMainFrame")
static

Definition at line 55 of file console.c.

Referenced by CreateConsoleWindow(), RegisterMMCWndClasses(), and UnregisterMMCWndClasses().