ReactOS 0.4.16-dev-88-ga65b6ae
mainwnd.c File Reference
#include "precomp.h"
Include dependency graph for mainwnd.c:

Go to the source code of this file.

Macros

#define ID_MDI_FIRSTCHILD   50000
 
#define ID_MDI_WINDOWMENU   5
 

Functions

static VOID CreateToolbars (PMAIN_WND_INFO Info)
 
static VOID CALLBACK MainWndResize (PVOID Context, WORD cx, WORD cy)
 
static VOID InitMainWnd (PMAIN_WND_INFO Info)
 
static VOID MainWndCommand (PMAIN_WND_INFO Info, WORD CmdId, HWND hControl)
 
static VOID DestroyMainWnd (PMAIN_WND_INFO Info)
 
static VOID UpdateMainStatusBar (PMAIN_WND_INFO Info)
 
static BOOL MainWndMenuHint (PMAIN_WND_INFO Info, WORD CmdId, const MENU_HINT *HintArray, DWORD HintsCount, UINT DefHintId)
 
static LRESULT CALLBACK MainWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
MDI_EDITOR_TYPE MainWndGetCurrentEditor (PMAIN_WND_INFO MainWnd, PVOID *Info)
 
VOID MainWndSwitchEditorContext (PMAIN_WND_INFO Info, HWND hDeactivate, HWND hActivate)
 
HWND CreateMainWindow (LPCTSTR lpCaption, int nCmdShow)
 
BOOL MainWndTranslateMDISysAccel (HWND hwnd, LPMSG lpMsg)
 
BOOL InitMainWindowImpl (VOID)
 
VOID UninitMainWindowImpl (VOID)
 

Variables

static const TCHAR szMainWndClass [] = TEXT("WordPadMainWndClass")
 
static const MENU_HINT MainMenuHintTable []
 
static const MENU_HINT SystemMenuHintTable []
 

Macro Definition Documentation

◆ ID_MDI_FIRSTCHILD

#define ID_MDI_FIRSTCHILD   50000

Definition at line 5 of file mainwnd.c.

◆ ID_MDI_WINDOWMENU

#define ID_MDI_WINDOWMENU   5

Definition at line 6 of file mainwnd.c.

Function Documentation

◆ CreateMainWindow()

HWND CreateMainWindow ( LPCTSTR  lpCaption,
int  nCmdShow 
)

Definition at line 575 of file mainwnd.c.

577{
580
582 0,
583 sizeof(MAIN_WND_INFO));
584 if (Info != NULL)
585 {
587 sizeof(MAIN_WND_INFO));
588 Info->nCmdShow = nCmdShow;
589
590 /* FIXME - load the window position from the registry */
591
594 lpCaption,
600 NULL,
601 NULL,
602 hInstance,
603 Info);
604 if (hMainWnd == NULL)
605 {
607 0,
608 Info);
609 }
610 }
611
612 return hMainWnd;
613}
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:15
HANDLE ProcessHeap
Definition: servman.c:15
HINSTANCE hInstance
Definition: charmap.c:19
#define NULL
Definition: types.h:112
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
HWND hMainWnd
Definition: magnifier.c:32
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
#define ZeroMemory
Definition: winbase.h:1712
#define CreateWindowEx
Definition: winuser.h:5767
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define CW_USEDEFAULT
Definition: winuser.h:225

◆ CreateToolbars()

static VOID CreateToolbars ( PMAIN_WND_INFO  Info)
static

Definition at line 43 of file mainwnd.c.

44{
45
46}

Referenced by InitMainWnd().

◆ DestroyMainWnd()

static VOID DestroyMainWnd ( PMAIN_WND_INFO  Info)
static

Definition at line 275 of file mainwnd.c.

276{
277 /* FIXME - cleanup allocated resources */
278}

Referenced by MainWndProc().

◆ InitMainWindowImpl()

BOOL InitMainWindowImpl ( VOID  )

Definition at line 634 of file mainwnd.c.

635{
636 WNDCLASSEX wc = {0};
637
638 wc.cbSize = sizeof(WNDCLASSEX);
640 wc.hInstance = hInstance;
644 IDC_ARROW);
645 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
651 16,
652 16,
653 LR_SHARED);
654
655 return RegisterClassEx(&wc) != (ATOM)0;
656}
#define IDI_ICON
Definition: resource.h:5
#define IDR_MAINMENU
Definition: resource.h:40
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:639
WORD ATOM
Definition: dimm.idl:113
static HICON
Definition: imagelist.c:80
HINSTANCE hInstance
Definition: winuser.h:3209
HCURSOR hCursor
Definition: winuser.h:3211
LPCSTR lpszMenuName
Definition: winuser.h:3213
HICON hIconSm
Definition: winuser.h:3215
UINT cbSize
Definition: winuser.h:3204
WNDPROC lpfnWndProc
Definition: winuser.h:3206
LPCSTR lpszClassName
Definition: winuser.h:3214
HICON hIcon
Definition: winuser.h:3210
HBRUSH hbrBackground
Definition: winuser.h:3212
#define IMAGE_ICON
Definition: winuser.h:212
#define IDC_ARROW
Definition: winuser.h:687
#define RegisterClassEx
Definition: winuser.h:5849
#define LoadIcon
Definition: winuser.h:5825
#define LoadCursor
Definition: winuser.h:5824
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5731
#define LR_SHARED
Definition: winuser.h:1103
#define LoadImage
Definition: winuser.h:5827
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define COLOR_BTNFACE
Definition: winuser.h:931

◆ InitMainWnd()

static VOID InitMainWnd ( PMAIN_WND_INFO  Info)
static

Definition at line 108 of file mainwnd.c.

109{
111 INT statwidths[] = {110, -1};
112
113 /* FIXME - create controls and initialize the application */
114
115 /* create the status bar */
116 Info->hStatus = CreateWindowEx(0,
118 NULL,
120 0,
121 0,
122 0,
123 0,
124 Info->hSelf,
126 hInstance,
127 NULL);
128
129 if (Info->hStatus != NULL)
130 SendMessage(Info->hStatus,
132 sizeof(statwidths)/sizeof(int),
133 (LPARAM)statwidths);
134
135 /* create the MDI client window */
136 ccs.hWindowMenu = GetSubMenu(GetMenu(Info->hSelf),
140 TEXT("MDICLIENT"),
141 NULL,
143 0,
144 0,
145 0,
146 0,
147 Info->hSelf,
148 NULL,
149 hInstance,
150 &ccs);
151
153
154 /* initialize file open/save structure */
155 FileInitialize(Info->hSelf);
156}
VOID FileInitialize(IN HWND hwnd)
Definition: opensave.c:13
#define IDC_STATUSBAR
Definition: resource.h:12
#define TEXT(s)
Definition: k32.h:26
#define ID_MDI_FIRSTCHILD
Definition: precomp.h:97
#define ID_MDI_WINDOWMENU
Definition: mainwnd.c:6
static VOID CreateToolbars(PMAIN_WND_INFO Info)
Definition: mainwnd.c:43
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_EX_ACCEPTFILES
Definition: pedump.c:648
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_HSCROLL
Definition: pedump.c:628
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2251
#define SB_SETPARTS
Definition: commctrl.h:1959
#define SBARS_SIZEGRIP
Definition: commctrl.h:1928
#define STATUSCLASSNAME
Definition: commctrl.h:1944
int32_t INT
Definition: typedefs.h:58
LONG_PTR LPARAM
Definition: windef.h:208
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define SendMessage
Definition: winuser.h:5855
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
HMENU WINAPI GetMenu(_In_ HWND)

◆ MainWndCommand()

static VOID MainWndCommand ( PMAIN_WND_INFO  Info,
WORD  CmdId,
HWND  hControl 
)
static

Definition at line 159 of file mainwnd.c.

162{
163 static TCHAR szFileName[MAX_PATH];
164 static TCHAR szDocumentName[MAX_PATH];
165
166 UNREFERENCED_PARAMETER(hControl);
167
168 switch (CmdId)
169 {
170 case ID_NEW:
171 {
172 OPEN_EDIT_INFO OpenInfo;
173 INT Ret;
174
175 OpenInfo.CreateNew = TRUE;
176
179 &OpenInfo.lpDocumentName,
180 ++Info->ImagesCreated);
181
182 Ret = DialogBox(hInstance,
184 Info->hSelf,
186 if (Ret != -1)
187 {
188 OpenInfo.DocType = Ret;
189
191 &OpenInfo);
192 }
193
194 }
195 break;
196
197 case ID_BOLD:
198 MessageBox(NULL, _T("Bingo"), NULL, 0);
199 break;
200
201 case ID_OPEN:
202 {
203 OPEN_EDIT_INFO OpenInfo;
204
205 if (DoOpenFile(Info->hSelf,
206 szFileName, /* full file path */
207 szDocumentName)) /* file name */
208 {
209 OpenInfo.CreateNew = FALSE;
210
211 OpenInfo.lpDocumentPath = szFileName;
212 OpenInfo.lpDocumentName = szDocumentName;
213
215 &OpenInfo);
216 }
217
218 }
219 break;
220
221 case ID_EXIT:
222 SendMessage(Info->hSelf,
223 WM_CLOSE,
224 0,
225 0);
226 break;
227
228 /* Window Menu */
230 SendMessage(Info->hMdiClient,
233 0);
234 break;
235
237 SendMessage(Info->hMdiClient,
240 0);
241 break;
242
244 SendMessage(Info->hMdiClient,
246 0,
247 0);
248 break;
249
251 SendMessage(Info->hMdiClient,
253 0,
254 0);
255 break;
256
257 case ID_WINDOW_NEXT:
258 SendMessage(Info->hMdiClient,
260 0,
261 0);
262 break;
263
264 /* Help Menu */
265 case ID_ABOUT:
268 Info->hSelf,
270 break;
271 }
272}
static INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: about.c:15
#define IDD_ABOUTBOX
Definition: resource.h:8
#define ID_EXIT
Definition: resource.h:10
DWORD LoadAndFormatString(IN HINSTANCE hInstance, IN UINT uID, OUT LPTSTR *lpTarget,...)
Definition: misc.c:85
#define ID_ABOUT
Definition: charmap.c:17
static VOID DoOpenFile(PINFO pInfo)
Definition: connectdialog.c:34
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
BOOL CreateEditWindow(struct _MAIN_WND_INFO *MainWnd, POPEN_EDIT_INFO OpenInfo)
Definition: editwnd.c:132
#define ID_WINDOW_ARRANGE
Definition: resource.h:52
#define ID_WINDOW_NEXT
Definition: resource.h:51
#define ID_WINDOW_TILE_VERT
Definition: resource.h:49
#define ID_WINDOW_TILE_HORZ
Definition: resource.h:48
#define ID_WINDOW_CASCADE
Definition: resource.h:50
#define ID_NEW
Definition: resource.h:10
INT_PTR CALLBACK NewDocSelDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: dialogs.c:4
#define ID_BOLD
Definition: resource.h:30
#define ID_OPEN
Definition: resource.h:14
#define IDD_NEWDOCSEL
Definition: resource.h:92
#define IDS_DEFAULT_NAME
Definition: resource.h:8
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
UINT DocType
Definition: precomp.h:49
BOOL CreateNew
Definition: precomp.h:46
LPTSTR lpDocumentPath
Definition: precomp.h:50
LPTSTR lpDocumentName
Definition: precomp.h:52
#define _T(x)
Definition: vfdio.h:22
#define WM_MDITILE
Definition: winuser.h:1821
#define WM_CLOSE
Definition: winuser.h:1624
#define WM_MDICASCADE
Definition: winuser.h:1822
#define WM_MDINEXT
Definition: winuser.h:1819
#define WM_MDIICONARRANGE
Definition: winuser.h:1823
#define MessageBox
Definition: winuser.h:5834
#define MDITILE_HORIZONTAL
Definition: winuser.h:2191
#define MDITILE_VERTICAL
Definition: winuser.h:2192
#define DialogBox
Definition: winuser.h:5773
char TCHAR
Definition: xmlstorage.h:189

◆ MainWndGetCurrentEditor()

MDI_EDITOR_TYPE MainWndGetCurrentEditor ( PMAIN_WND_INFO  MainWnd,
PVOID Info 
)

Definition at line 502 of file mainwnd.c.

504{
505 MDI_EDITOR_TYPE EditorType;
506
507 if (MainWnd->ActiveEditor != NULL)
508 {
509 EditorType = *((PMDI_EDITOR_TYPE)MainWnd->ActiveEditor);
510 *Info = MainWnd->ActiveEditor;
511 }
512 else
513 {
514 EditorType = metUnknown;
515 *Info = NULL;
516 }
517
518 return EditorType;
519}
enum _MDI_EDITOR_TYPE MDI_EDITOR_TYPE
@ metUnknown
Definition: precomp.h:33
enum _MDI_EDITOR_TYPE * PMDI_EDITOR_TYPE
PVOID ActiveEditor
Definition: precomp.h:99

◆ MainWndMenuHint()

static BOOL MainWndMenuHint ( PMAIN_WND_INFO  Info,
WORD  CmdId,
const MENU_HINT HintArray,
DWORD  HintsCount,
UINT  DefHintId 
)
static

Definition at line 294 of file mainwnd.c.

299{
300 BOOL Found = FALSE;
301 const MENU_HINT *LastHint;
302 UINT HintId = DefHintId;
303
304 LastHint = HintArray + HintsCount;
305 while (HintArray != LastHint)
306 {
307 if (HintArray->CmdId == CmdId)
308 {
309 HintId = HintArray->HintId;
310 Found = TRUE;
311 break;
312 }
313 HintArray++;
314 }
315
316 StatusBarLoadString(Info->hStatus,
318 hInstance,
319 HintId);
320
321 return Found;
322}
BOOL StatusBarLoadString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID)
Definition: misc.c:150
return Found
Definition: dirsup.c:1270
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SB_SIMPLEID
Definition: precomp.h:15
unsigned int UINT
Definition: ndis.h:50
UINT HintId
Definition: precomp.h:90
WORD CmdId
Definition: precomp.h:89

◆ MainWndProc()

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

Definition at line 325 of file mainwnd.c.

329{
331 LRESULT Ret = 0;
332 static RECT wndOldPos;
333
334 /* Get the window context */
337 if (Info == NULL && uMsg != WM_CREATE)
338 {
339 goto HandleDefaultMessage;
340 }
341
342 switch (uMsg)
343 {
344 case WM_CREATE:
345 {
346 Info = (PMAIN_WND_INFO)(((LPCREATESTRUCT)lParam)->lpCreateParams);
347
348 /* Initialize the main window context */
349 Info->hSelf = hwnd;
350
353 (LONG_PTR)Info);
354
356
357 /* Show the window */
359 Info->nCmdShow);
360 /* get the windows position */
362 &wndOldPos);
363
364 break;
365 }
366
367 case WM_SIZE:
368 {
370 LOWORD(lParam),
371 HIWORD(lParam));
372 /* NOTE - do *not* forward this message to DefFrameProc! Otherwise the MDI client
373 will attempt to resize itself */
374
375 break;
376 }
377
378 case WM_MOVE:
379 {
380
381 }
382 break;
383
384 case WM_NOTIFY:
385 {
386
387 /* FIXME - handle other notifications */
388 break;
389 }
390
391 case WM_COMMAND:
392 {
394 LOWORD(wParam),
395 (HWND)lParam);
396 goto HandleDefaultMessage;
397 }
398
399 case WM_MENUSELECT:
400 {
401 if (Info->hStatus != NULL)
402 {
404 LOWORD(wParam),
406 sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
408 {
410 LOWORD(wParam),
412 sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
414 }
415 }
416 break;
417 }
418
419 case WM_ENTERMENULOOP:
420 {
421 Info->InMenuLoop = TRUE;
423 break;
424 }
425
426 case WM_EXITMENULOOP:
427 {
428 Info->InMenuLoop = FALSE;
430 break;
431 }
432
433 case WM_CLOSE:
434 {
436 break;
437 }
438
439 case WM_ENABLE:
440 {
441
442 goto HandleDefaultMessage;
443 }
444
445 case WM_NCACTIVATE:
446 {
447
448 goto HandleDefaultMessage;
449 }
450
451 case WM_ACTIVATEAPP:
452 {
453
454 goto HandleDefaultMessage;
455 }
456
457 case WM_DESTROY:
458 {
460
461 /* FIXME: set the windows position in registry*/
462 //wndOldPos
463
465 0,
466 Info);
469 0);
470
471 /* Break the message queue loop */
473 break;
474 }
475
476 default:
477 {
478HandleDefaultMessage:
479 if (Info != NULL && Info->hMdiClient != NULL)
480 {
481 Ret = DefFrameProc(hwnd,
482 Info->hMdiClient,
483 uMsg,
484 wParam,
485 lParam);
486 }
487 else
488 {
489 Ret = DefWindowProc(hwnd,
490 uMsg,
491 wParam,
492 lParam);
493 }
494 break;
495 }
496 }
497
498 return Ret;
499}
static BOOL InitMainWnd(PMAIN_WND_INFO Info)
Definition: mainwnd.c:334
static BOOL MainWndMenuHint(PMAIN_WND_INFO Info, WORD CmdId, const MENU_HINT *HintArray, DWORD HintsCount, UINT DefHintId)
Definition: mainwnd.c:81
static VOID CALLBACK MainWndResize(PMAIN_WND_INFO Info, WORD cx, WORD cy)
Definition: mainwnd.c:608
static const MENU_HINT SystemMenuHintTable[]
Definition: mainwnd.c:70
static VOID UpdateMainStatusBar(PMAIN_WND_INFO Info)
Definition: mainwnd.c:113
static const MENU_HINT MainMenuHintTable[]
Definition: mainwnd.c:40
static VOID MainWndCommand(PMAIN_WND_INFO Info, WORD CmdId, HWND hControl)
Definition: mainwnd.c:379
struct _MAIN_WND_INFO * PMAIN_WND_INFO
#define IDS_HINT_BLANK
Definition: resource.h:92
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static VOID DestroyMainWnd(PMAIN_WND_INFO Info)
Definition: mainwnd.c:275
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
#define DefWindowProc
Definition: ros2win.h:31
#define DefFrameProc
Definition: ros2win.h:32
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
#define HIWORD(l)
Definition: typedefs.h:247
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LRESULT
Definition: windef.h:209
#define WM_ENABLE
Definition: winuser.h:1618
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1611
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1614
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_NCACTIVATE
Definition: winuser.h:1691
#define WM_ENTERMENULOOP
Definition: winuser.h:1807
#define WM_EXITMENULOOP
Definition: winuser.h:1808
#define WM_MOVE
Definition: winuser.h:1613
#define WM_ACTIVATEAPP
Definition: winuser.h:1635
#define WM_DESTROY
Definition: winuser.h:1612
#define WM_MENUSELECT
Definition: winuser.h:1750
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ MainWndResize()

static VOID CALLBACK MainWndResize ( PVOID  Context,
WORD  cx,
WORD  cy 
)
static

Definition at line 49 of file mainwnd.c.

52{
53 RECT rcClient = {0};
54 RECT rcStatus = {0};
55 HDWP dwp;
57
58 /* Calculate the MDI client rectangle */
59 rcClient.right = cx;
60 rcClient.bottom = cy;
61
62 if (Info->hStatus != NULL)
63 {
64 GetWindowRect(Info->hStatus,
65 &rcStatus);
66 rcClient.bottom -= (rcStatus.bottom - rcStatus.top);
67 }
68
69
70 dwp = BeginDeferWindowPos(2);
71 if (dwp != NULL)
72 {
73 /* Update the MDI client */
74 if (Info->hMdiClient != NULL)
75 {
76 dwp = DeferWindowPos(dwp,
77 Info->hMdiClient,
78 NULL,
79 rcClient.left,
80 rcClient.top,
81 rcClient.right - rcClient.left,
82 rcClient.bottom - rcClient.top,
84 if (dwp == NULL)
85 return;
86 }
87
88 /* Update the status bar */
89 if (Info->hStatus != NULL)
90 {
91 dwp = DeferWindowPos(dwp,
92 Info->hStatus,
93 NULL,
94 0,
95 cy - (rcStatus.bottom - rcStatus.top),
96 cx,
97 rcStatus.bottom - rcStatus.top,
99 if (dwp == NULL)
100 return;
101 }
102
104 }
105}
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOZORDER
Definition: winuser.h:1250
HDWP WINAPI BeginDeferWindowPos(_In_ int)

◆ MainWndSwitchEditorContext()

VOID MainWndSwitchEditorContext ( PMAIN_WND_INFO  Info,
HWND  hDeactivate,
HWND  hActivate 
)

Definition at line 522 of file mainwnd.c.

525{
526 PMDI_EDITOR_TYPE EditorType;
527
528 /* FIXME - optimize light weight switching
529 when switching from and to an editor of same type */
530
531 if (hDeactivate != NULL)
532 {
533 EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hDeactivate,
535 if (EditorType != NULL)
536 {
537 switch (*EditorType)
538 {
539 case metImageEditor:
541 FALSE);
542 break;
543
544 default:
545 break;
546 }
547
548 Info->ActiveEditor = NULL;
549 }
550 }
551
552 if (hActivate != NULL)
553 {
554 EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hActivate,
556 if (EditorType != NULL)
557 {
558 Info->ActiveEditor = EditorType;
559
560 switch (*EditorType)
561 {
562 case metImageEditor:
564 TRUE);
565 break;
566
567 default:
568 break;
569 }
570 }
571 }
572}
VOID SetEditorEnvironment(PEDIT_WND_INFO Info, BOOL Setup)
Definition: editwnd.c:117
@ metImageEditor
Definition: precomp.h:34

◆ MainWndTranslateMDISysAccel()

BOOL MainWndTranslateMDISysAccel ( HWND  hwnd,
LPMSG  lpMsg 
)

Definition at line 616 of file mainwnd.c.

618{
620
621 /* Get the window context */
624 if (Info != NULL && Info->hMdiClient != NULL)
625 {
626 return TranslateMDISysAccel(Info->hMdiClient,
627 lpMsg);
628 }
629
630 return FALSE;
631}
BOOL WINAPI TranslateMDISysAccel(_In_ HWND, _In_ LPMSG)

Referenced by _tWinMain().

◆ UninitMainWindowImpl()

VOID UninitMainWindowImpl ( VOID  )

Definition at line 659 of file mainwnd.c.

660{
662 hInstance);
663}
#define UnregisterClass
Definition: winuser.h:5873

◆ UpdateMainStatusBar()

static VOID UpdateMainStatusBar ( PMAIN_WND_INFO  Info)
static

Definition at line 282 of file mainwnd.c.

283{
284 if (Info->hStatus != NULL)
285 {
286 SendMessage(Info->hStatus,
287 SB_SIMPLE,
288 (WPARAM)Info->InMenuLoop,
289 0);
290 }
291}
#define SB_SIMPLE
Definition: commctrl.h:1963
UINT_PTR WPARAM
Definition: windef.h:207

Variable Documentation

◆ MainMenuHintTable

const MENU_HINT MainMenuHintTable[]
static
Initial value:
= {
}
#define IDS_HINT_EXIT
Definition: resource.h:94
#define ID_PAGESETUP
Definition: resource.h:21
#define IDS_HINT_PAGESETUP
Definition: resource.h:57
#define IDS_HINT_NEW
Definition: resource.h:49
#define ID_PRINTPRE
Definition: resource.h:19
#define IDS_HINT_NEXT
Definition: resource.h:64
#define ID_BLANK
Definition: resource.h:36
#define IDS_HINT_ARRANGE
Definition: resource.h:63
#define IDS_HINT_PRINT
Definition: resource.h:55
#define IDS_HINT_SAVEAS
Definition: resource.h:54
#define ID_CLOSE
Definition: resource.h:15
#define IDS_HINT_TILE_VERT
Definition: resource.h:62
#define IDS_HINT_CLOSE
Definition: resource.h:51
#define ID_CLOSEALL
Definition: resource.h:16
#define ID_SAVE
Definition: resource.h:17
#define ID_SAVEAS
Definition: resource.h:18
#define IDS_HINT_SAVE
Definition: resource.h:53
#define IDS_HINT_CASCADE
Definition: resource.h:60
#define IDS_HINT_TILE_HORZ
Definition: resource.h:61
#define IDS_HINT_OPEN
Definition: resource.h:50
#define IDS_HINT_CLOSEALL
Definition: resource.h:52
#define IDS_HINT_PRINTPRE
Definition: resource.h:56
#define ID_PRINT
Definition: wordpad.h:39

Definition at line 9 of file mainwnd.c.

◆ SystemMenuHintTable

const MENU_HINT SystemMenuHintTable[]
static
Initial value:
= {
}
#define IDS_HINT_SYS_MINIMIZE
Definition: resource.h:121
#define IDS_HINT_SYS_SIZE
Definition: resource.h:120
#define IDS_HINT_SYS_RESTORE
Definition: resource.h:118
#define IDS_HINT_SYS_MOVE
Definition: resource.h:119
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:122
#define SC_SIZE
Definition: winuser.h:2587
#define SC_MINIMIZE
Definition: winuser.h:2589
#define SC_NEXTWINDOW
Definition: winuser.h:2593
#define SC_CLOSE
Definition: winuser.h:2595
#define SC_MOVE
Definition: winuser.h:2588
#define SC_RESTORE
Definition: winuser.h:2601
#define SC_MAXIMIZE
Definition: winuser.h:2591

Definition at line 31 of file mainwnd.c.

◆ szMainWndClass

const TCHAR szMainWndClass[] = TEXT("WordPadMainWndClass")
static

Definition at line 3 of file mainwnd.c.