ReactOS  0.4.15-dev-1377-ga59cecd
mainwnd.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _MENU_HINT
 
struct  _MAIN_WND_INFO
 

Typedefs

typedef struct _MENU_HINT MENU_HINT
 
typedef struct _MENU_HINTPMENU_HINT
 
typedef struct _MAIN_WND_INFO MAIN_WND_INFO
 
typedef struct _MAIN_WND_INFOPMAIN_WND_INFO
 

Functions

BOOL InitMainWindowImpl (VOID)
 
VOID UninitMainWindowImpl (VOID)
 
HWND CreateMainWindow (LPCTSTR lpCaption, int nCmdShow)
 
BOOL MainWndTranslateMDISysAccel (HWND hwnd, LPMSG lpMsg)
 
VOID MainWndSwitchEditorContext (PMAIN_WND_INFO Info, HWND hDeactivate, HWND hActivate)
 
MDI_EDITOR_TYPE MainWndGetCurrentEditor (PMAIN_WND_INFO MainWnd, PVOID *Info)
 

Typedef Documentation

◆ MAIN_WND_INFO

◆ MENU_HINT

◆ PMAIN_WND_INFO

◆ PMENU_HINT

Function Documentation

◆ CreateMainWindow()

HWND CreateMainWindow ( LPCTSTR  lpCaption,
int  nCmdShow 
)

Definition at line 925 of file mainwnd.c.

927 {
929  HWND hMainWnd = NULL;
930 
933  sizeof(MAIN_WND_INFO));
934 
935  if (Info != NULL)
936  {
937  Info->nCmdShow = nCmdShow;
938 
941  lpCaption,
945  680,
946  450,
947  NULL,
948  NULL,
949  hInstance,
950  Info);
951  if (hMainWnd == NULL)
952  {
953  //int ret;
954  //ret = GetLastError();
955  GetError();
957  0,
958  Info);
959  }
960  }
961 
962  return hMainWnd;
963 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:15
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#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:683
VOID GetError(VOID)
Definition: misc.c:192
#define CreateWindowEx
Definition: winuser.h:5730
#define CW_USEDEFAULT
Definition: winuser.h:225
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND hMainWnd
Definition: magnifier.c:32
HANDLE ProcessHeap
Definition: servman.c:15
HINSTANCE hInstance
Definition: mainwnd.c:15
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ InitMainWindowImpl()

BOOL InitMainWindowImpl ( VOID  )

Definition at line 966 of file mainwnd.c.

967 {
968  WNDCLASSEX wc = {0};
969 
970  wc.cbSize = sizeof(WNDCLASSEX);
972  wc.hInstance = hInstance;
973  wc.hIcon = LoadIcon(hInstance,
975  wc.hCursor = LoadCursor(NULL,
976  IDC_ARROW);
977  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
982  IMAGE_ICON,
983  16,
984  16,
985  LR_SHARED);
986 
987  return RegisterClassEx(&wc) != (ATOM)0;
988 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:15
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDR_MAINMENU
Definition: resource.h:40
static HICON
Definition: imagelist.c:84
LPCSTR lpszMenuName
Definition: winuser.h:3185
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
#define RegisterClassEx
Definition: winuser.h:5812
HCURSOR hCursor
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3178
LPCSTR lpszClassName
Definition: winuser.h:3186
WORD ATOM
Definition: dimm.idl:113
HICON hIconSm
Definition: winuser.h:3187
HINSTANCE hInstance
Definition: winuser.h:3181
UINT cbSize
Definition: winuser.h:3176
HBRUSH hbrBackground
Definition: winuser.h:3184
HICON hIcon
Definition: winuser.h:3182
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:641
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5787
HINSTANCE hInstance
Definition: mainwnd.c:15
#define NULL
Definition: types.h:112
#define IDI_SM_ICON
Definition: resource.h:64
#define IDC_ARROW
Definition: winuser.h:682
#define LoadImage
Definition: winuser.h:5790
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5694
#define LoadIcon
Definition: winuser.h:5788

◆ MainWndGetCurrentEditor()

MDI_EDITOR_TYPE MainWndGetCurrentEditor ( PMAIN_WND_INFO  MainWnd,
PVOID Info 
)

Definition at line 1293 of file mainwnd.c.

1295 {
1296  MDI_EDITOR_TYPE EditorType;
1297 
1298  if (MainWnd->ActiveEditor != NULL)
1299  {
1300  EditorType = *((PMDI_EDITOR_TYPE)MainWnd->ActiveEditor);
1301  *Info = MainWnd->ActiveEditor;
1302  }
1303  else
1304  {
1305  EditorType = metUnknown;
1306  *Info = NULL;
1307  }
1308 
1309  return EditorType;
1310 }
PVOID ActiveEditor
Definition: mainwnd.h:25
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
enum _MDI_EDITOR_TYPE MDI_EDITOR_TYPE
#define NULL
Definition: types.h:112
enum _MDI_EDITOR_TYPE * PMDI_EDITOR_TYPE

◆ MainWndSwitchEditorContext()

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

Definition at line 1313 of file mainwnd.c.

1316 {
1317  PMDI_EDITOR_TYPE EditorType;
1318 
1319  /* FIXME - optimize light weight switching
1320  when switching from and to an editor of same type */
1321 
1322  if (hDeactivate != NULL)
1323  {
1324  EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hDeactivate,
1325  GWLP_USERDATA);
1326  if (EditorType != NULL)
1327  {
1328  switch (*EditorType)
1329  {
1330  case metImageEditor:
1332  FALSE);
1333  break;
1334 
1335  default:
1336  break;
1337  }
1338 
1339  Info->ActiveEditor = NULL;
1340  }
1341  }
1342 
1343  if (hActivate != NULL)
1344  {
1345  EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hActivate,
1346  GWLP_USERDATA);
1347  if (EditorType != NULL)
1348  {
1349  Info->ActiveEditor = EditorType;
1350 
1351  switch (*EditorType)
1352  {
1353  case metImageEditor:
1355  TRUE);
1356  break;
1357 
1358  default:
1359  break;
1360  }
1361  }
1362  }
1363 }
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define FALSE
Definition: types.h:117
#define GWLP_USERDATA
Definition: treelist.c:63
#define NULL
Definition: types.h:112
#define GetWindowLongPtr
Definition: treelist.c:73
enum _MDI_EDITOR_TYPE * PMDI_EDITOR_TYPE
VOID SetImageEditorEnvironment(PEDIT_WND_INFO Info, BOOL Setup)
Definition: imgedwnd.c:445

◆ MainWndTranslateMDISysAccel()

BOOL MainWndTranslateMDISysAccel ( HWND  hwnd,
LPMSG  lpMsg 
)

Definition at line 1407 of file mainwnd.c.

1409 {
1411 
1412  /* Get the window context */
1414  GWLP_USERDATA);
1415  if (Info != NULL && Info->hMdiClient != NULL)
1416  {
1417  return TranslateMDISysAccel(Info->hMdiClient,
1418  lpMsg);
1419  }
1420 
1421  return FALSE;
1422 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define FALSE
Definition: types.h:117
#define GWLP_USERDATA
Definition: treelist.c:63
struct _MAIN_WND_INFO * PMAIN_WND_INFO
#define NULL
Definition: types.h:112
#define GetWindowLongPtr
Definition: treelist.c:73
BOOL WINAPI TranslateMDISysAccel(_In_ HWND, _In_ LPMSG)

◆ UninitMainWindowImpl()

VOID UninitMainWindowImpl ( VOID  )

Definition at line 992 of file mainwnd.c.

993 {
995  hInstance);
996 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:15
HINSTANCE hInstance
Definition: mainwnd.c:15
#define UnregisterClass
Definition: winuser.h:5836