ReactOS  0.4.14-dev-843-g15bc263
precomp.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#include <commctrl.h>
#include <commdlg.h>
#include <tchar.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WM_USER_CLOSE_CHILD   (WM_USER + 1)
 

Functions

BOOL RegisterMMCWndClasses (VOID)
 
VOID UnregisterMMCWndClasses (VOID)
 
HWND CreateConsoleWindow (IN LPCTSTR lpFileName OPTIONAL, int nCmdShow)
 
INT LengthOfStrResource (IN HINSTANCE hInst, IN UINT uID)
 
DWORD LoadAndFormatString (IN HINSTANCE hInstance, IN UINT uID, OUT LPTSTR *lpTarget,...)
 

Variables

HINSTANCE hAppInstance
 
HANDLE hAppHeap
 
HWND hwndMainConsole
 
HWND hwndMDIClient
 

Macro Definition Documentation

◆ WM_USER_CLOSE_CHILD

#define WM_USER_CLOSE_CHILD   (WM_USER + 1)

Definition at line 14 of file precomp.h.

Function Documentation

◆ CreateConsoleWindow()

HWND CreateConsoleWindow ( IN LPCTSTR lpFileName  OPTIONAL,
int  nCmdShow 
)

Definition at line 574 of file console.c.

576 {
577  HWND hWndConsole;
579 
580  hWndConsole = CreateWindowEx(WS_EX_WINDOWEDGE,
582  NULL,
588  NULL,
589  NULL,
590  hAppInstance,
591  (PVOID)FileName);
592 
593  if (hWndConsole != NULL)
594  {
595  ShowWindow(hWndConsole, nCmdShow);
596  }
597 
598  return hWndConsole;
599 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define LONG_PTR
Definition: treelist.c:79
static const TCHAR szMMCMainFrame[]
Definition: console.c:54
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define CreateWindowEx
Definition: winuser.h:5730
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
_In_ LPCSTR lpFileName
Definition: winbase.h:3028
HINSTANCE hAppInstance
Definition: mmc.c:23

Referenced by _tWinMain().

◆ LengthOfStrResource()

INT LengthOfStrResource ( IN HINSTANCE  hInst,
IN UINT  uID 
)

Definition at line 23 of file misc.c.

25 {
26  HRSRC hrSrc;
27  HGLOBAL hRes;
28  LPWSTR lpName, lpStr;
29 
30  if (hInst == NULL)
31  {
32  return -1;
33  }
34 
35  /* There are always blocks of 16 strings */
36  lpName = (LPWSTR)MAKEINTRESOURCE((uID >> 4) + 1);
37 
38  /* Find the string table block */
39  if ((hrSrc = FindResourceW(hInst, lpName, (LPWSTR)RT_STRING)) &&
40  (hRes = LoadResource(hInst, hrSrc)) &&
41  (lpStr = LockResource(hRes)))
42  {
43  UINT x;
44 
45  /* Find the string we're looking for */
46  uID &= 0xF; /* position in the block, same as % 16 */
47  for (x = 0; x < uID; x++)
48  {
49  lpStr += (*lpStr) + 1;
50  }
51 
52  /* Found the string */
53  return (int)(*lpStr);
54  }
55  return -1;
56 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
_In_ LPCSTR lpName
Definition: winbase.h:2746
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
#define RT_STRING
Definition: pedump.c:368
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int UINT
Definition: ndis.h:50
static LPWSTR
Definition: misc.c:35
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ LoadAndFormatString()

DWORD LoadAndFormatString ( IN HINSTANCE  hInstance,
IN UINT  uID,
OUT LPTSTR lpTarget,
  ... 
)

Definition at line 86 of file misc.c.

90 {
91  DWORD Ret = 0;
93  va_list lArgs;
94 
96  hInstance,
97  uID) != 0)
98  {
99  va_start(lArgs, lpTarget);
100  /* let's use FormatMessage to format it because it has the ability to allocate
101  memory automatically */
103  lpFormat,
104  0,
105  0,
106  (LPTSTR)lpTarget,
107  0,
108  &lArgs);
109  va_end(lArgs);
110 
112  }
113 
114  return Ret;
115 }
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:402
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
CHAR * LPTSTR
Definition: xmlstorage.h:192
HINSTANCE hInstance
Definition: charmap.c:20
#define va_end(ap)
Definition: acmsvcex.h:90
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
char * va_list
Definition: acmsvcex.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FormatMessage
Definition: winbase.h:3629
LPCWSTR lpFormat
Definition: trayclock.cpp:32
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define va_start(ap, A)
Definition: acmsvcex.h:91
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ RegisterMMCWndClasses()

BOOL RegisterMMCWndClasses ( VOID  )

Definition at line 515 of file console.c.

516 {
517  WNDCLASSEX wc = {0};
518  BOOL Ret;
519 
520  /* Register the MMCMainFrame window class */
521  wc.cbSize = sizeof(WNDCLASSEX);
522  wc.style = 0;
524  wc.cbClsExtra = 0;
525  wc.cbWndExtra = sizeof(PCONSOLE_MAINFRAME_WND);
526  wc.hInstance = hAppInstance;
529  wc.hCursor = LoadCursor(NULL,
531  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
532  wc.lpszMenuName = NULL;
534 
535  Ret = (RegisterClassEx(&wc) != (ATOM)0);
536 
537  if (Ret)
538  {
539  /* Register the MMCChildFrm window class */
540  wc.cbSize = sizeof(WNDCLASSEX);
541  wc.style = CS_HREDRAW | CS_VREDRAW;
543  wc.cbClsExtra = 0;
544  wc.cbWndExtra = sizeof(PCONSOLE_CHILDFRM_WND);
545  wc.hInstance = hAppInstance;
548  wc.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
549  wc.lpszMenuName = NULL;
552 
553  Ret = (RegisterClassEx(&wc) != (ATOM)0);
554  if (!Ret)
555  {
557  hAppInstance);
558  }
559  }
560 
561  return Ret;
562 }
UINT style
Definition: winuser.h:3177
#define MAKEINTRESOURCE
Definition: winuser.h:591
LPCSTR lpszMenuName
Definition: winuser.h:3185
#define RegisterClassEx
Definition: winuser.h:5812
struct _CONSOLE_MAINFRAME_WND * PCONSOLE_MAINFRAME_WND
HCURSOR hCursor
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3178
LPCSTR lpszClassName
Definition: winuser.h:3186
WORD ATOM
Definition: dimm.idl:113
static const TCHAR szMMCMainFrame[]
Definition: console.c:54
static LRESULT CALLBACK ConsoleChildFrmProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: console.c:468
#define CS_HREDRAW
Definition: winuser.h:648
#define IDI_APPLICATION
Definition: winuser.h:699
HICON hIconSm
Definition: winuser.h:3187
static LRESULT CALLBACK ConsoleMainFrameWndProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: console.c:387
#define COLOR_3DFACE
Definition: winuser.h:919
HINSTANCE hInstance
Definition: winuser.h:3181
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3176
struct _CONSOLE_CHILDFRM_WND * PCONSOLE_CHILDFRM_WND
HBRUSH hbrBackground
Definition: winuser.h:3184
#define CS_VREDRAW
Definition: winuser.h:653
int cbWndExtra
Definition: winuser.h:3180
HICON hIcon
Definition: winuser.h:3182
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5787
int cbClsExtra
Definition: winuser.h:3179
static const TCHAR szMMCChildFrm[]
Definition: console.c:55
#define IDC_ARROW
Definition: winuser.h:682
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5694
#define LoadIcon
Definition: winuser.h:5788
#define UnregisterClass
Definition: winuser.h:5836
HINSTANCE hAppInstance
Definition: mmc.c:23
#define IDI_MAINAPP
Definition: resource.h:6

Referenced by _tWinMain().

◆ UnregisterMMCWndClasses()

VOID UnregisterMMCWndClasses ( VOID  )

Definition at line 565 of file console.c.

566 {
568  hAppInstance);
570  hAppInstance);
571 }
static const TCHAR szMMCMainFrame[]
Definition: console.c:54
static const TCHAR szMMCChildFrm[]
Definition: console.c:55
#define UnregisterClass
Definition: winuser.h:5836
HINSTANCE hAppInstance
Definition: mmc.c:23

Referenced by _tWinMain().

Variable Documentation

◆ hAppHeap

HANDLE hAppHeap

Definition at line 24 of file mmc.c.

◆ hAppInstance

HINSTANCE hAppInstance

Definition at line 23 of file mmc.c.

◆ hwndMainConsole

HWND hwndMainConsole

Definition at line 25 of file mmc.c.

Referenced by _tWinMain(), and ConsoleChildFrmProc().

◆ hwndMDIClient