ReactOS  0.4.12-dev-18-gf469aca
main.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: PAINT for ReactOS
3  * LICENSE: LGPL
4  * FILE: base/applications/mspaint/main.cpp
5  * PURPOSE: Initializing everything
6  * PROGRAMMERS: Benedikt Freisen
7  */
8 
9 /* INCLUDES *********************************************************/
10 
11 #include "precomp.h"
12 
13 /* FUNCTIONS ********************************************************/
14 
17 
19 
21 
27 
29 
31 
33 BOOL askBeforeEnlarging = FALSE; // TODO: initialize from registry
34 
41 
47 
49 
51 
55 int fileHPPM = 2834;
56 int fileVPPM = 2834;
58 
61 
81 
82 // get file name extension from filter string
83 static BOOL
85 {
86  LPTSTR pchExt = pExt;
87  *pchExt = 0;
88 
89  DWORD nIndex = 1;
90  for (LPCTSTR pch = pOFN->lpstrFilter; *pch; ++nIndex)
91  {
92  pch += lstrlen(pch) + 1;
93  if (pOFN->nFilterIndex == nIndex)
94  {
95  for (++pch; *pch && *pch != _T(';'); ++pch)
96  {
97  *pchExt++ = *pch;
98  }
99  *pchExt = 0;
100  CharLower(pExt);
101  return TRUE;
102  }
103  pch += lstrlen(pch) + 1;
104  }
105  return FALSE;
106 }
107 
108 // Hook procedure for OPENFILENAME to change the file name extension
109 static UINT_PTR APIENTRY
111 {
112  HWND hParent;
113  OFNOTIFY *pon;
114  switch (uMsg)
115  {
116  case WM_NOTIFY:
117  pon = (OFNOTIFY *)lParam;
118  if (pon->hdr.code == CDN_TYPECHANGE)
119  {
120  hParent = GetParent(hwnd);
122  SendMessage(hParent, CDM_GETFILEPATH, SIZEOF(Path), (LPARAM)Path);
123  LPTSTR pchTitle = _tcsrchr(Path, _T('\\'));
124  if (pchTitle == NULL)
125  pchTitle = _tcsrchr(Path, _T('/'));
126 
127  LPTSTR pch = _tcsrchr((pchTitle ? pchTitle : Path), _T('.'));
128  if (pch && pchTitle)
129  {
130  pchTitle++;
131  *pch = 0;
132  FileExtFromFilter(pch, pchTitle, pon->lpOFN);
133  SendMessage(hParent, CDM_SETCONTROLTEXT, 0x047c, (LPARAM)pchTitle);
134  lstrcpyn(pon->lpOFN->lpstrFile, Path, SIZEOF(pon->lpOFN->lpstrFile));
135  }
136  }
137  break;
138  }
139  return 0;
140 }
141 
142 /* entry point */
143 
144 int WINAPI
145 _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil)
146 {
147  HWND hwnd; /* This is the handle for our window */
148  MSG messages; /* Here messages to the application are saved */
149 
150  HMENU menu;
151  HACCEL haccel;
152 
153  TCHAR sfnFilename[1000];
154  TCHAR sfnFiletitle[256];
155  TCHAR ofnFilename[1000];
156  TCHAR ofnFiletitle[256];
157  TCHAR miniaturetitle[100];
158  static int custColors[16] = { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
159  0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff
160  };
161 
162  /* init font for text tool */
163  lfTextFont.lfHeight = 0;
164  lfTextFont.lfWidth = 0;
165  lfTextFont.lfEscapement = 0;
166  lfTextFont.lfOrientation = 0;
167  lfTextFont.lfWeight = FW_NORMAL;
168  lfTextFont.lfItalic = FALSE;
169  lfTextFont.lfUnderline = FALSE;
170  lfTextFont.lfStrikeOut = FALSE;
171  lfTextFont.lfCharSet = DEFAULT_CHARSET;
172  lfTextFont.lfOutPrecision = OUT_DEFAULT_PRECIS;
174  lfTextFont.lfQuality = DEFAULT_QUALITY;
176  lstrcpy(lfTextFont.lfFaceName, _T(""));
177  hfontTextFont = CreateFontIndirect(&lfTextFont);
178 
179  hProgInstance = hThisInstance;
180 
181  /* initialize common controls library */
183 
185  CPath pathFileName(filepathname);
186  pathFileName.StripPath();
187  CString strTitle;
188  strTitle.Format(IDS_WINDOWTITLE, (LPCTSTR)pathFileName);
189  LoadString(hThisInstance, IDS_MINIATURETITLE, miniaturetitle, SIZEOF(miniaturetitle));
190 
191  /* load settings from registry */
192  registrySettings.Load();
193  showMiniature = registrySettings.ShowThumbnail;
194  imageModel.Crop(registrySettings.BMPWidth, registrySettings.BMPHeight);
195 
196  /* create main window */
197  RECT mainWindowPos = {0, 0, 544, 375}; // FIXME: use equivalent of CW_USEDEFAULT for position
198  hwnd = mainWindow.Create(HWND_DESKTOP, mainWindowPos, strTitle, WS_OVERLAPPEDWINDOW);
199 
200  RECT fullscreenWindowPos = {0, 0, 100, 100};
201  fullscreenWindow.Create(HWND_DESKTOP, fullscreenWindowPos, NULL, WS_POPUPWINDOW | WS_MAXIMIZE);
202 
203  RECT miniaturePos = {(LONG) registrySettings.ThumbXPos, (LONG) registrySettings.ThumbYPos,
204  (LONG) registrySettings.ThumbXPos + (LONG) registrySettings.ThumbWidth,
205  (LONG) registrySettings.ThumbYPos + (LONG) registrySettings.ThumbHeight};
206  miniature.Create(hwnd, miniaturePos, miniaturetitle,
208  miniature.ShowWindow(showMiniature ? SW_SHOW : SW_HIDE);
209 
210  /* loading and setting the window menu from resource */
211  menu = LoadMenu(hThisInstance, MAKEINTRESOURCE(ID_MENU));
212  SetMenu(hwnd, menu);
213  haccel = LoadAccelerators(hThisInstance, MAKEINTRESOURCE(800));
214 
215  /* preloading the draw transparent/nontransparent icons for later use */
218  hTranspIcon =
220 
221  hCurFill = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_FILL));
222  hCurColor = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_COLOR));
223  hCurZoom = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_ZOOM));
224  hCurPen = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_PEN));
226 
227  CreateWindowEx(0, _T("STATIC"), NULL, WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL,
228  hThisInstance, NULL);
229 
230  RECT toolBoxContainerPos = {2, 2, 2 + 52, 2 + 350};
231  toolBoxContainer.Create(hwnd, toolBoxContainerPos, NULL, WS_CHILD | WS_VISIBLE);
232  /* creating the tool settings child window */
233  RECT toolSettingsWindowPos = {5, 208, 5 + 42, 208 + 140};
234  toolSettingsWindow.Create(toolBoxContainer.m_hWnd, toolSettingsWindowPos, NULL, WS_CHILD | WS_VISIBLE);
235 
236  /* creating the palette child window */
237  RECT paletteWindowPos = {56, 9, 56 + 255, 9 + 32};
238  paletteWindow.Create(hwnd, paletteWindowPos, NULL, WS_CHILD | WS_VISIBLE);
239 
240  /* creating the scroll box */
241  RECT scrollboxWindowPos = {56, 49, 56 + 472, 49 + 248};
242  scrollboxWindow.Create(hwnd, scrollboxWindowPos, NULL,
244 
245  /* creating the status bar */
246  hStatusBar =
248  NULL, hThisInstance, NULL);
249  SendMessage(hStatusBar, SB_SETMINHEIGHT, 21, 0);
250 
251  RECT scrlClientWindowPos = {0, 0, 0 + 500, 0 + 500};
252  scrlClientWindow.Create(scrollboxWindow.m_hWnd, scrlClientWindowPos, NULL, WS_CHILD | WS_VISIBLE);
253 
254  /* create selection window (initially hidden) */
255  RECT selectionWindowPos = {350, 0, 350 + 100, 0 + 100};
256  selectionWindow.Create(scrlClientWindow.m_hWnd, selectionWindowPos, NULL, WS_CHILD | BS_OWNERDRAW);
257 
258  /* creating the window inside the scroll box, on which the image in hDrawingDC's bitmap is drawn */
259  RECT imageAreaPos = {3, 3, 3 + imageModel.GetWidth(), 3 + imageModel.GetHeight()};
260  imageArea.Create(scrlClientWindow.m_hWnd, imageAreaPos, NULL, WS_CHILD | WS_VISIBLE);
261 
262  if (__argc >= 2)
263  {
265  HANDLE hFind = FindFirstFileW(__targv[1], &find);
266  if (hFind != INVALID_HANDLE_VALUE)
267  {
268  FindClose(hFind);
269 
270  // check the file size
271  if (find.nFileSizeHigh || find.nFileSizeLow)
272  {
273  // load it now
274  HBITMAP bmNew = NULL;
275  LoadDIBFromFile(&bmNew, __targv[1], &fileTime, &fileSize, &fileHPPM, &fileVPPM);
276  if (bmNew)
277  {
278  // valid bitmap file
280  imageModel.Insert(bmNew);
281  CPath pathFileName(filepathname);
282  pathFileName.StripPath();
283 
284  CString strTitle;
285  strTitle.Format(IDS_WINDOWTITLE, (LPCTSTR)pathFileName);
286  mainWindow.SetWindowText(strTitle);
287 
288  imageModel.ClearHistory();
289 
290  isAFile = TRUE;
291  registrySettings.SetMostRecentFile(filepathname);
292  }
293  else
294  {
295  // cannot open and not empty
296  CStringW strText;
297  strText.Format(IDS_LOADERRORTEXT, __targv[1]);
298  MessageBoxW(NULL, strText, NULL, MB_ICONERROR);
299  }
300  }
301  else
302  {
303  // open the empty file
305  CPath pathFileName(filepathname);
306  pathFileName.StripPath();
307 
308  CString strTitle;
309  strTitle.Format(IDS_WINDOWTITLE, (LPCTSTR)pathFileName);
310  mainWindow.SetWindowText(strTitle);
311 
312  imageModel.ClearHistory();
313 
314  isAFile = TRUE;
315  registrySettings.SetMostRecentFile(filepathname);
316  }
317  }
318  else
319  {
320  // does not exist
321  CStringW strText;
322  strText.Format(IDS_LOADERRORTEXT, __targv[1]);
323  MessageBoxW(NULL, strText, NULL, MB_ICONERROR);
324  }
325  }
326 
327  /* initializing the CHOOSECOLOR structure for use with ChooseColor */
328  choosecolor.lStructSize = sizeof(CHOOSECOLOR);
329  choosecolor.hwndOwner = hwnd;
330  choosecolor.hInstance = NULL;
331  choosecolor.rgbResult = 0x00ffffff;
332  choosecolor.lpCustColors = (COLORREF*) &custColors;
333  choosecolor.Flags = 0;
334  choosecolor.lCustData = 0;
335  choosecolor.lpfnHook = NULL;
336  choosecolor.lpTemplateName = NULL;
337 
338  /* initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName */
339  CopyMemory(ofnFilename, filepathname, sizeof(filepathname));
340  CString strImporters;
341  CSimpleArray<GUID> aguidFileTypesI;
342  CString strAllPictureFiles;
343  strAllPictureFiles.LoadString(hThisInstance, IDS_ALLPICTUREFILES);
344  CImage::GetImporterFilterString(strImporters, aguidFileTypesI, strAllPictureFiles, CImage::excludeDefaultLoad, _T('\0'));
345 // CAtlStringW strAllFiles;
346 // strAllFiles.LoadString(hThisInstance, IDS_ALLFILES);
347 // strImporters = strAllFiles + CAtlStringW(_T("|*.*|")).Replace('|', '\0') + strImporters;
348  ZeroMemory(&ofn, sizeof(OPENFILENAME));
349  ofn.lStructSize = sizeof(OPENFILENAME);
350  ofn.hwndOwner = hwnd;
351  ofn.hInstance = hThisInstance;
352  ofn.lpstrFilter = strImporters;
353  ofn.lpstrFile = ofnFilename;
354  ofn.nMaxFile = SIZEOF(ofnFilename);
355  ofn.lpstrFileTitle = ofnFiletitle;
356  ofn.nMaxFileTitle = SIZEOF(ofnFiletitle);
357  ofn.Flags = OFN_HIDEREADONLY;
358 
359  CopyMemory(sfnFilename, filepathname, sizeof(filepathname));
360  CString strExporters;
361  CSimpleArray<GUID> aguidFileTypesE;
362  CImage::GetExporterFilterString(strExporters, aguidFileTypesE, NULL, CImage::excludeDefaultSave, _T('\0'));
363  ZeroMemory(&sfn, sizeof(OPENFILENAME));
364  sfn.lStructSize = sizeof(OPENFILENAME);
365  sfn.hwndOwner = hwnd;
366  sfn.hInstance = hThisInstance;
367  sfn.lpstrFilter = strExporters;
368  sfn.lpstrFile = sfnFilename;
369  sfn.nMaxFile = SIZEOF(sfnFilename);
370  sfn.lpstrFileTitle = sfnFiletitle;
371  sfn.nMaxFileTitle = SIZEOF(sfnFiletitle);
373  sfn.lpfnHook = OFNHookProc;
374 
375  /* creating the size boxes */
376  RECT sizeboxPos = {0, 0, 0 + 3, 0 + 3};
377  sizeboxLeftTop.Create(scrlClientWindow.m_hWnd, sizeboxPos, NULL, WS_CHILD | WS_VISIBLE);
378  sizeboxCenterTop.Create(scrlClientWindow.m_hWnd, sizeboxPos, NULL, WS_CHILD | WS_VISIBLE);
379  sizeboxRightTop.Create(scrlClientWindow.m_hWnd, sizeboxPos, NULL, WS_CHILD | WS_VISIBLE);
380  sizeboxLeftCenter.Create(scrlClientWindow.m_hWnd, sizeboxPos, NULL, WS_CHILD | WS_VISIBLE);
381  sizeboxRightCenter.Create(scrlClientWindow.m_hWnd, sizeboxPos, NULL, WS_CHILD | WS_VISIBLE);
382  sizeboxLeftBottom.Create(scrlClientWindow.m_hWnd, sizeboxPos, NULL, WS_CHILD | WS_VISIBLE);
383  sizeboxCenterBottom.Create(scrlClientWindow.m_hWnd, sizeboxPos, NULL, WS_CHILD | WS_VISIBLE);
384  sizeboxRightBottom.Create(scrlClientWindow.m_hWnd, sizeboxPos, NULL, WS_CHILD | WS_VISIBLE);
385  /* placing the size boxes around the image */
386  imageArea.SendMessage(WM_SIZE, 0, 0);
387 
388  /* by moving the window, the things in WM_SIZE are done */
389  mainWindow.SetWindowPlacement(&(registrySettings.WindowPlacement));
390 
391  /* creating the text editor window for the text tool */
392  RECT textEditWindowPos = {300, 0, 300 + 300, 0 + 200};
393  textEditWindow.Create(hwnd, textEditWindowPos, NULL, WS_OVERLAPPEDWINDOW);
394 
395  /* Make the window visible on the screen */
396  ShowWindow (hwnd, nFunsterStil);
397 
398  /* inform the system, that the main window accepts dropped files */
399  DragAcceptFiles(hwnd, TRUE);
400 
401  /* Run the message loop. It will run until GetMessage() returns 0 */
402  while (GetMessage(&messages, NULL, 0, 0))
403  {
404  TranslateAccelerator(hwnd, haccel, &messages);
405 
406  /* Translate virtual-key messages into character messages */
407  TranslateMessage(&messages);
408  /* Send message to WindowProcedure */
409  DispatchMessage(&messages);
410  }
411 
412  /* write back settings to registry */
413  registrySettings.ShowThumbnail = showMiniature;
414  registrySettings.BMPWidth = imageModel.GetWidth();
415  registrySettings.BMPHeight = imageModel.GetHeight();
416  registrySettings.Store();
417 
418  /* The program return-value is 0 - The value that PostQuitMessage() gave */
419  return messages.wParam;
420 }
#define WS_GROUP
Definition: pedump.c:633
#define OFN_EXPLORER
Definition: commdlg.h:104
BYTE lfItalic
Definition: dimm.idl:47
#define WS_POPUPWINDOW
Definition: pedump.c:638
#define IDS_ALLPICTUREFILES
Definition: definitions.h:230
DWORD ThumbXPos
Definition: registry.h:25
#define WS_THICKFRAME
Definition: pedump.c:630
int textToolTextMaxLen
Definition: main.cpp:26
#define TranslateAccelerator
Definition: winuser.h:5726
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DispatchMessage
Definition: winuser.h:5631
#define IDC_ZOOM
Definition: resource.h:16
#define BS_OWNERDRAW
Definition: pedump.c:661
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CToolSettingsWindow toolSettingsWindow
Definition: main.cpp:66
#define IMAGE_ICON
Definition: winuser.h:212
#define IDS_MINIATURETITLE
Definition: definitions.h:210
SelectionModel selectionModel
Definition: main.cpp:20
#define HBITMAP
Definition: msvc.h:28
#define DEFAULT_QUALITY
Definition: wingdi.h:434
DWORD ThumbHeight
Definition: registry.h:23
#define FF_DONTCARE
Definition: wingdi.h:446
HCURSOR hCurFill
Definition: main.cpp:42
LPSTR lpstrFileTitle
Definition: commdlg.h:338
HWND hwndOwner
Definition: commdlg.h:330
#define SW_HIDE
Definition: winuser.h:762
CHOOSECOLORA CHOOSECOLOR
Definition: commdlg.h:654
ImageModel imageModel
Definition: main.cpp:32
#define WS_EX_PALETTEWINDOW
Definition: winuser.h:399
HWND Create(HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:1622
LPCSTR lpTemplateName
Definition: commdlg.h:247
BYTE lfStrikeOut
Definition: dimm.idl:49
OPENFILENAME ofn
Definition: main.cpp:37
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BYTE lfUnderline
Definition: dimm.idl:48
PaletteModel paletteModel
Definition: main.cpp:28
void StripPath()
Definition: atlpath.h:339
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
Definition: shellole.c:527
SYSTEMTIME fileTime
Definition: main.cpp:57
CSizeboxWindow sizeboxRightCenter
Definition: main.cpp:76
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
HCURSOR hCurColor
Definition: main.cpp:43
int fileVPPM
Definition: main.cpp:56
#define ZeroMemory
Definition: winbase.h:1635
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
BYTE lfCharSet
Definition: dimm.idl:50
LPTSTR textToolText
Definition: main.cpp:25
HCURSOR hCurPen
Definition: main.cpp:45
#define __targv
Definition: tchar.h:504
#define WS_CHILD
Definition: pedump.c:617
HICON HCURSOR
Definition: windef.h:289
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL SetWindowText(LPCTSTR lpszString)
Definition: atlwin.h:1223
#define DEFAULT_CHARSET
Definition: wingdi.h:382
#define STATUSCLASSNAME
Definition: commctrl.h:1909
COLORREF rgbResult
Definition: commdlg.h:242
WPARAM wParam
Definition: combotst.c:138
CHAR * LPTSTR
Definition: xmlstorage.h:192
BYTE lfOutPrecision
Definition: dimm.idl:51
DWORD nMaxFile
Definition: commdlg.h:337
UINT_PTR WPARAM
Definition: windef.h:207
static UINT_PTR APIENTRY OFNHookProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: main.cpp:110
CSizeboxWindow sizeboxCenterBottom
Definition: main.cpp:78
DWORD BMPHeight
Definition: registry.h:17
#define IDC_PEN
Definition: definitions.h:40
void Crop(int nWidth, int nHeight, int nOffsetX=0, int nOffsetY=0)
Definition: history.cpp:124
CToolBox toolBoxContainer
Definition: main.cpp:65
void SetMostRecentFile(LPCTSTR szPathName)
Definition: registry.cpp:144
UINT code
Definition: winuser.h:3112
CPaletteWindow paletteWindow
Definition: main.cpp:67
CHOOSECOLOR choosecolor
Definition: main.cpp:36
void LoadDIBFromFile(HBITMAP *hBitmap, LPCTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes)
Definition: dib.cpp:84
HWND hwndEditCtl
Definition: main.cpp:24
CSizeboxWindow sizeboxLeftBottom
Definition: main.cpp:77
#define LoadAccelerators
Definition: winuser.h:5676
CFullscreenWindow fullscreenWindow
Definition: main.cpp:63
#define SIZEOF(_ar)
Definition: calc.h:48
LPOFNHOOKPROC lpfnHook
Definition: commdlg.h:347
void ClearHistory(void)
Definition: history.cpp:102
long LONG
Definition: pedump.c:60
LONG_PTR LPARAM
Definition: windef.h:208
LONG lfHeight
Definition: dimm.idl:42
LPCCHOOKPROC lpfnHook
Definition: commdlg.h:246
#define IDS_LOADERRORTEXT
Definition: definitions.h:238
#define CLIP_DEFAULT_PRECIS
Definition: wingdi.h:424
#define OFN_ENABLEHOOK
Definition: commdlg.h:99
#define CreateWindowEx
Definition: winuser.h:5621
ToolsModel toolsModel
Definition: main.cpp:18
#define IDC_COLOR
Definition: definitions.h:38
#define APIENTRY
Definition: nt_native.h:48
POINT start
Definition: main.cpp:15
LONG lfWeight
Definition: dimm.idl:46
smooth NULL
Definition: ftsmooth.c:416
#define ID_MENU
Definition: definitions.h:48
#define IDI_NONTRANSPARENT
Definition: definitions.h:35
HFONT hfontTextFont
Definition: main.cpp:23
DWORD ShowThumbnail
Definition: registry.h:21
CSizeboxWindow sizeboxRightTop
Definition: main.cpp:74
HINSTANCE hInstance
Definition: commdlg.h:331
BYTE lfPitchAndFamily
Definition: dimm.idl:54
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
#define SW_SHOW
Definition: winuser.h:769
HWND hStatusBar
Definition: main.cpp:35
static BOOL FileExtFromFilter(LPTSTR pExt, LPCTSTR pTitle, OPENFILENAME *pOFN)
Definition: main.cpp:84
void Insert(HBITMAP hbm)
Definition: history.cpp:108
HICON hTranspIcon
Definition: main.cpp:40
#define IDC_AIRBRUSH
Definition: definitions.h:41
BOOL SetWindowPlacement(const WINDOWPLACEMENT *lpwndpl)
Definition: atlwin.h:1205
WINDOWPLACEMENT WindowPlacement
Definition: registry.h:28
#define WS_CAPTION
Definition: pedump.c:624
LPOPENFILENAMEA lpOFN
Definition: commdlg.h:407
char TCHAR
Definition: xmlstorage.h:189
CMiniatureWindow miniature
Definition: main.cpp:64
CMainWindow mainWindow
Definition: main.cpp:62
HCURSOR hCurAirbrush
Definition: main.cpp:46
#define SS_ETCHEDHORZ
Definition: winuser.h:343
#define _T(x)
Definition: vfdio.h:22
DWORD BMPWidth
Definition: registry.h:18
unsigned int BOOL
Definition: ntddk_ex.h:94
RegistrySettings registrySettings
Definition: main.cpp:30
#define WS_OVERLAPPED
Definition: pedump.c:615
#define DEFAULT_PITCH
Definition: wingdi.h:441
NMHDR hdr
Definition: commdlg.h:406
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define SBARS_SIZEGRIP
Definition: commctrl.h:1893
#define WM_SIZE
Definition: winuser.h:1593
HINSTANCE hProgInstance
Definition: main.cpp:50
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
#define CDM_GETFILEPATH
Definition: commdlg.h:44
TCHAR filepathname[1000]
Definition: main.cpp:52
DWORD ThumbWidth
Definition: registry.h:24
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
BOOL askBeforeEnlarging
Definition: main.cpp:33
unsigned int UINT
Definition: ndis.h:50
#define CopyMemory
Definition: winbase.h:1633
#define OUT_DEFAULT_PRECIS
Definition: wingdi.h:413
unsigned long DWORD
Definition: ntddk_ex.h:95
CSelectionWindow selectionWindow
Definition: main.cpp:70
POINT last
Definition: main.cpp:16
#define IDC_FILL
Definition: definitions.h:37
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
LONG lfWidth
Definition: dimm.idl:43
LPARAM lCustData
Definition: commdlg.h:245
BOOL showMiniature
Definition: main.cpp:60
CSizeboxWindow sizeboxRightBottom
Definition: main.cpp:79
#define WS_HSCROLL
Definition: pedump.c:628
BOOL isAFile
Definition: main.cpp:53
#define LONG
Definition: msvc.h:36
LONG lfOrientation
Definition: dimm.idl:45
int GetWidth()
Definition: history.cpp:195
HWND hInstance
Definition: commdlg.h:241
int GetHeight()
Definition: history.cpp:200
HWND Create()
Definition: gui.cpp:1726
#define IDI_TRANSPARENT
Definition: definitions.h:34
#define MB_ICONERROR
Definition: winuser.h:781
CSizeboxWindow sizeboxCenterTop
Definition: main.cpp:73
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
HWND m_hWnd
Definition: atlwin.h:259
#define GetFullPathName
Definition: winbase.h:3635
DWORD ThumbYPos
Definition: registry.h:26
#define WINAPI
Definition: msvc.h:20
BYTE lfQuality
Definition: dimm.idl:53
int fileHPPM
Definition: main.cpp:55
int nIndex
Definition: msvc.h:77
#define CDN_TYPECHANGE
Definition: commdlg.h:39
BOOL showGrid
Definition: main.cpp:59
HWND WINAPI GetParent(_In_ HWND)
#define lstrlen
Definition: winbase.h:3690
DWORD lStructSize
Definition: commdlg.h:239
PRTL_UNICODE_STRING_BUFFER Path
CTextEditWindow textEditWindow
Definition: main.cpp:80
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define LoadMenu
Definition: winuser.h:5683
#define CDM_SETCONTROLTEXT
Definition: commdlg.h:47
LPSTR lpstrFile
Definition: commdlg.h:336
#define lstrcpy
Definition: winbase.h:3688
BYTE lfClipPrecision
Definition: dimm.idl:52
int fileSize
Definition: main.cpp:54
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
HICON hNontranspIcon
Definition: main.cpp:39
HCURSOR hCurZoom
Definition: main.cpp:44
LPCSTR lpstrFilter
Definition: commdlg.h:332
#define HWND_DESKTOP
Definition: winuser.h:1195
OPENFILENAME sfn
Definition: main.cpp:38
HWND hwndOwner
Definition: commdlg.h:240
#define CreateFontIndirect
Definition: wingdi.h:4421
#define WS_VSCROLL
Definition: pedump.c:627
#define GetMessage
Definition: winuser.h:5656
LOGFONT lfTextFont
Definition: main.cpp:22
#define FW_NORMAL
Definition: wingdi.h:371
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static TAGID TAGID find
Definition: db.cpp:143
_CRTIMP int __argc
Definition: getargs.c:21
#define SendMessage
Definition: winuser.h:5709
_TCHAR * _tcsrchr(const _TCHAR *s, _XINT c)
Definition: tcsrchr.h:4
CImgAreaWindow imageArea
Definition: main.cpp:71
#define CharLower
Definition: winuser.h:5603
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1039
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:506
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
HWND hToolBtn[16]
Definition: main.cpp:48
CSizeboxWindow sizeboxLeftTop
Definition: main.cpp:72
#define LoadImage
Definition: winuser.h:5681
WCHAR * pch
Definition: msvc.h:81
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
int WINAPI _tWinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil)
Definition: main.cpp:145
#define LoadIcon
Definition: winuser.h:5679
DWORD nFilterIndex
Definition: commdlg.h:335
#define SB_SETMINHEIGHT
Definition: commctrl.h:1927
CScrollboxWindow scrlClientWindow
Definition: main.cpp:69
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define WS_VISIBLE
Definition: pedump.c:620
DWORD COLORREF
Definition: windef.h:290
#define WS_SYSMENU
Definition: pedump.c:629
CSizeboxWindow sizeboxLeftCenter
Definition: main.cpp:75
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define IDS_WINDOWTITLE
Definition: definitions.h:204
LPARAM lParam
Definition: combotst.c:139
COLORREF * lpCustColors
Definition: commdlg.h:243
#define LoadString
Definition: winuser.h:5685
#define WM_NOTIFY
Definition: richedit.h:61
LONG lfEscapement
Definition: dimm.idl:44
#define lstrcpyn
Definition: winbase.h:3689
DWORD nMaxFileTitle
Definition: commdlg.h:339
CScrollboxWindow scrollboxWindow
Definition: main.cpp:68
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
#define IDS_DEFAULTFILENAME
Definition: definitions.h:209
#define WS_MAXIMIZE
Definition: pedump.c:623
DWORD Flags
Definition: commdlg.h:342
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502