ReactOS 0.4.17-dev-784-g3812a95
CMainWnd Class Reference

#include <CMainWnd.h>

Inheritance diagram for CMainWnd:
Collaboration diagram for CMainWnd:

Public Member Functions

 CMainWnd ()
 
 ~CMainWnd ()
 
LRESULT OnCreate (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNewMDIChild (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
 
LRESULT OnFileSave (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
 
LRESULT OnFileSaveAs (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
 
LRESULT OnFileAdd (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
 
LRESULT OnFileExit (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
 
LRESULT OnHelpAbout (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
 
LRESULT OnMDIForward (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
 
LRESULT OnSize (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCloseChild (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDestroy (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnClose (UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
int GetSnapinCacheCount ()
 
CSnapinCacheEntryGetSnapinCacheEntry (int nIndex)
 
CSnapinCacheEntryGetSnapinCacheEntryByGuid (PWSTR pszGuid)
 
HIMAGELIST SnapinImageList ()
 

Static Public Member Functions

static CWndClassInfo & GetWndClassInfo ()
 
static LPCTSTR GetWndClassName ()
 
static LRESULT CALLBACK XDefFrameProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Public Attributes

CWindow m_MDIClient
 

Private Member Functions

void UpdateMenu ()
 
CConsoleWndGetActiveChildInfo ()
 
void CreateNewConsoleTitle (CAtlString &str)
 
LRESULT LoadSnapinCache ()
 

Private Attributes

CWndProcThunk m_FrameThunk
 
int m_NewConsoleCount
 
int m_nConsoleCount
 
HMENU m_hMenuConsoleSmall
 
HMENU m_hMenuConsoleLarge
 
bool m_AppAuthorMode
 
CSimpleArray< CSnapinCacheEntry * > m_SnapinCache
 
HIMAGELIST m_hSnapinImageList
 

Detailed Description

Definition at line 12 of file CMainWnd.h.

Constructor & Destructor Documentation

◆ CMainWnd()

CMainWnd::CMainWnd ( )

Definition at line 12 of file CMainWnd.cpp.

15 , m_AppAuthorMode(false)
17{
19 m_pfnSuperWindowProc = m_FrameThunk.GetWNDPROC();
21 m_hMenuConsoleSmall = LoadMenu(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDM_CONSOLE_SMALL));
22 m_hMenuConsoleLarge = LoadMenu(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDM_CONSOLE_LARGE));
26 0,
27 4);
29}
#define IDM_CONSOLE_SMALL
Definition: resource.h:8
#define IDM_CONSOLE_LARGE
Definition: resource.h:9
WNDPROC GetWNDPROC()
Definition: atlwin.h:258
BOOL Init(WNDPROC proc, void *pThis)
Definition: atlwin.h:250
bool m_AppAuthorMode
Definition: CMainWnd.h:22
CWndProcThunk m_FrameThunk
Definition: CMainWnd.h:16
int m_nConsoleCount
Definition: CMainWnd.h:19
static LRESULT CALLBACK XDefFrameProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CMainWnd.h:76
int m_NewConsoleCount
Definition: CMainWnd.h:18
HMENU m_hMenuConsoleSmall
Definition: CMainWnd.h:20
HIMAGELIST m_hSnapinImageList
Definition: CMainWnd.h:25
LRESULT LoadSnapinCache()
Definition: CMainWnd.cpp:228
HMENU m_hMenuConsoleLarge
Definition: CMainWnd.h:21
#define NULL
Definition: types.h:112
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
Definition: combase.c:2803
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:279
#define ILC_COLOR32
Definition: commctrl.h:358
#define ILC_MASK
Definition: commctrl.h:351
#define SM_CYSMICON
Definition: winuser.h:1024
#define SM_CXSMICON
Definition: winuser.h:1023
#define LoadMenu
Definition: winuser.h:5983
int WINAPI GetSystemMetrics(_In_ int)

◆ ~CMainWnd()

CMainWnd::~CMainWnd ( )

Definition at line 31 of file CMainWnd.cpp.

32{
37}
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
BOOL WINAPI DestroyMenu(_In_ HMENU)

Member Function Documentation

◆ CreateNewConsoleTitle()

void CMainWnd::CreateNewConsoleTitle ( CAtlString &  str)
inlineprivate

Definition at line 103 of file CMainWnd.h.

104 {
106 str.LoadString(IDS_CONSOLETITLE);
107
108 LPTSTR lpTarget = NULL;
110 str.GetString(), 0, 0, (LPTSTR)&lpTarget, 0, (va_list*)args);
111
112 if (Ret)
113 {
114 str = lpTarget;
115 LocalFree(lpTarget);
116 }
117 }
#define IDS_CONSOLETITLE
Definition: resource.h:4
char * va_list
Definition: vadefs.h:50
unsigned long DWORD
Definition: ntddk_ex.h:95
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
LPSTR LPTSTR
Definition: ms-dtyp.idl:131
const WCHAR * str
Definition: match.c:390
#define DWORD_PTR
Definition: treelist.c:76
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define FormatMessage
Definition: winbase.h:3516
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:398
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
Definition: winbase.h:401

Referenced by OnNewMDIChild().

◆ GetActiveChildInfo()

CConsoleWnd * CMainWnd::GetActiveChildInfo ( )
inlineprivate

Definition at line 92 of file CMainWnd.h.

93 {
94 HWND hWndMDIChild;
95
96 hWndMDIChild = (HWND)m_MDIClient.SendMessage(WM_MDIGETACTIVE, 0, 0);
97 if (hWndMDIChild == NULL)
98 return NULL;
99
100 return (CConsoleWnd*)::GetWindowLongPtr(hWndMDIChild, 0);
101 }
CWindow m_MDIClient
Definition: CMainWnd.h:28
HANDLE HWND
Definition: compat.h:19
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_MDIGETACTIVE
Definition: winuser.h:1849

Referenced by OnFileAdd(), OnFileSave(), and OnFileSaveAs().

◆ GetSnapinCacheCount()

int CMainWnd::GetSnapinCacheCount ( )

Definition at line 252 of file CMainWnd.cpp.

253{
254 return m_SnapinCache.GetSize();
255}
CSimpleArray< CSnapinCacheEntry * > m_SnapinCache
Definition: CMainWnd.h:24

Referenced by CAddDialog::OnInitDialog().

◆ GetSnapinCacheEntry()

CSnapinCacheEntry * CMainWnd::GetSnapinCacheEntry ( int  nIndex)

Definition at line 258 of file CMainWnd.cpp.

259{
260 return m_SnapinCache[nIndex];
261}

Referenced by CAddDialog::OnInitDialog().

◆ GetSnapinCacheEntryByGuid()

CSnapinCacheEntry * CMainWnd::GetSnapinCacheEntryByGuid ( PWSTR  pszGuid)

Definition at line 264 of file CMainWnd.cpp.

265{
266 for (int i = 0; i < m_SnapinCache.GetSize(); i++)
267 {
269 if (entry->GuidString().CompareNoCase(pszGuid) == 0)
270 return entry;
271 }
272 return NULL;
273}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
uint32_t entry
Definition: isohybrid.c:63

◆ GetWndClassInfo()

static CWndClassInfo & CMainWnd::GetWndClassInfo ( )
inlinestatic

Definition at line 48 of file CMainWnd.h.

49 {
50 static CWndClassInfo wc =
51 {
52 {
53 /* cbSize= */sizeof(WNDCLASSEX),
54 /* style= */0,
55 /* lpfnWndProc= */StartWindowProc,
56 /* cbClsExtra= */0,
57 /* cbWndExtra= */0,
58 /* hInstance= */NULL,
59 /* hIcon= */LoadIcon(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDI_MAINAPP)),
60 /* hCursor= */NULL,
61 /* hbrBackground= */(HBRUSH)(COLOR_BTNFACE + 1),
62 /* lpszMenuName= */NULL,
63 /* lpszClassName= */TEXT("MMCMainFrame"),
64 /* hIconSm= */LoadIcon(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDI_MAINAPP))
65 },
66 NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
67 };
68 return wc;
69 }
#define IDI_MAINAPP
Definition: resource.h:6
#define TRUE
Definition: types.h:120
#define TEXT(s)
Definition: k32.h:28
_ATL_WNDCLASSINFOW CWndClassInfo
Definition: atlwin.h:70
#define _T(x)
Definition: vfdio.h:22
#define IDC_ARROW
Definition: winuser.h:695
#define LoadIcon
Definition: winuser.h:5979
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5885
#define COLOR_BTNFACE
Definition: winuser.h:939

Referenced by GetWndClassName().

◆ GetWndClassName()

static LPCTSTR CMainWnd::GetWndClassName ( )
inlinestatic

Definition at line 71 of file CMainWnd.h.

72 {
73 return GetWndClassInfo().m_wc.lpszClassName;
74 }
static CWndClassInfo & GetWndClassInfo()
Definition: CMainWnd.h:48

◆ LoadSnapinCache()

LRESULT CMainWnd::LoadSnapinCache ( )
private

Definition at line 228 of file CMainWnd.cpp.

229{
230 CRegKey SnapinsKey;
231 if (ERROR_SUCCESS == SnapinsKey.Open(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\MMC\\SnapIns", KEY_READ))
232 {
233 WCHAR namebuf[MAX_PATH];
234 DWORD index = 0, namelen = _countof(namebuf);
235 while (ERROR_SUCCESS == SnapinsKey.EnumKey(index++, namebuf, &namelen))
236 {
237 DPRINT1("%S\n", namebuf);
238 CSnapinCacheEntry* snapin = CSnapinCacheEntry::Create(SnapinsKey, namebuf, m_hSnapinImageList);
239 DPRINT1("CacheEntry %p\n", snapin);
240 if (snapin)
241 {
242 m_SnapinCache.Add(snapin);
243 }
244 namelen = _countof(namebuf);
245 }
246 SnapinsKey.Close();
247 }
248 return S_OK;
249}
#define DPRINT1
Definition: precomp.h:8
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE) noexcept
Definition: atlbase.h:1173
LONG Close() noexcept
Definition: atlbase.h:1156
LONG EnumKey(DWORD iIndex, LPTSTR pszName, LPDWORD pnNameLength, FILETIME *pftLastWriteTime=NULL) noexcept
Definition: atlbase.h:1421
static CSnapinCacheEntry * Create(CRegKey &SnapinsKey, PWSTR guidString, HIMAGELIST hImageList)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAX_PATH
Definition: compat.h:34
#define L(x)
Definition: resources.c:13
GLint namelen
Definition: glext.h:7232
GLuint index
Definition: glext.h:6031
#define S_OK
Definition: intsafe.h:52
#define KEY_READ
Definition: nt_native.h:1026
short WCHAR
Definition: pedump.c:58
#define _countof(array)
Definition: sndvol32.h:70
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CMainWnd().

◆ OnClose()

LRESULT CMainWnd::OnClose ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 221 of file CMainWnd.cpp.

222{
224 return 0;
225}
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ OnCloseChild()

LRESULT CMainWnd::OnCloseChild ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 205 of file CMainWnd.cpp.

206{
208 UpdateMenu();
209 return 0;
210}
void UpdateMenu()
Definition: CMainWnd.h:84

◆ OnCreate()

LRESULT CMainWnd::OnCreate ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 40 of file CMainWnd.cpp.

41{
43 LPCTSTR lpFileName = (LPCTSTR)(((LPCREATESTRUCT)lParam)->lpCreateParams);
45 UpdateMenu();
46 SetWindowText(TEXT("ReactOS Management Console"));
49 RECT rect;
51 /* Create the MDI client window */
53 //hwndMDIClient = CreateWindowEx(WS_EX_CLIENTEDGE, L"MDICLIENT", (LPCTSTR)NULL,
54 // ,
55 // rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
56 // m_hWnd, NULL, _AtlBaseModule.GetModuleInstance(), (LPVOID)&ccs);
59 if (lpFileName == NULL)
60 {
62 }
63 return 0;
64}
#define IDM_FILE_NEW
Definition: resource.h:11
#define IDM_MDI_FIRSTCHILD
Definition: resource.h:19
#define U(x)
Definition: wordpad.c:45
HWND Create(LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:417
BOOL UpdateWindow()
Definition: atlwin.h:1345
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1333
RECT rect
Definition: combotst.c:67
LPARAM lParam
Definition: combotst.c:139
LPCSTR LPCTSTR
Definition: ms-dtyp.idl:130
#define WS_CHILD
Definition: pedump.c:617
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_HSCROLL
Definition: pedump.c:628
#define WS_CLIPCHILDREN
Definition: pedump.c:619
_In_ LPCSTR lpFileName
Definition: winbase.h:2800
#define WM_COMMAND
Definition: winuser.h:1768
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define PostMessage
Definition: winuser.h:5998
#define SW_SHOW
Definition: winuser.h:786
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define SetWindowText
Definition: winuser.h:6023

◆ OnDestroy()

LRESULT CMainWnd::OnDestroy ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 213 of file CMainWnd.cpp.

214{
216 SetMenu(NULL);
217 return 0;
218}
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

◆ OnFileAdd()

LRESULT CMainWnd::OnFileAdd ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
)

Definition at line 148 of file CMainWnd.cpp.

149{
151 if (child == NULL)
152 return 0;
153 CAddDialog dlg(this, child);
154 dlg.DoModal(m_hWnd, (LPARAM)child);
155 return 0;
156}
CConsoleWnd * GetActiveChildInfo()
Definition: CMainWnd.h:92
LONG_PTR LPARAM
Definition: minwindef.h:175
static HWND child
Definition: cursoricon.c:298

◆ OnFileExit()

LRESULT CMainWnd::OnFileExit ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
)

Definition at line 159 of file CMainWnd.cpp.

160{
161 PostMessage(WM_CLOSE, 0, 0);
162 return 0;
163}
#define WM_CLOSE
Definition: winuser.h:1649

◆ OnFileSave()

LRESULT CMainWnd::OnFileSave ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
)

Definition at line 99 of file CMainWnd.cpp.

100{
102 if (child == NULL)
103 return 0;
104 if (child->m_Filename.IsEmpty())
105 return OnFileSaveAs(wNotifyCode, wID, hWndCtl, bHandled);
106 // save, and if fails clear pFileName
107 return 0;
108}
LRESULT OnFileSaveAs(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
Definition: CMainWnd.cpp:111

Referenced by OnFileSaveAs().

◆ OnFileSaveAs()

LRESULT CMainWnd::OnFileSaveAs ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
)

Definition at line 111 of file CMainWnd.cpp.

112{
113 OPENFILENAME saveas;
116 if (child == NULL)
117 return 0;
118 ZeroMemory(&saveas, sizeof(saveas));
119 if (!child->m_Filename.IsEmpty())
120 {
121 _tcscpy(szPath, child->m_Filename);
122 }
123 else
124 {
125 child->GetWindowText(szPath, MAX_PATH);
126 _tcscat(szPath, TEXT(".msc"));
127 }
128 saveas.lStructSize = sizeof(OPENFILENAME);
129 saveas.hwndOwner = m_hWnd;
130 saveas.hInstance = _AtlBaseModule.GetModuleInstance();
131 saveas.lpstrFilter = L"MSC Files\0*.msc\0";
132 saveas.lpstrFile = szPath;
133 saveas.nMaxFile = MAX_PATH;
135 saveas.lpstrDefExt = L"msc";
136 if (GetSaveFileName(&saveas))
137 {
138 child->m_Filename = szPath;
139 return OnFileSave(wNotifyCode, wID, hWndCtl, bHandled);
140 }
141 else
142 {
143 return 0;
144 }
145}
LRESULT OnFileSave(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
Definition: CMainWnd.cpp:99
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define GetSaveFileName
Definition: commdlg.h:666
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
char TCHAR
Definition: tchar.h:1402
#define _tcscat
Definition: tchar.h:622
#define _tcscpy
Definition: tchar.h:623
#define ZeroMemory
Definition: minwinbase.h:31
LPCWSTR szPath
Definition: env.c:37
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

Referenced by OnFileSave().

◆ OnHelpAbout()

LRESULT CMainWnd::OnHelpAbout ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
)

Definition at line 166 of file CMainWnd.cpp.

167{
168 HICON hIcon = LoadIcon(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDI_MAINAPP));
171 CAtlString TitleString;
172
173 TitleString = AboutTitle;
174 TitleString += L"#";
175 TitleString += AppTitle;
176
177 ::ShellAboutW(this->m_hWnd, (LPWSTR)TitleString.GetString(), NULL, hIcon);
178
179 return 0;
180}
#define IDS_APPTITLE
Definition: resource.h:3
#define IDS_ABOUTTITLE
Definition: resource.h:15
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
uint16_t * LPWSTR
Definition: typedefs.h:56

◆ OnMDIForward()

LRESULT CMainWnd::OnMDIForward ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
)

Definition at line 183 of file CMainWnd.cpp.

184{
186 if (hChild)
187 {
188 WPARAM wParam = MAKEWPARAM(wNotifyCode, wID);
189 LPARAM lParam = (LPARAM)hWndCtl;
191 }
192 return 0;
193}
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
WPARAM wParam
Definition: combotst.c:138
UINT_PTR WPARAM
Definition: minwindef.h:174
static HTREEITEM hChild
Definition: treeview.c:383
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117
#define SendMessage
Definition: winuser.h:6009

◆ OnNewMDIChild()

LRESULT CMainWnd::OnNewMDIChild ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
)

Definition at line 67 of file CMainWnd.cpp.

68{
73 mcs.szTitle = title.GetString();
75 mcs.hOwner = _AtlBaseModule.GetModuleInstance();
76 mcs.x = mcs.cx = CW_USEDEFAULT;
77 mcs.y = mcs.cy = CW_USEDEFAULT;
79 BOOL bMaximized = FALSE;
80 HWND hWndOld = (HWND)m_MDIClient.SendMessage(WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);
81 mcs.lParam = bMaximized || !hWndOld;
82 /* This object registers itself in the _AtlWinModule to be assigned to the next window created */
83 CConsoleWnd* child = new CConsoleWnd(this);
84 /* Ask for a new MDI Child window */
86 if (hChild)
87 {
89 }
90 else
91 {
92 delete child;
93 }
94 UpdateMenu();
95 return 1;
96}
static struct myctx * mcs
Definition: adnstest.c:53
static LPCTSTR GetWndClassName()
Definition: CConsoleWnd.h:56
void CreateNewConsoleTitle(CAtlString &str)
Definition: CMainWnd.h:103
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static char title[]
Definition: ps.c:92
#define WM_MDICREATE
Definition: winuser.h:1840
#define MDIS_ALLCHILDSTYLES
Definition: winuser.h:253
#define CW_USEDEFAULT
Definition: winuser.h:225

◆ OnSize()

LRESULT CMainWnd::OnSize ( UINT  nMessage,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 196 of file CMainWnd.cpp.

197{
198 RECT rcClient;
199 GetClientRect(&rcClient);
200 m_MDIClient.SetWindowPos(NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
201 return 0;
202}
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1288
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
#define SWP_NOZORDER
Definition: winuser.h:1258

◆ SnapinImageList()

HIMAGELIST CMainWnd::SnapinImageList ( )

Definition at line 276 of file CMainWnd.cpp.

277{
278 return m_hSnapinImageList;
279}

Referenced by CAddDialog::InitLV(), and CAddDialog::InitTV().

◆ UpdateMenu()

void CMainWnd::UpdateMenu ( )
inlineprivate

Definition at line 84 of file CMainWnd.h.

85 {
86 if (m_nConsoleCount == 0)
88 else
90 }

Referenced by OnCloseChild(), OnCreate(), and OnNewMDIChild().

◆ XDefFrameProc()

static LRESULT CALLBACK CMainWnd::XDefFrameProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlinestatic

Definition at line 76 of file CMainWnd.h.

77 {
78 CMainWnd* pThis = reinterpret_cast<CMainWnd*>(hWnd);
79 return ::DefFrameProc(pThis->m_hWnd, pThis->m_MDIClient.m_hWnd, uMsg, wParam, lParam);
80 }
HWND hWnd
Definition: settings.c:17

Referenced by CMainWnd().

Member Data Documentation

◆ m_AppAuthorMode

bool CMainWnd::m_AppAuthorMode
private

Definition at line 22 of file CMainWnd.h.

Referenced by OnCreate().

◆ m_FrameThunk

CWndProcThunk CMainWnd::m_FrameThunk
private

Definition at line 16 of file CMainWnd.h.

Referenced by CMainWnd().

◆ m_hMenuConsoleLarge

HMENU CMainWnd::m_hMenuConsoleLarge
private

Definition at line 21 of file CMainWnd.h.

Referenced by CMainWnd(), OnCreate(), UpdateMenu(), and ~CMainWnd().

◆ m_hMenuConsoleSmall

HMENU CMainWnd::m_hMenuConsoleSmall
private

Definition at line 20 of file CMainWnd.h.

Referenced by CMainWnd(), UpdateMenu(), and ~CMainWnd().

◆ m_hSnapinImageList

HIMAGELIST CMainWnd::m_hSnapinImageList
private

Definition at line 25 of file CMainWnd.h.

Referenced by CMainWnd(), LoadSnapinCache(), SnapinImageList(), and ~CMainWnd().

◆ m_MDIClient

CWindow CMainWnd::m_MDIClient

◆ m_nConsoleCount

int CMainWnd::m_nConsoleCount
private

Definition at line 19 of file CMainWnd.h.

Referenced by OnCloseChild(), OnNewMDIChild(), and UpdateMenu().

◆ m_NewConsoleCount

int CMainWnd::m_NewConsoleCount
private

Definition at line 18 of file CMainWnd.h.

Referenced by CreateNewConsoleTitle().

◆ m_SnapinCache

CSimpleArray<CSnapinCacheEntry*> CMainWnd::m_SnapinCache
private

The documentation for this class was generated from the following files: