ReactOS  0.4.14-dev-77-gd9e7c48
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 920 of file mainwnd.c.

922 {
924  HWND hMainWnd = NULL;
925 
928  sizeof(MAIN_WND_INFO));
929 
930  if (Info != NULL)
931  {
932  Info->nCmdShow = nCmdShow;
933 
936  lpCaption,
940  680,
941  450,
942  NULL,
943  NULL,
944  hInstance,
945  Info);
946  if (hMainWnd == NULL)
947  {
948  //int ret;
949  //ret = GetLastError();
950  GetError();
952  0,
953  Info);
954  }
955  }
956 
957  return hMainWnd;
958 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:14
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define WS_CLIPCHILDREN
Definition: pedump.c:619
struct TraceInfo Info
VOID GetError(VOID)
Definition: misc.c:192
#define CreateWindowEx
Definition: winuser.h:5656
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
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 HEAP_ZERO_MEMORY
Definition: compat.h:123
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ InitMainWindowImpl()

BOOL InitMainWindowImpl ( VOID  )

Definition at line 961 of file mainwnd.c.

962 {
963  WNDCLASSEX wc = {0};
964 
965  wc.cbSize = sizeof(WNDCLASSEX);
967  wc.hInstance = hInstance;
968  wc.hIcon = LoadIcon(hInstance,
970  wc.hCursor = LoadCursor(NULL,
971  IDC_ARROW);
972  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
977  IMAGE_ICON,
978  16,
979  16,
980  LR_SHARED);
981 
982  return RegisterClassEx(&wc) != (ATOM)0;
983 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:14
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDR_MAINMENU
Definition: resource.h:40
static HICON
Definition: imagelist.c:84
LPCSTR lpszMenuName
Definition: winuser.h:3184
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
#define RegisterClassEx
Definition: winuser.h:5738
HCURSOR hCursor
Definition: winuser.h:3182
WNDPROC lpfnWndProc
Definition: winuser.h:3177
LPCSTR lpszClassName
Definition: winuser.h:3185
WORD ATOM
Definition: dimm.idl:113
HICON hIconSm
Definition: winuser.h:3186
HINSTANCE hInstance
Definition: winuser.h:3180
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3175
HBRUSH hbrBackground
Definition: winuser.h:3183
HICON hIcon
Definition: winuser.h:3181
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:636
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5713
HINSTANCE hInstance
Definition: mainwnd.c:15
#define IDI_SM_ICON
Definition: resource.h:66
#define IDC_ARROW
Definition: winuser.h:682
#define LoadImage
Definition: winuser.h:5716
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5620
#define LoadIcon
Definition: winuser.h:5714

◆ 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
struct TraceInfo Info
smooth NULL
Definition: ftsmooth.c:416
enum _MDI_EDITOR_TYPE MDI_EDITOR_TYPE
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
struct TraceInfo Info
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
#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
struct TraceInfo Info
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
struct _MAIN_WND_INFO * PMAIN_WND_INFO
#define GetWindowLongPtr
Definition: treelist.c:73
BOOL WINAPI TranslateMDISysAccel(_In_ HWND, _In_ LPMSG)

◆ UninitMainWindowImpl()

VOID UninitMainWindowImpl ( VOID  )

Definition at line 987 of file mainwnd.c.

988 {
990  hInstance);
991 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:14
HINSTANCE hInstance
Definition: mainwnd.c:15
#define UnregisterClass
Definition: winuser.h:5762