ReactOS  0.4.14-dev-98-gb0d4763
mdi.c
Go to the documentation of this file.
1 /*
2  Thanks to theForger from winprog.org
3 */
4 #include <windows.h>
5 #include <commctrl.h>
6 
7 #include <string.h>
8 #include "resource.h"
9 
10 const char g_szClassName[] = "myWindowClass";
11 const char g_szChildClassName[] = "myMDIChildWindowClass";
12 
13 #define IDC_MAIN_MDI 101
14 #define IDC_MAIN_TOOL 102
15 #define IDC_MAIN_STATUS 103
16 
17 #define IDC_CHILD_EDIT 101
18 
19 #define ID_MDI_FIRSTCHILD 50000
20 
23 
25 {
26  HANDLE hFile;
28 
30  OPEN_EXISTING, 0, NULL);
32  {
34 
36  if(dwFileSize != 0xFFFFFFFF)
37  {
38  LPSTR pszFileText;
39 
40  pszFileText = GlobalAlloc(GPTR, dwFileSize + 1);
41  if(pszFileText != NULL)
42  {
43  DWORD dwRead;
44 
45  if(ReadFile(hFile, pszFileText, dwFileSize, &dwRead, NULL))
46  {
47  pszFileText[dwFileSize] = 0; // Add null terminator
48  if(SetWindowText(hEdit, pszFileText))
49  bSuccess = TRUE; // It worked!
50  }
51  GlobalFree(pszFileText);
52  }
53  }
55  }
56  return bSuccess;
57 }
58 
60 {
61  HANDLE hFile;
63 
67  {
68  DWORD dwTextLength;
69 
70  dwTextLength = GetWindowTextLength(hEdit);
71  // No need to bother if there's no text.
72  if(dwTextLength > 0)
73  {
74  LPSTR pszText;
75  DWORD dwBufferSize = dwTextLength + 1;
76 
77  pszText = GlobalAlloc(GPTR, dwBufferSize);
78  if(pszText != NULL)
79  {
80  if(GetWindowText(hEdit, pszText, dwBufferSize))
81  {
82  DWORD dwWritten;
83 
84  if(WriteFile(hFile, pszText, dwTextLength, &dwWritten, NULL))
85  bSuccess = TRUE;
86  }
87  GlobalFree(pszText);
88  }
89  }
91  }
92  return bSuccess;
93 }
94 
96 {
98  char szFileName[MAX_PATH] = "";
99 
100  ZeroMemory(&ofn, sizeof(ofn));
101 
102  ofn.lStructSize = sizeof(ofn);
103  ofn.hwndOwner = hwnd;
104  ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
105  ofn.lpstrFile = szFileName;
108  ofn.lpstrDefExt = "txt";
109 
110  if(GetOpenFileName(&ofn))
111  {
113  if(LoadTextFileToEdit(hEdit, szFileName))
114  {
117 
118  SetWindowText(hwnd, szFileName);
119  }
120  }
121 }
122 
124 {
126  char szFileName[MAX_PATH] = "";
127 
128  ZeroMemory(&ofn, sizeof(ofn));
129 
130  ofn.lStructSize = sizeof(ofn);
131  ofn.hwndOwner = hwnd;
132  ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
133  ofn.lpstrFile = szFileName;
135  ofn.lpstrDefExt = "txt";
137 
138  if(GetSaveFileName(&ofn))
139  {
141  if(SaveTextFileFromEdit(hEdit, szFileName))
142  {
145 
146  SetWindowText(hwnd, szFileName);
147  }
148  }
149 }
150 
152 {
154  HWND hChild;
155 
156  mcs.szTitle = "[Untitled]";
157  mcs.szClass = g_szChildClassName;
158  mcs.hOwner = GetModuleHandle(NULL);
159  mcs.x = mcs.cx = CW_USEDEFAULT;
160  mcs.y = mcs.cy = CW_USEDEFAULT;
161  mcs.style = MDIS_ALLCHILDSTYLES;
162 
164  if(!hChild)
165  {
166  MessageBox(hMDIClient, "MDI Child creation failed.", "Oh Oh...",
168  }
169  return hChild;
170 }
171 
173 {
174  switch(msg)
175  {
176  case WM_CREATE:
177  {
178  HWND hTool;
179  TBBUTTON tbb[3];
180  TBADDBITMAP tbab;
181 
182  HWND hStatus;
183  int statwidths[] = {100, -1};
184 
185  CLIENTCREATESTRUCT ccs;
186 
187  // Create MDI Client
188 
189  // Find window menu where children will be listed
190  ccs.hWindowMenu = GetSubMenu(GetMenu(hwnd), 2);
192 
197 
198  if(g_hMDIClient == NULL)
199  MessageBox(hwnd, "Could not create MDI client.", "Error", MB_OK | MB_ICONERROR);
200 
201  // Create Toolbar
202 
203  hTool = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,
205  if(hTool == NULL)
206  MessageBox(hwnd, "Could not create tool bar.", "Error", MB_OK | MB_ICONERROR);
207 
208  // Send the TB_BUTTONSTRUCTSIZE message, which is required for
209  // backward compatibility.
210  SendMessage(hTool, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
211 
212  tbab.hInst = HINST_COMMCTRL;
213  tbab.nID = IDB_STD_SMALL_COLOR;
214  SendMessage(hTool, TB_ADDBITMAP, 0, (LPARAM)&tbab);
215 
216  ZeroMemory(tbb, sizeof(tbb));
217  tbb[0].iBitmap = STD_FILENEW;
218  tbb[0].fsState = TBSTATE_ENABLED;
219  tbb[0].fsStyle = TBSTYLE_BUTTON;
220  tbb[0].idCommand = ID_FILE_NEW;
221 
222  tbb[1].iBitmap = STD_FILEOPEN;
223  tbb[1].fsState = TBSTATE_ENABLED;
224  tbb[1].fsStyle = TBSTYLE_BUTTON;
225  tbb[1].idCommand = ID_FILE_OPEN;
226 
227  tbb[2].iBitmap = STD_FILESAVE;
228  tbb[2].fsState = TBSTATE_ENABLED;
229  tbb[2].fsStyle = TBSTYLE_BUTTON;
230  tbb[2].idCommand = ID_FILE_SAVEAS;
231 
232  SendMessage(hTool, TB_ADDBUTTONS, sizeof(tbb)/sizeof(TBBUTTON), (LPARAM)&tbb);
233 
234  // Create Status bar
235 
237  WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,
239 
240  SendMessage(hStatus, SB_SETPARTS, sizeof(statwidths)/sizeof(int), (LPARAM)statwidths);
241  SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)"Hi there :)");
242  }
243  break;
244  case WM_SIZE:
245  {
246  HWND hTool;
247  RECT rcTool;
248  int iToolHeight;
249 
250  HWND hStatus;
251  RECT rcStatus;
252  int iStatusHeight;
253 
254  HWND hMDI;
255  int iMDIHeight;
256  RECT rcClient;
257 
258  // Size toolbar and get height
259 
260  hTool = GetDlgItem(hwnd, IDC_MAIN_TOOL);
261  SendMessage(hTool, TB_AUTOSIZE, 0, 0);
262 
263  GetWindowRect(hTool, &rcTool);
264  iToolHeight = rcTool.bottom - rcTool.top;
265 
266  // Size status bar and get height
267 
269  SendMessage(hStatus, WM_SIZE, 0, 0);
270 
271  GetWindowRect(hStatus, &rcStatus);
272  iStatusHeight = rcStatus.bottom - rcStatus.top;
273 
274  // Calculate remaining height and size edit
275 
276  GetClientRect(hwnd, &rcClient);
277 
278  iMDIHeight = rcClient.bottom - iToolHeight - iStatusHeight;
279 
280  hMDI = GetDlgItem(hwnd, IDC_MAIN_MDI);
281  SetWindowPos(hMDI, NULL, 0, iToolHeight, rcClient.right, iMDIHeight, SWP_NOZORDER);
282  }
283  break;
284  case WM_CLOSE:
286  break;
287  case WM_DESTROY:
288  PostQuitMessage(0);
289  break;
290  case WM_COMMAND:
291  switch(LOWORD(wParam))
292  {
293  case ID_FILE_EXIT:
294  PostMessage(hwnd, WM_CLOSE, 0, 0);
295  break;
296  case ID_FILE_NEW:
298  break;
299  case ID_FILE_OPEN:
300  {
302  if(hChild)
303  {
305  }
306  }
307  break;
308  case ID_FILE_CLOSE:
309  {
311  if(hChild)
312  {
313  SendMessage(hChild, WM_CLOSE, 0, 0);
314  }
315  }
316  break;
317  case ID_WINDOW_TILE:
319  break;
320  case ID_WINDOW_CASCADE:
322  break;
323  default:
324  {
326  {
328  }
329  else
330  {
332  if(hChild)
333  {
335  }
336  }
337  }
338  }
339  break;
340  default:
342  }
343  return 0;
344 }
345 
347 {
348  switch(msg)
349  {
350  case WM_CREATE:
351  {
352  HFONT hfDefault;
353  HWND hEdit;
354 
355  // Create Edit Control
356 
357  hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "",
359  0, 0, 100, 100, hwnd, (HMENU)IDC_CHILD_EDIT, GetModuleHandle(NULL), NULL);
360  if(hEdit == NULL)
361  MessageBox(hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR);
362 
363  hfDefault = GetStockObject(DEFAULT_GUI_FONT);
364  SendMessage(hEdit, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0));
365  }
366  break;
367  case WM_MDIACTIVATE:
368  {
369  HMENU hMenu, hFileMenu;
370  UINT EnableFlag;
371 
372  hMenu = GetMenu(g_hMainWindow);
373  if(hwnd == (HWND)lParam)
374  { //being activated, enable the menus
375  EnableFlag = MF_ENABLED;
376  }
377  else
378  { //being de-activated, gray the menus
379  EnableFlag = MF_GRAYED;
380  }
381 
382  EnableMenuItem(hMenu, 1, MF_BYPOSITION | EnableFlag);
383  EnableMenuItem(hMenu, 2, MF_BYPOSITION | EnableFlag);
384 
385  hFileMenu = GetSubMenu(hMenu, 0);
386  EnableMenuItem(hFileMenu, ID_FILE_SAVEAS, MF_BYCOMMAND | EnableFlag);
387 
388  EnableMenuItem(hFileMenu, ID_FILE_CLOSE, MF_BYCOMMAND | EnableFlag);
389  EnableMenuItem(hFileMenu, ID_FILE_CLOSEALL, MF_BYCOMMAND | EnableFlag);
390 
392  }
393  break;
394  case WM_COMMAND:
395  switch(LOWORD(wParam))
396  {
397  case ID_FILE_OPEN:
398  DoFileOpen(hwnd);
399  break;
400  case ID_FILE_SAVEAS:
401  DoFileSave(hwnd);
402  break;
403  case ID_EDIT_CUT:
405  break;
406  case ID_EDIT_COPY:
408  break;
409  case ID_EDIT_PASTE:
411  break;
412  }
413  break;
414  case WM_SIZE:
415  {
416  HWND hEdit;
417  RECT rcClient;
418 
419  // Calculate remaining height and size edit
420 
421  GetClientRect(hwnd, &rcClient);
422 
424  SetWindowPos(hEdit, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
425  }
426  return DefMDIChildProc(hwnd, msg, wParam, lParam);
427  default:
428  return DefMDIChildProc(hwnd, msg, wParam, lParam);
429 
430  }
431  return 0;
432 }
433 
435 {
436  WNDCLASSEX wc;
437 
438  wc.cbSize = sizeof(WNDCLASSEX);
439  wc.style = CS_HREDRAW | CS_VREDRAW;
441  wc.cbClsExtra = 0;
442  wc.cbWndExtra = 0;
443  wc.hInstance = hInstance;
446  wc.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
447  wc.lpszMenuName = NULL;
450 
451  if(!RegisterClassEx(&wc))
452  {
453  MessageBox(0, "Could Not Register Child Window", "Oh Oh...",
455  return FALSE;
456  }
457  else
458  return TRUE;
459 }
460 
461 
463  LPSTR lpCmdLine, int nCmdShow)
464 {
465  WNDCLASSEX wc;
466  HWND hwnd;
467  MSG Msg;
468 
470 
471  wc.cbSize = sizeof(WNDCLASSEX);
472  wc.style = 0;
473  wc.lpfnWndProc = WndProc;
474  wc.cbClsExtra = 0;
475  wc.cbWndExtra = 0;
476  wc.hInstance = hInstance;
479  wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
483 
484  if(!RegisterClassEx(&wc))
485  {
486  MessageBox(NULL, "Window Registration Failed!", "Error!",
488  return 0;
489  }
490 
492  return 0;
493 
495  0,
497  "MDI Test Application",
499  CW_USEDEFAULT, CW_USEDEFAULT, 480, 320,
500  NULL, NULL, hInstance, NULL);
501 
502  if(hwnd == NULL)
503  {
504  MessageBox(NULL, "Window Creation Failed!", "Error!",
506  return 0;
507  }
508 
510 
511  ShowWindow(hwnd, nCmdShow);
513 
514  while(GetMessage(&Msg, NULL, 0, 0) > 0)
515  {
517  {
520  }
521  }
522  return Msg.wParam;
523 }
#define IDC_MAIN_STATUS
Definition: mdi.c:15
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define OFN_EXPLORER
Definition: commdlg.h:104
BOOL LoadTextFileToEdit(HWND hEdit, LPCTSTR pszFileName)
Definition: mdi.c:24
HWND g_hMainWindow
Definition: mdi.c:22
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT style
Definition: winuser.h:3176
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDR_MAINMENU
Definition: resource.h:40
#define DispatchMessage
Definition: winuser.h:5666
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
LPCSTR lpszMenuName
Definition: winuser.h:3184
#define TRUE
Definition: types.h:120
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define CloseHandle
Definition: compat.h:398
BOOL WINAPI DrawMenuBar(_In_ HWND)
#define RegisterClassEx
Definition: winuser.h:5738
#define MF_BYCOMMAND
Definition: winuser.h:202
#define IDC_CHILD_EDIT
Definition: mdi.c:17
#define WM_CUT
Definition: winuser.h:1843
HCURSOR hCursor
Definition: winuser.h:3182
WNDPROC lpfnWndProc
Definition: winuser.h:3177
#define GPTR
Definition: winbase.h:293
HWND hwndOwner
Definition: commdlg.h:330
LPCSTR lpszClassName
Definition: winuser.h:3185
static HTREEITEM hChild
Definition: treeview.c:381
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
DWORD dwFileSize
Definition: more.c:36
#define ES_MULTILINE
Definition: pedump.c:667
#define WM_MDICASCADE
Definition: winuser.h:1801
#define ID_EDIT_COPY
Definition: resource.h:49
#define CALLBACK
Definition: compat.h:27
BOOL WINAPI UpdateWindow(_In_ HWND)
LONG top
Definition: windef.h:292
HANDLE HWND
Definition: compat.h:13
OPENFILENAME ofn
Definition: main.cpp:37
#define WM_PASTE
Definition: winuser.h:1845
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define IDB_STD_SMALL_COLOR
Definition: commctrl.h:1036
#define ZeroMemory
Definition: winbase.h:1642
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpstrDefExt
Definition: commdlg.h:345
#define ID_FILE_CLOSEALL
Definition: resource.h:13
#define ID_FILE_OPEN
Definition: resource.h:42
#define IDI_APPLICATION
Definition: winuser.h:699
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI TranslateMDISysAccel(HWND hwndClient, LPMSG msg)
Definition: mdi.c:1763
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
Definition: mdi.c:462
#define STD_FILENEW
Definition: commctrl.h:1049
HINSTANCE hInst
Definition: commctrl.h:1031
#define WS_CHILD
Definition: pedump.c:617
#define SendDlgItemMessage
Definition: winuser.h:5743
HICON hIconSm
Definition: winuser.h:3186
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BYTE fsStyle
Definition: commctrl.h:924
char * LPSTR
Definition: xmlstorage.h:182
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:293
#define STATUSCLASSNAME
Definition: commctrl.h:1911
BOOL WINAPI DestroyWindow(_In_ HWND)
#define COLOR_WINDOW
Definition: winuser.h:908
static BOOLEAN bSuccess
Definition: drive.cpp:417
#define GetOpenFileName
Definition: commdlg.h:665
WPARAM wParam
Definition: combotst.c:138
#define FILE_SHARE_READ
Definition: compat.h:125
#define DefFrameProc
Definition: ros2win.h:32
#define GetWindowText
Definition: winuser.h:5699
DWORD nMaxFile
Definition: commdlg.h:337
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
const char g_szChildClassName[]
Definition: mdi.c:11
SERVICE_STATUS_HANDLE hStatus
Definition: w32time.c:14
LRESULT CALLBACK MDIChildWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: mdi.c:346
#define GetSaveFileName
Definition: commdlg.h:666
HINSTANCE hInstance
Definition: charmap.c:20
#define COLOR_3DFACE
Definition: winuser.h:919
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HINSTANCE hInstance
Definition: winuser.h:3180
#define WM_COPY
Definition: winuser.h:1844
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TB_AUTOSIZE
Definition: commctrl.h:1109
#define MF_BYPOSITION
Definition: winuser.h:203
#define ID_FILE_EXIT
Definition: resource.h:47
#define GENERIC_WRITE
Definition: nt_native.h:90
#define ID_WINDOW_TILE
Definition: resource.h:79
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:41
#define CreateWindowEx
Definition: winuser.h:5656
#define CW_USEDEFAULT
Definition: winuser.h:225
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
UINT cbSize
Definition: winuser.h:3175
#define OPEN_EXISTING
Definition: compat.h:426
HBRUSH hbrBackground
Definition: winuser.h:3183
#define DefMDIChildProc
Definition: ros2win.h:33
#define WM_DESTROY
Definition: winuser.h:1591
int iBitmap
Definition: commctrl.h:921
#define ID_FILE_NEW
Definition: resource.h:41
#define PostMessage
Definition: winuser.h:5733
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
#define ID_WINDOW_CASCADE
Definition: resource.h:78
#define ES_AUTOVSCROLL
Definition: pedump.c:671
#define CS_VREDRAW
Definition: winuser.h:653
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SBARS_SIZEGRIP
Definition: commctrl.h:1895
#define WM_SIZE
Definition: winuser.h:1593
#define MDIS_ALLCHILDSTYLES
Definition: winuser.h:253
#define IDC_MAIN_MDI
Definition: mdi.c:13
#define MF_ENABLED
Definition: winuser.h:128
#define WM_CLOSE
Definition: winuser.h:1603
BOOL SetUpMDIChildWindowClass(HINSTANCE hInstance)
Definition: mdi.c:434
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
void DoFileSave(HWND hwnd)
Definition: mdi.c:123
int cbWndExtra
Definition: winuser.h:3179
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
#define ID_EDIT_CUT
Definition: wordpad.h:72
void DoFileOpen(HWND hwnd)
Definition: mdi.c:95
#define WS_HSCROLL
Definition: pedump.c:628
#define TB_ADDBITMAP
Definition: commctrl.h:1028
#define DEFAULT_GUI_FONT
Definition: wingdi.h:908
#define IDC_MAIN_TOOL
Definition: mdi.c:14
#define ID_FILE_SAVEAS
Definition: resource.h:44
#define WM_MDIGETACTIVE
Definition: winuser.h:1803
BOOL SaveTextFileFromEdit(HWND hEdit, LPCTSTR pszFileName)
Definition: mdi.c:59
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
HICON hIcon
Definition: winuser.h:3181
#define ID_MDI_FIRSTCHILD
Definition: mdi.c:19
#define SB_SETTEXT
Definition: commctrl.h:1921
int idCommand
Definition: commctrl.h:922
#define MB_ICONERROR
Definition: winuser.h:781
#define TB_ADDBUTTONS
Definition: commctrl.h:1243
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
struct @1580 Msg[]
static HWND hEdit
Definition: autocomplete.c:34
#define MessageBox
Definition: winuser.h:5723
#define GENERIC_READ
Definition: compat.h:124
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
const char g_szClassName[]
Definition: mdi.c:10
#define WM_COMMAND
Definition: winuser.h:1722
#define WM_MDIACTIVATE
Definition: winuser.h:1796
_In_ HANDLE hFile
Definition: mswsock.h:90
#define LoadCursor
Definition: winuser.h:5713
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define CREATE_ALWAYS
Definition: disk.h:72
int cbClsExtra
Definition: winuser.h:3178
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define GetModuleHandle
Definition: winbase.h:3651
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:904
LPSTR lpstrFile
Definition: commdlg.h:336
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define ID_FILE_CLOSE
Definition: resource.h:39
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: mdi.c:172
#define SetWindowText
Definition: winuser.h:5758
LPCSTR lpstrFilter
Definition: commdlg.h:332
unsigned int UINT
Definition: ndis.h:50
#define WS_VSCROLL
Definition: pedump.c:627
#define MB_OK
Definition: winuser.h:784
HWND g_hMDIClient
Definition: mdi.c:21
#define GetMessage
Definition: winuser.h:5691
#define SB_SETPARTS
Definition: commctrl.h:1926
#define WM_SETFONT
Definition: winuser.h:1632
#define HINST_COMMCTRL
Definition: commctrl.h:1035
#define WM_MDICREATE
Definition: winuser.h:1794
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define SendMessage
Definition: winuser.h:5744
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define WM_CREATE
Definition: winuser.h:1590
HWND CreateNewMDIChild(HWND hMDIClient)
Definition: mdi.c:151
static struct myctx * mcs
Definition: adnstest.c:53
#define STD_FILESAVE
Definition: commctrl.h:1051
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define ID_EDIT_PASTE
Definition: resource.h:50
#define GetWindowTextLength
Definition: winuser.h:5700
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5620
#define LoadIcon
Definition: winuser.h:5714
#define MF_GRAYED
Definition: winuser.h:129
BYTE fsState
Definition: commctrl.h:923
LONG_PTR LRESULT
Definition: windef.h:209
#define STD_FILEOPEN
Definition: commctrl.h:1050
#define WS_VISIBLE
Definition: pedump.c:620
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define TBSTYLE_BUTTON
Definition: commctrl.h:953
#define WM_MDITILE
Definition: winuser.h:1800
HWND hMDIClient
Definition: main.c:49
UINT_PTR nID
Definition: commctrl.h:1032
DWORD Flags
Definition: commdlg.h:342