ReactOS  0.4.14-dev-614-gbfd8a84
precomp.h File Reference
#include <windows.h>
#include <windowsx.h>
#include <stdio.h>
#include <tchar.h>
#include <richedit.h>
#include <commctrl.h>
#include "resource.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.

Classes

struct  _OPEN_EDIT_INFO
 
struct  _EDIT_WND_INFO
 
struct  _MENU_HINT
 
struct  _MAIN_WND_INFO
 

Macros

#define SB_SIMPLEID   0xFF
 
#define MAX_KEY_LENGTH   256
 
#define DOC_TYPE_RICH_TEXT   0
 
#define DOC_TYPE_UNICODE_TEXT   1
 
#define DOC_TYPE_TEXT   2
 

Typedefs

typedef enum _MDI_EDITOR_TYPE MDI_EDITOR_TYPE
 
typedef enum _MDI_EDITOR_TYPEPMDI_EDITOR_TYPE
 
typedef struct _OPEN_EDIT_INFO OPEN_EDIT_INFO
 
typedef struct _OPEN_EDIT_INFOPOPEN_EDIT_INFO
 
typedef struct _EDIT_WND_INFO EDIT_WND_INFO
 
typedef struct _EDIT_WND_INFOPEDIT_WND_INFO
 
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
 

Enumerations

enum  _MDI_EDITOR_TYPE { metUnknown = 0, metImageEditor, metUnknown = 0, metImageEditor }
 

Functions

BOOL InitEditWindowImpl (VOID)
 
VOID UninitEditWindowImpl (VOID)
 
BOOL CreateEditWindow (struct _MAIN_WND_INFO *MainWnd, POPEN_EDIT_INFO OpenInfo)
 
VOID SetEditorEnvironment (PEDIT_WND_INFO Info, BOOL Setup)
 
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)
 
INT AllocAndLoadString (OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
 
DWORD LoadAndFormatString (IN HINSTANCE hInstance, IN UINT uID, OUT LPTSTR *lpTarget,...)
 
BOOL StatusBarLoadAndFormatString (IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID,...)
 
BOOL StatusBarLoadString (IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID)
 
INT GetTextFromEdit (OUT LPTSTR lpString, IN HWND hDlg, IN UINT Res)
 
VOID GetError (DWORD err)
 
VOID FileInitialize (HWND hwnd)
 
BOOL DoOpenFile (HWND hwnd, LPTSTR lpFileName, LPTSTR lpName)
 
BOOL DoSaveFile (HWND hwnd)
 
INT_PTR CALLBACK AboutDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK NewDocSelDlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 

Variables

HINSTANCE hInstance
 
HANDLE ProcessHeap
 

Macro Definition Documentation

◆ DOC_TYPE_RICH_TEXT

#define DOC_TYPE_RICH_TEXT   0

Definition at line 20 of file precomp.h.

◆ DOC_TYPE_TEXT

#define DOC_TYPE_TEXT   2

Definition at line 22 of file precomp.h.

◆ DOC_TYPE_UNICODE_TEXT

#define DOC_TYPE_UNICODE_TEXT   1

Definition at line 21 of file precomp.h.

◆ MAX_KEY_LENGTH

#define MAX_KEY_LENGTH   256

Definition at line 18 of file precomp.h.

◆ SB_SIMPLEID

#define SB_SIMPLEID   0xFF

Definition at line 15 of file precomp.h.

Typedef Documentation

◆ EDIT_WND_INFO

◆ MAIN_WND_INFO

◆ MDI_EDITOR_TYPE

◆ MENU_HINT

◆ OPEN_EDIT_INFO

◆ PEDIT_WND_INFO

◆ PMAIN_WND_INFO

◆ PMDI_EDITOR_TYPE

◆ PMENU_HINT

◆ POPEN_EDIT_INFO

Enumeration Type Documentation

◆ _MDI_EDITOR_TYPE

Enumerator
metUnknown 
metImageEditor 
metUnknown 
metImageEditor 

Definition at line 32 of file precomp.h.

32  {
33  metUnknown = 0,
enum _MDI_EDITOR_TYPE * PMDI_EDITOR_TYPE
enum _MDI_EDITOR_TYPE MDI_EDITOR_TYPE

Function Documentation

◆ AboutDialogProc()

INT_PTR CALLBACK AboutDialogProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 13 of file about.c.

14 {
15  switch (message)
16  {
17  case WM_INITDIALOG:
18  {
19  HWND hLicenseEditWnd;
20 
21  hLicenseEditWnd = GetDlgItem(hDlg,
23  if (hLicenseEditWnd)
24  {
25  LPWSTR lpString;
26 
27  if (AllocAndLoadString(&lpString,
28  hInstance,
29  IDS_LICENSE))
30  {
31  SetWindowTextW(hLicenseEditWnd,
32  lpString);
33 
34  LocalFree(lpString);
35  }
36  }
37 
38  return TRUE;
39  }
40 
41  case WM_COMMAND:
42 
43  if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
44  {
45  EndDialog(hDlg,
46  LOWORD(wParam));
47  return TRUE;
48  }
49 
50  break;
51  }
52 
53  return FALSE;
54 }
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
HINSTANCE hInstance
Definition: charmap.c:20
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
#define IDS_LICENSE
Definition: resource.h:28
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_LICENSE_EDIT
Definition: resource.h:20

◆ AllocAndLoadString()

INT AllocAndLoadString ( OUT LPTSTR lpTarget,
IN HINSTANCE  hInst,
IN UINT  uID 
)

Definition at line 40 of file misc.c.

43 {
44  INT ln;
45 
47  uID);
48  if (ln++ > 0)
49  {
50  (*lpTarget) = (LPTSTR)LocalAlloc(LMEM_FIXED,
51  ln * sizeof(TCHAR));
52  if ((*lpTarget) != NULL)
53  {
54  INT Ret;
55  if (!(Ret = LoadString(hInst, uID, *lpTarget, ln)))
56  {
57  LocalFree((HLOCAL)(*lpTarget));
58  }
59  return Ret;
60  }
61  }
62  return 0;
63 }
int32_t INT
Definition: typedefs.h:56
CHAR * LPTSTR
Definition: xmlstorage.h:192
smooth NULL
Definition: ftsmooth.c:416
#define LMEM_FIXED
Definition: winbase.h:349
char TCHAR
Definition: xmlstorage.h:189
HINSTANCE hInst
Definition: dxdiag.c:13
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
INT LengthOfStrResource(IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:23
#define LoadString
Definition: winuser.h:5794

◆ CreateEditWindow()

BOOL CreateEditWindow ( struct _MAIN_WND_INFO MainWnd,
POPEN_EDIT_INFO  OpenInfo 
)

Definition at line 132 of file editwnd.c.

134 {
136  HWND hWndEditor;
137 
139  0,
140  sizeof(EDIT_WND_INFO));
141  if (Info != NULL)
142  {
144  sizeof(EDIT_WND_INFO));
145  Info->MainWnd = MainWnd;
146  Info->MdiEditorType = metImageEditor;
147  Info->OpenInfo = OpenInfo;
148 
149  hWndEditor = CreateMDIWindow(szEditWndClass,
150  OpenInfo->lpDocumentName,
151  WS_MAXIMIZE,
156  MainWnd->hMdiClient,
157  hInstance,
158  (LPARAM)Info);
159 
160  if (hWndEditor != NULL)
161  return TRUE;
162 
163 
165  0,
166  Info);
167  }
168 
169  return FALSE;
170 }
#define TRUE
Definition: types.h:120
#define ZeroMemory
Definition: winbase.h:1642
struct TraceInfo Info
LPTSTR lpDocumentName
Definition: precomp.h:52
HINSTANCE hInstance
Definition: charmap.c:20
HWND hMdiClient
Definition: precomp.h:43
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CreateMDIWindow
Definition: winuser.h:5728
HANDLE ProcessHeap
Definition: servman.c:15
static const TCHAR szEditWndClass[]
Definition: editwnd.c:3
#define HeapFree(x, y, z)
Definition: compat.h:402
#define WS_MAXIMIZE
Definition: pedump.c:623

Referenced by MainWndCommand().

◆ 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:5730
#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:402

Referenced by _tWinMain(), and wWinMain().

◆ DoOpenFile()

BOOL DoOpenFile ( HWND  hwnd,
LPTSTR  lpFileName,
LPTSTR  lpName 
)

Definition at line 27 of file opensave.c.

30 {
31  DWORD err;
32  /*static TCHAR Filter[] = _T("All image files (*.gif,*.bmp,*.jpg,*.jpeg,*.tif,*.png)\0*.gif,*.bmp,*.jpg,*.jpeg,*.tif,*.png\0") \
33  _T("All files (*.*)\0*.*\0") \
34  _T("Graphics Interchange format (*gif)\0*.gif\0") \
35  _T("Windows Bitmap (*bmp)\0*.bmp\0") \
36  _T("JPEG File Interchange Format (*jpg,*.jpeg)\0*.jpg,*.jpeg\0") \
37  _T("TAG Image File Format (*tif)\0*.tif\0") \
38  _T("Portable Network Graphics (*png)\0*.png\0\0");*/
39 
40  static TCHAR Filter[] = _T("Windows Bitmap (*.bmp)\0*.bmp\0");
41 
43  ofn.lpstrFile = szFileName;
44  ofn.lpstrFileTitle = szTitleName;
46 
47  if (GetOpenFileName(&ofn))
48  {
49  return TRUE;
50  }
51 
53 
54  if (err != CDERR_GENERALCODES)
55  MessageBox(NULL, _T("Open file failed"), NULL, 0);
56 
57  return FALSE;
58 }
#define CDERR_GENERALCODES
Definition: cderr.h:5
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define OFN_EXPLORER
Definition: commdlg.h:104
#define TRUE
Definition: types.h:120
LPSTR lpstrFileTitle
Definition: commdlg.h:338
#define GetOpenFileName
Definition: commdlg.h:665
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
static OPENFILENAME ofn
Definition: opensave.c:3
unsigned long DWORD
Definition: ntddk_ex.h:95
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define MessageBox
Definition: winuser.h:5797
#define err(...)
LPSTR lpstrFile
Definition: commdlg.h:336
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD WINAPI CommDlgExtendedError(void)
Definition: cdlg32.c:139
DWORD Flags
Definition: commdlg.h:342

◆ DoSaveFile()

BOOL DoSaveFile ( HWND  hwnd)

Definition at line 63 of file opensave.c.

64 {
65  TCHAR szFileName[MAX_PATH] = _T("");
66  static TCHAR Filter[] = _T("Graphics Interchange format (*gif)\0*.gif\0") \
67  _T("Windows Bitmap (*bmp)\0*.bmp\0") \
68  _T("JPEG File Interchange Format (*jpg,*.jpeg)\0*.jpg,*.jpeg\0") \
69  _T("TAG Image File Format (*tif)\0*.tif\0") \
70  _T("Portable Network Graphics (*png)\0*.png\0\0");
71 
73  ofn.lpstrFile = szFileName;
75 
76  if (GetSaveFileName(&ofn))
77  {
78  if (DoWriteFile(szFileName))
79  return TRUE;
80  }
81 
83  MessageBox(NULL, _T("Save to file failed"), NULL, 0);
84 
85  return FALSE;
86 }
#define CDERR_GENERALCODES
Definition: cderr.h:5
#define OFN_EXPLORER
Definition: commdlg.h:104
#define TRUE
Definition: types.h:120
#define GetSaveFileName
Definition: commdlg.h:666
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
smooth NULL
Definition: ftsmooth.c:416
static BOOL DoWriteFile(LPCTSTR pszFileName)
Definition: opensave.c:20
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
static OPENFILENAME ofn
Definition: opensave.c:3
#define MAX_PATH
Definition: compat.h:26
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define MessageBox
Definition: winuser.h:5797
LPSTR lpstrFile
Definition: commdlg.h:336
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD WINAPI CommDlgExtendedError(void)
Definition: cdlg32.c:139
DWORD Flags
Definition: commdlg.h:342

◆ FileInitialize()

VOID FileInitialize ( HWND  hwnd)

Definition at line 8 of file opensave.c.

9 {
10  ZeroMemory(&ofn, sizeof(ofn));
11  ofn.lStructSize = sizeof(OPENFILENAME);
12  ofn.hwndOwner = hwnd;
15  ofn.lpstrDefExt = _T("bmp");
16 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND hwndOwner
Definition: commdlg.h:330
#define ZeroMemory
Definition: winbase.h:1642
LPCSTR lpstrDefExt
Definition: commdlg.h:345
DWORD nMaxFile
Definition: commdlg.h:337
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
#define _T(x)
Definition: vfdio.h:22
static OPENFILENAME ofn
Definition: opensave.c:3
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
DWORD nMaxFileTitle
Definition: commdlg.h:339

◆ GetError()

VOID GetError ( DWORD  err)

Definition at line 183 of file misc.c.

184 {
185  LPVOID lpMsgBuf;
186 
187  if (err == 0)
188  err = GetLastError();
189 
193  NULL,
194  err,
196  (LPTSTR) &lpMsgBuf,
197  0,
198  NULL );
199 
200  MessageBox(NULL, lpMsgBuf, _T("Error!"), MB_OK | MB_ICONERROR);
201 
202  LocalFree(lpMsgBuf);
203 }
#define LANG_NEUTRAL
Definition: nls.h:22
#define SUBLANG_DEFAULT
Definition: nls.h:168
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
#define _T(x)
Definition: vfdio.h:22
#define FormatMessage
Definition: winbase.h:3629
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
#define err(...)
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define MB_OK
Definition: winuser.h:784
#define MAKELANGID(p, s)
Definition: nls.h:15

◆ GetTextFromEdit()

INT GetTextFromEdit ( OUT LPTSTR  lpString,
IN HWND  hDlg,
IN UINT  Res 
)

Definition at line 164 of file misc.c.

167 {
168  INT len = GetWindowTextLength(GetDlgItem(hDlg, Res));
169  if(len > 0)
170  {
171  GetDlgItemText(hDlg,
172  Res,
173  lpString,
174  len + 1);
175  }
176  else
177  lpString = NULL;
178 
179  return len;
180 }
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
#define GetDlgItemText
Definition: winuser.h:5760
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
GLenum GLsizei len
Definition: glext.h:6722
#define GetWindowTextLength
Definition: winuser.h:5774

◆ InitEditWindowImpl()

BOOL InitEditWindowImpl ( VOID  )

Definition at line 173 of file editwnd.c.

174 {
175  WNDCLASSEX wc = {0};
176 
177  wc.cbSize = sizeof(WNDCLASSEX);
179  wc.hInstance = hInstance;
180  wc.hIcon = LoadIcon(hInstance,
182  wc.hCursor = LoadCursor(NULL,
183  IDC_ARROW);
184  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
185  wc.lpszMenuName = NULL;
189  IMAGE_ICON,
190  16,
191  16,
192  LR_SHARED);
193 
194  return RegisterClassEx(&wc) != (ATOM)0;
195 }
#define IDI_ICON
Definition: resource.h:5
#define MAKEINTRESOURCE
Definition: winuser.h:591
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: charmap.c:20
HINSTANCE hInstance
Definition: winuser.h:3181
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3176
HBRUSH hbrBackground
Definition: winuser.h:3184
HICON hIcon
Definition: winuser.h:3182
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5787
static const TCHAR szEditWndClass[]
Definition: editwnd.c:3
#define IDC_ARROW
Definition: winuser.h:682
static LRESULT CALLBACK EditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: editwnd.c:50
#define LoadImage
Definition: winuser.h:5790
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5694
#define LoadIcon
Definition: winuser.h:5788

Referenced by _tWinMain().

◆ 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: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
smooth NULL
Definition: ftsmooth.c:416
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:636
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5787
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:5790
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5694
#define LoadIcon
Definition: winuser.h:5788

Referenced by _tWinMain(), and wWinMain().

◆ 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

Referenced by CreateFontWindow(), CreateNewConsoleTitle(), EditSecurity(), FontWndProc(), GetDisplayStringFromSidRequestResult(), GetPrincipalAccountNameString(), MainWndCommand(), and UpdateControlStates().

◆ 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

Referenced by ImageEditWndProc().

◆ 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)

Referenced by _tWinMain().

◆ NewDocSelDlgProc()

INT_PTR CALLBACK NewDocSelDlgProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 4 of file dialogs.c.

8 {
9  switch (message)
10  {
11  static HWND hList;
12 
13  case WM_INITDIALOG:
14  {
15  LPTSTR lpDocType;
16  INT i;
17 
18  hList = GetDlgItem(hDlg,
19  IDC_LIST);
20 
22  {
23  if (AllocAndLoadString(&lpDocType,
24  hInstance,
25  i))
26  {
28  lpDocType);
29  LocalFree((HLOCAL)lpDocType);
30  }
31  }
32 
35  0,
36  0);
37 
38  return TRUE;
39  }
40 
41  case WM_COMMAND:
42  {
43  INT LbSel;
44 
45  if (HIWORD(wParam) == LBN_DBLCLK)
46  {
47  LbSel = (INT)SendMessage(hList,
49  0,
50  0);
51  EndDialog(hDlg,
52  LbSel);
53  return TRUE;
54  }
55 
56  switch (LOWORD(wParam))
57  {
58  case IDOK:
59  LbSel = (INT)SendMessage(hList,
61  0,
62  0);
63  EndDialog(hDlg,
64  LbSel);
65  return TRUE;
66 
67  case IDCANCEL:
68  EndDialog(hDlg, -1);
69  return TRUE;
70  }
71  }
72  }
73 
74  return FALSE;
75 }
#define LB_SETCURSEL
Definition: winuser.h:2045
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define IDS_DOC_TYPE_RICH_TEXT
Definition: resource.h:94
#define INT
Definition: polytest.cpp:20
#define ListBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:447
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
CHAR * LPTSTR
Definition: xmlstorage.h:192
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
HINSTANCE hInstance
Definition: charmap.c:20
#define IDS_DOC_TYPE_TEXT
Definition: resource.h:96
#define IDC_LIST
Definition: resource.h:93
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LBN_DBLCLK
Definition: winuser.h:2053
#define WM_COMMAND
Definition: winuser.h:1722
HWND hList
Definition: livecd.c:10
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define LB_GETCURSEL
Definition: winuser.h:2021
#define SendMessage
Definition: winuser.h:5818
#define HIWORD(l)
Definition: typedefs.h:246
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82

Referenced by MainWndCommand().

◆ SetEditorEnvironment()

VOID SetEditorEnvironment ( PEDIT_WND_INFO  Info,
BOOL  Setup 
)

Definition at line 117 of file editwnd.c.

119 {
120  if (Setup)
121  {
122  /* FIXME - setup editor environment (e.g. show toolbars, enable menus etc) */
123  }
124  else
125  {
126  /* FIXME - cleanup editor environment (e.g. hide toolbars, disable menus etc) */
127  }
128 }
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:828

Referenced by MainWndSwitchEditorContext().

◆ StatusBarLoadAndFormatString()

BOOL StatusBarLoadAndFormatString ( IN HWND  hStatusBar,
IN INT  PartId,
IN HINSTANCE  hInstance,
IN UINT  uID,
  ... 
)

Definition at line 108 of file misc.c.

113 {
114  BOOL Ret = FALSE;
115  LPWSTR lpFormat, lpStr;
116  va_list lArgs;
117 
119  hInstance,
120  uID) > 0)
121  {
122  va_start(lArgs, uID);
123  /* let's use FormatMessage to format it because it has the ability to allocate
124  memory automatically */
126  lpFormat,
127  0,
128  0,
129  (VOID*)&lpStr,
130  0,
131  &lArgs);
132  va_end(lArgs);
133 
134  if (lpStr != NULL)
135  {
137  SB_SETTEXT,
138  (WPARAM)PartId,
139  (LPARAM)lpStr);
140  LocalFree((HLOCAL)lpStr);
141  }
142 
144  }
145 
146  return Ret;
147 }
static BOOL
Definition: misc.c:84
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:402
UINT_PTR WPARAM
Definition: windef.h:207
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
HINSTANCE hInstance
Definition: charmap.c:20
#define va_end(ap)
Definition: acmsvcex.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
char * va_list
Definition: acmsvcex.h:78
HWND hStatusBar
Definition: main.cpp:35
#define SB_SETTEXT
Definition: commctrl.h:1945
LPCWSTR lpFormat
Definition: trayclock.cpp:32
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
INT AllocAndLoadString(OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:50
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define va_start(ap, A)
Definition: acmsvcex.h:91
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ StatusBarLoadString()

BOOL StatusBarLoadString ( IN HWND  hStatusBar,
IN INT  PartId,
IN HINSTANCE  hInstance,
IN UINT  uID 
)

Definition at line 150 of file misc.c.

154 {
155  BOOL Ret = FALSE;
156  LPWSTR lpStr;
157 
158  if (AllocAndLoadString(&lpStr,
159  hInstance,
160  uID) > 0)
161  {
163  SB_SETTEXT,
164  (WPARAM)PartId,
165  (LPARAM)lpStr);
166  LocalFree((HLOCAL)lpStr);
167  }
168 
169  return Ret;
170 }
static BOOL
Definition: misc.c:84
UINT_PTR WPARAM
Definition: windef.h:207
HINSTANCE hInstance
Definition: charmap.c:20
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG_PTR LPARAM
Definition: windef.h:208
HWND hStatusBar
Definition: main.cpp:35
#define SB_SETTEXT
Definition: commctrl.h:1945
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
INT AllocAndLoadString(OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:50
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MainWndMenuHint().

◆ UninitEditWindowImpl()

VOID UninitEditWindowImpl ( VOID  )

Definition at line 198 of file editwnd.c.

199 {
201  hInstance);
202 }
HINSTANCE hInstance
Definition: charmap.c:20
static const TCHAR szEditWndClass[]
Definition: editwnd.c:3
#define UnregisterClass
Definition: winuser.h:5836

Referenced by _tWinMain().

◆ 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:5836

Referenced by _tWinMain(), and wWinMain().

Variable Documentation

◆ hInstance

HINSTANCE hInstance

Definition at line 20 of file charmap.c.

◆ ProcessHeap