ReactOS  0.4.15-dev-318-g99b52df
winproc.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: PAINT for ReactOS
3  * LICENSE: LGPL
4  * FILE: base/applications/mspaint/winproc.cpp
5  * PURPOSE: Window procedure of the main window and all children apart from
6  * hPalWin, hToolSettings and hSelection
7  * PROGRAMMERS: Benedikt Freisen
8  * Katayama Hirofumi MZ
9  * Stanislav Motylkov
10  */
11 
12 /* INCLUDES *********************************************************/
13 
14 #include "precomp.h"
15 
16 #include "dialogs.h"
17 
18 /* FUNCTIONS ********************************************************/
19 
20 BOOL
21 zoomTo(int newZoom, int mouseX, int mouseY)
22 {
23  RECT clientRectScrollbox;
24  RECT clientRectImageArea;
25  int x, y, w, h;
26  scrollboxWindow.GetClientRect(&clientRectScrollbox);
27  imageArea.GetClientRect(&clientRectImageArea);
28  w = clientRectImageArea.right * newZoom / toolsModel.GetZoom();
29  h = clientRectImageArea.bottom * newZoom / toolsModel.GetZoom();
30  if (!w || !h)
31  {
32  return FALSE;
33  }
34  w = clientRectImageArea.right * clientRectScrollbox.right / w;
35  h = clientRectImageArea.bottom * clientRectScrollbox.bottom / h;
36  x = max(0, min(clientRectImageArea.right - w, mouseX - w / 2)) * newZoom / toolsModel.GetZoom();
37  y = max(0, min(clientRectImageArea.bottom - h, mouseY - h / 2)) * newZoom / toolsModel.GetZoom();
38 
39  toolsModel.SetZoom(newZoom);
40 
41  selectionWindow.ShowWindow(SW_HIDE);
43  scrollboxWindow.Invalidate(TRUE);
45 
48  return TRUE;
49 }
50 
52 {
53  int x, y, w, h;
54  RECT clientRect;
55  GetClientRect(&clientRect);
56 
58  {
59  x = 56;
60  w = clientRect.right - 56;
61  }
62  else
63  {
64  x = 0;
65  w = clientRect.right;
66  }
67  if (paletteWindow.IsWindowVisible())
68  {
69  y = 49;
70  h = clientRect.bottom - 49;
71  }
72  else
73  {
74  y = 3;
75  h = clientRect.bottom - 3;
76  }
77 
78  RECT statusBarRect0;
79  SendMessage(hStatusBar, SB_GETRECT, 0, (LPARAM)&statusBarRect0);
80  int statusBarBorders[3];
81  SendMessage(hStatusBar, SB_GETBORDERS, 0, (LPARAM)&statusBarBorders);
82  int statusBarHeight = statusBarRect0.bottom - statusBarRect0.top + statusBarBorders[1];
83 
84  scrollboxWindow.MoveWindow(x, y, w, ::IsWindowVisible(hStatusBar) ? h - statusBarHeight : h, TRUE);
85  paletteWindow.MoveWindow(x, 9, 255, 32, TRUE);
86 }
87 
89 {
90  if (isAFile && overwrite)
91  {
93  }
94  else if (GetSaveFileName(&sfn) != 0)
95  {
98  CString strTitle;
100  SetWindowText(strTitle);
101  isAFile = TRUE;
102  }
103 }
104 
106 {
107  int width = GetDIBWidth(bitmap);
108  int height = GetDIBHeight(bitmap);
109  int curWidth = imageModel.GetWidth();
110  int curHeight = imageModel.GetHeight();
111 
112  if (width > curWidth || height > curHeight)
113  {
114  BOOL shouldEnlarge = TRUE;
115 
116  if (askBeforeEnlarging)
117  {
118  TCHAR programname[20];
119  TCHAR shouldEnlargePromptText[100];
120 
121  LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname));
122  LoadString(hProgInstance, IDS_ENLARGEPROMPTTEXT, shouldEnlargePromptText, SIZEOF(shouldEnlargePromptText));
123 
124  switch (MessageBox(shouldEnlargePromptText, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
125  {
126  case IDYES:
127  break;
128  case IDNO:
129  shouldEnlarge = FALSE;
130  break;
131  case IDCANCEL:
132  return;
133  }
134  }
135 
136  if (shouldEnlarge)
137  {
138  if (width > curWidth)
139  curWidth = width;
140 
141  if (height > curHeight)
142  curHeight = height;
143 
144  imageModel.Crop(curWidth, curHeight, 0, 0);
145  }
146  }
147 
151 
154 
155  placeSelWin();
156  selectionWindow.ShowWindow(SW_SHOW);
158 }
159 
161 {
162  TCHAR droppedfile[MAX_PATH];
163 
164  HDROP hDrop = (HDROP)wParam;
165  DragQueryFile(hDrop, 0, droppedfile, SIZEOF(droppedfile));
166  DragFinish(hDrop);
167 
168  ConfirmSave() && DoLoadImageFile(m_hWnd, droppedfile, TRUE);
169 
170  return 0;
171 }
172 
174 {
177  return 0;
178 }
179 
181 {
183  PostQuitMessage(0); /* send a WM_QUIT to the message queue */
184  return 0;
185 }
186 
188 {
189  if (imageModel.IsImageSaved())
190  return TRUE;
191 
192  CString strProgramName;
193  strProgramName.LoadString(IDS_PROGRAMNAME);
194 
195  CString strSavePromptText;
197 
198  switch (MessageBox(strSavePromptText, strProgramName, MB_YESNOCANCEL | MB_ICONQUESTION))
199  {
200  case IDYES:
201  saveImage(TRUE);
202  return imageModel.IsImageSaved();
203  case IDNO:
204  return TRUE;
205  case IDCANCEL:
206  return FALSE;
207  }
208 
209  return TRUE;
210 }
211 
213 {
214  if (ConfirmSave())
215  {
216  DestroyWindow();
217  }
218  return 0;
219 }
220 
222 {
223  HMENU menu = GetMenu();
224  BOOL trueSelection = (selectionWindow.IsWindowVisible() && ((toolsModel.GetActiveTool() == TOOL_FREESEL) || (toolsModel.GetActiveTool() == TOOL_RECTSEL)));
225  switch (lParam)
226  {
227  case 0: /* File menu */
228  if ((HMENU)wParam != GetSubMenu(menu, 0))
229  break;
238  {
240  CPath pathFile1(registrySettings.strFile1);
241  pathFile1.CompactPathEx(30);
243  {
244  CPath pathFile2(registrySettings.strFile2);
245  pathFile2.CompactPathEx(30);
247  {
248  CPath pathFile3(registrySettings.strFile3);
249  pathFile3.CompactPathEx(30);
251  {
252  CPath pathFile4(registrySettings.strFile4);
253  pathFile4.CompactPathEx(30);
254  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE4, _T("4 ") + pathFile4);
255  }
256  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE3, _T("3 ") + pathFile3);
257  }
258  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE2, _T("2 ") + pathFile2);
259  }
260  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE1, _T("1 ") + pathFile1);
261  }
262  break;
263  case 1: /* Edit menu */
266  EnableMenuItem(menu, IDM_EDITCUT, ENABLED_IF(trueSelection));
267  EnableMenuItem(menu, IDM_EDITCOPY, ENABLED_IF(trueSelection));
268  EnableMenuItem(menu, IDM_EDITDELETESELECTION, ENABLED_IF(trueSelection));
269  EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection));
270  EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
271  OpenClipboard();
273  CloseClipboard();
274  break;
275  case 2: /* View menu */
277  CheckMenuItem(menu, IDM_VIEWCOLORPALETTE, CHECKED_IF(paletteWindow.IsWindowVisible()));
279  CheckMenuItem(menu, IDM_FORMATICONBAR, CHECKED_IF(textEditWindow.IsWindowVisible()));
281 
284  break;
285  case 3: /* Image menu */
286  EnableMenuItem(menu, IDM_IMAGECROP, ENABLED_IF(selectionWindow.IsWindowVisible()));
288  break;
289  }
290 
298 
301  return 0;
302 }
303 
305 {
306  int test[] = { LOWORD(lParam) - 260, LOWORD(lParam) - 140, LOWORD(lParam) - 20 };
310  Invalidate(TRUE);
311  return 0;
312 }
313 
315 {
317  mm->ptMinTrackSize.x = 330;
318  mm->ptMinTrackSize.y = 430;
319  return 0;
320 }
321 
323 {
325  bHandled = FALSE;
326  return 0;
327 }
328 
330 {
331  if (wParam == VK_ESCAPE)
332  {
333  HWND hwndCapture = GetCapture();
334  if (hwndCapture)
335  {
336  if (selectionWindow.m_hWnd == hwndCapture ||
337  imageArea.m_hWnd == hwndCapture ||
338  fullscreenWindow.m_hWnd == hwndCapture ||
339  sizeboxLeftTop.m_hWnd == hwndCapture ||
340  sizeboxCenterTop.m_hWnd == hwndCapture ||
341  sizeboxRightTop.m_hWnd == hwndCapture ||
342  sizeboxLeftCenter.m_hWnd == hwndCapture ||
343  sizeboxRightCenter.m_hWnd == hwndCapture ||
344  sizeboxLeftBottom.m_hWnd == hwndCapture ||
345  sizeboxCenterBottom.m_hWnd == hwndCapture ||
346  sizeboxRightBottom.m_hWnd == hwndCapture)
347  {
348  SendMessage(hwndCapture, nMsg, wParam, lParam);
349  }
350  }
351  else
352  {
353  switch (toolsModel.GetActiveTool())
354  {
355  case TOOL_SHAPE: case TOOL_BEZIER:
357  break;
358  }
359  }
360  }
361  return 0;
362 }
363 
365 {
366  /* Redirect message to common controls */
368  SendMessage(hToolbar, WM_SYSCOLORCHANGE, 0, 0);
369  return 0;
370 }
371 
373 {
374  switch (LOWORD(wParam))
375  {
376  case IDM_HELPINFO:
377  {
379  TCHAR infotitle[100];
380  TCHAR infotext[200];
381  LoadString(hProgInstance, IDS_INFOTITLE, infotitle, SIZEOF(infotitle));
382  LoadString(hProgInstance, IDS_INFOTEXT, infotext, SIZEOF(infotext));
383  ShellAbout(m_hWnd, infotitle, infotext, paintIcon);
384  DeleteObject(paintIcon);
385  break;
386  }
387  case IDM_HELPHELPTOPICS:
388  HtmlHelp(m_hWnd, _T("help\\Paint.chm"), 0, 0);
389  break;
390  case IDM_FILEEXIT:
392  break;
393  case IDM_FILENEW:
394  if (ConfirmSave())
395  {
397  }
398  break;
399  case IDM_FILEOPEN:
400  if (ConfirmSave() && GetOpenFileName(&ofn))
401  {
403  }
404  break;
405  case IDM_FILESAVE:
406  saveImage(TRUE);
407  break;
408  case IDM_FILESAVEAS:
409  saveImage(FALSE);
410  break;
411  case IDM_FILEPAGESETUP:
412  // DUMMY: Shows the dialog only, no functionality
413  PAGESETUPDLG psd;
414  ZeroMemory(&psd, sizeof(psd));
415  psd.lStructSize = sizeof(psd);
416  psd.hwndOwner = m_hWnd;
417  PageSetupDlg(&psd);
418  break;
419  case IDM_FILEPRINT:
420  // TODO: Test whether it actually works
421  PRINTDLG pd;
422  ZeroMemory(&pd, sizeof(pd));
423  pd.lStructSize = sizeof(pd);
424  pd.hwndOwner = m_hWnd;
425  pd.hDevMode = NULL; // freed by user
426  pd.hDevNames = NULL; // freed by user
428  pd.nCopies = 1;
429  pd.nFromPage = 0xffff;
430  pd.nToPage = 0xffff;
431  pd.nMinPage = 1;
432  pd.nMaxPage = 0xffff;
433  if (PrintDlg(&pd) == TRUE)
434  {
436  DeleteDC(pd.hDC);
437  }
438  if (pd.hDevMode)
439  GlobalFree(pd.hDevMode);
440  if (pd.hDevNames)
441  GlobalFree(pd.hDevNames);
442  break;
445  break;
448  break;
451  break;
452  case IDM_FILE1:
453  {
455  break;
456  }
457  case IDM_FILE2:
458  {
460  break;
461  }
462  case IDM_FILE3:
463  {
465  break;
466  }
467  case IDM_FILE4:
468  {
470  break;
471  }
472  case IDM_EDITUNDO:
473  imageModel.Undo();
475  break;
476  case IDM_EDITREDO:
477  imageModel.Redo();
479  break;
480  case IDM_EDITCOPY:
481  OpenClipboard();
482  EmptyClipboard();
484  CloseClipboard();
485  break;
486  case IDM_EDITCUT:
487  /* Copy */
489  /* Delete selection */
491  break;
492  case IDM_EDITPASTE:
493  OpenClipboard();
495  {
497  }
498  CloseClipboard();
499  break;
501  {
502  /* remove selection window and already painted content using undo */
503  imageModel.Undo();
504  break;
505  }
506  case IDM_EDITSELECTALL:
507  {
511  //TODO: do this properly
515  break;
516  }
517  case IDM_EDITCOPYTO:
518  if (GetSaveFileName(&ofn))
520  break;
521  case IDM_EDITPASTEFROM:
522  if (GetOpenFileName(&ofn))
523  {
525  if (hbmNew)
526  {
528  DeleteObject(hbmNew);
529  }
530  }
531  break;
533  if (ChooseColor(&choosecolor))
535  break;
538  break;
541  break;
543  {
545  break;
546  }
551  break;
553  switch (mirrorRotateDialog.DoModal(mainWindow.m_hWnd))
554  {
555  case 1: /* flip horizontally */
556  if (selectionWindow.IsWindowVisible())
558  else
560  break;
561  case 2: /* flip vertically */
562  if (selectionWindow.IsWindowVisible())
564  else
566  break;
567  case 3: /* rotate 90 degrees */
568  break;
569  case 4: /* rotate 180 degrees */
570  if (selectionWindow.IsWindowVisible())
572  else
574  break;
575  case 5: /* rotate 270 degrees */
576  break;
577  }
578  break;
579  case IDM_IMAGEATTRIBUTES:
580  {
581  if (attributesDialog.DoModal(mainWindow.m_hWnd))
582  {
584  }
585  break;
586  }
588  {
589  if (stretchSkewDialog.DoModal(mainWindow.m_hWnd))
590  {
593  }
594  break;
595  }
596  case IDM_IMAGEDRAWOPAQUE:
598  break;
599  case IDM_IMAGECROP:
601  break;
602 
603  case IDM_VIEWTOOLBOX:
606  break;
608  paletteWindow.ShowWindow(paletteWindow.IsWindowVisible() ? SW_HIDE : SW_SHOW);
610  break;
611  case IDM_VIEWSTATUSBAR:
614  break;
615  case IDM_FORMATICONBAR:
616  textEditWindow.ShowWindow(textEditWindow.IsWindowVisible() ? SW_HIDE : SW_SHOW);
617  break;
618  case IDM_VIEWSHOWGRID:
619  showGrid = !showGrid;
621  break;
624  miniature.ShowWindow(showMiniature ? SW_SHOW : SW_HIDE);
625  break;
626 
627  case IDM_VIEWZOOM125:
628  zoomTo(125, 0, 0);
629  break;
630  case IDM_VIEWZOOM25:
631  zoomTo(250, 0, 0);
632  break;
633  case IDM_VIEWZOOM50:
634  zoomTo(500, 0, 0);
635  break;
636  case IDM_VIEWZOOM100:
637  zoomTo(1000, 0, 0);
638  break;
639  case IDM_VIEWZOOM200:
640  zoomTo(2000, 0, 0);
641  break;
642  case IDM_VIEWZOOM400:
643  zoomTo(4000, 0, 0);
644  break;
645  case IDM_VIEWZOOM800:
646  zoomTo(8000, 0, 0);
647  break;
648 
649  case IDM_VIEWFULLSCREEN:
650  fullscreenWindow.ShowWindow(SW_SHOW);
652  break;
653  }
654  return 0;
655 }
BOOL isAFile
Definition: main.cpp:53
POINT ptMinTrackSize
Definition: winuser.h:3605
HBITMAP SetBitmapAndInfo(HBITMAP hBitmap, LPCTSTR name, DWORD dwFileSize, BOOL isFile)
Definition: dib.cpp:108
#define IDM_IMAGEROTATEMIRROR
Definition: definitions.h:101
void FlipHorizontally()
Definition: history.cpp:223
int SelectedPalette()
void SaveImage(LPTSTR lpFileName)
Definition: history.cpp:162
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDM_EDITUNDO
Definition: definitions.h:75
GLint GLint GLsizei width
Definition: gl.h:1546
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
ToolsModel toolsModel
Definition: main.cpp:18
void CopyPrevious(void)
Definition: history.cpp:45
#define max(a, b)
Definition: svc.c:63
#define IDM_EDITPASTEFROM
Definition: definitions.h:84
static HICON
Definition: imagelist.c:84
#define IDM_IMAGEINVERTCOLORS
Definition: definitions.h:104
#define TRUE
Definition: types.h:120
CToolBox toolBoxContainer
Definition: main.cpp:66
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
void RotateNTimes90Degrees(int iN)
BOOL MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
Definition: atlwin.h:958
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
WORD nMaxPage
Definition: commdlg.h:474
#define MF_BYCOMMAND
Definition: winuser.h:202
#define IDM_VIEWZOOM125
Definition: definitions.h:90
long y
Definition: polytest.cpp:48
#define TOOL_TEXT
Definition: definitions.h:144
#define PageSetupDlg
Definition: commdlg.h:667
#define IDM_VIEWSHOWGRID
Definition: definitions.h:98
#define IDYES
Definition: winuser.h:829
long x
Definition: polytest.cpp:48
#define IDM_VIEWZOOM400
Definition: definitions.h:95
#define IDM_EDITSELECTALL
Definition: definitions.h:82
#define InsertMenu
Definition: winuser.h:5778
#define ChooseColor
Definition: commdlg.h:661
void endPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
Definition: mouse.cpp:218
BOOL showGrid
Definition: main.cpp:60
#define SW_HIDE
Definition: winuser.h:762
#define IDM_EDITCOPY
Definition: definitions.h:78
#define IDS_PROGRAMNAME
Definition: definitions.h:203
HWND hwndOwner
Definition: commdlg.h:434
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#define IDM_IMAGECROP
Definition: definitions.h:103
LPWSTR lpstrFile
Definition: commdlg.h:367
#define IDM_VIEWCOLORPALETTE
Definition: definitions.h:87
#define MF_STRING
Definition: winuser.h:138
OPENFILENAME ofn
Definition: main.cpp:37
BOOL CompactPathEx(UINT nMaxChars, DWORD dwFlags=0)
Definition: atlpath.h:182
void InvertColors()
Definition: history.cpp:204
#define IDM_EDITCOPYTO
Definition: definitions.h:83
CSizeboxWindow sizeboxRightCenter
Definition: main.cpp:77
#define ZeroMemory
Definition: winbase.h:1648
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDM_COLORSEDITPALETTE
Definition: definitions.h:109
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:688
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define TOOL_SHAPE
Definition: definitions.h:148
WORD nCopies
Definition: commdlg.h:475
CString strFile2
Definition: registry.h:31
int GetDIBHeight(HBITMAP hBitmap)
Definition: dib.cpp:61
#define test
Definition: rosglue.h:37
#define IDM_VIEWSTATUSBAR
Definition: definitions.h:88
UINT_PTR WPARAM
Definition: windef.h:207
SelectionModel selectionModel
Definition: main.cpp:20
#define IDM_COLORSOLDPALETTE
Definition: definitions.h:111
BOOL IsImageSaved()
Definition: history.cpp:167
static void SetWallpaper(LPCTSTR szFileName, WallpaperStyle style)
Definition: registry.cpp:40
#define VK_ESCAPE
Definition: winuser.h:2189
BOOL SetWindowText(LPCTSTR lpszString)
Definition: atlwin.h:1232
BOOL askBeforeEnlarging
Definition: main.cpp:33
LONG right
Definition: windef.h:308
BOOL HasRedoSteps()
Definition: history.cpp:177
void Redo(void)
Definition: history.cpp:75
LRESULT OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:173
COLORREF rgbResult
Definition: commdlg.h:242
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
#define GetOpenFileName
Definition: commdlg.h:665
WPARAM wParam
Definition: combotst.c:138
#define IDM_IMAGEDELETEIMAGE
Definition: definitions.h:106
void whilePaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
Definition: mouse.cpp:125
#define IDM_FILEPAGESETUP
Definition: definitions.h:58
WORD nMinPage
Definition: commdlg.h:473
LRESULT OnGetMinMaxInfo(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:314
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
int GetZoom()
Definition: toolsmodel.cpp:104
#define ICON_SMALL
Definition: tnclass.cpp:48
void Crop(int nWidth, int nHeight, int nOffsetX=0, int nOffsetY=0)
Definition: history.cpp:124
#define IDM_IMAGEATTRIBUTES
Definition: definitions.h:105
CImgAreaWindow imageArea
Definition: main.cpp:72
#define SB_GETRECT
Definition: commctrl.h:1955
#define GetSaveFileName
Definition: commdlg.h:666
int GetDIBWidth(HBITMAP hBitmap)
Definition: dib.cpp:53
#define PrintDlg
Definition: commdlg.h:668
LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:212
#define LR_COPYRETURNORG
Definition: winuser.h:1080
CSizeboxWindow sizeboxCenterTop
Definition: main.cpp:74
#define IDM_FILEPRINT
Definition: definitions.h:59
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
#define IDM_VIEWZOOM100
Definition: definitions.h:93
CSizeboxWindow sizeboxRightTop
Definition: main.cpp:75
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SIZEOF(_ar)
Definition: calc.h:97
CMirrorRotateDialog mirrorRotateDialog
Definition: dialogs.cpp:19
CSizeboxWindow sizeboxCenterBottom
Definition: main.cpp:79
void startPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
Definition: mouse.cpp:56
#define IDM_FILE1
Definition: definitions.h:68
unsigned int BOOL
Definition: ntddk_ex.h:94
LRESULT OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:329
#define TOOL_BEZIER
Definition: definitions.h:146
#define IDM_FILEASWALLPAPERCENTERED
Definition: definitions.h:64
#define IDS_ENLARGEPROMPTTEXT
Definition: definitions.h:239
void saveImage(BOOL overwrite)
Definition: winproc.cpp:88
#define IDM_VIEWFULLSCREEN
Definition: definitions.h:97
#define MF_BYPOSITION
Definition: winuser.h:203
HDC GetDC()
Definition: history.cpp:218
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
HWND WINAPI GetCapture(void)
Definition: message.c:2880
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
void SetBackgroundTransparent(BOOL bTransparent)
Definition: toolsmodel.cpp:98
#define CF_BITMAP
Definition: constants.h:397
#define TOOLBARCLASSNAME
Definition: commctrl.h:942
CMiniatureWindow miniature
Definition: main.cpp:65
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
WORD nFromPage
Definition: commdlg.h:471
smooth NULL
Definition: ftsmooth.c:416
#define SB_GETBORDERS
Definition: commctrl.h:1952
#define IDM_HELPHELPTOPICS
Definition: definitions.h:113
#define MB_ICONQUESTION
Definition: winuser.h:783
struct tagMINMAXINFO * LPMINMAXINFO
#define SB_THUMBPOSITION
Definition: winuser.h:572
#define MB_YESNOCANCEL
Definition: winuser.h:812
LONG_PTR LPARAM
Definition: windef.h:208
#define PD_RETURNDC
Definition: commdlg.h:155
#define IDM_VIEWZOOM25
Definition: definitions.h:91
CSizeboxWindow sizeboxRightBottom
Definition: main.cpp:80
CStretchSkewDialog stretchSkewDialog
Definition: dialogs.cpp:21
DWORD lStructSize
Definition: commdlg.h:433
#define IDS_SAVEPROMPTTEXT
Definition: definitions.h:208
#define SW_SHOW
Definition: winuser.h:769
#define IDS_INFOTEXT
Definition: definitions.h:206
#define IDM_FILE4
Definition: definitions.h:71
void SelectPalette(int nPalette)
void Insert(HBITMAP hbm)
Definition: history.cpp:108
LRESULT OnDropFiles(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:160
WINDOWPLACEMENT WindowPlacement
Definition: registry.h:28
#define IDS_INFOTITLE
Definition: definitions.h:205
Definition: uimain.c:88
HMENU GetMenu() const
Definition: atlwin.h:636
char TCHAR
Definition: xmlstorage.h:189
BOOL IsBackgroundTransparent()
Definition: toolsmodel.cpp:93
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
#define _T(x)
Definition: vfdio.h:22
OPENFILENAMEW sfn
Definition: eventvwr.c:118
#define IDM_FILEASWALLPAPERSTRETCHED
Definition: definitions.h:65
#define IDM_FILEMOSTRECENTLYUSEDFILE
Definition: definitions.h:67
#define WM_SIZE
Definition: winuser.h:1593
void InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window)
Definition: winproc.cpp:105
BOOL GetWindowPlacement(WINDOWPLACEMENT *lpwndpl) const
Definition: atlwin.h:750
#define ID_RECTSEL
Definition: definitions.h:118
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX=0, int nSkewDegY=0)
Definition: history.cpp:182
#define FindWindowEx
Definition: winuser.h:5753
BOOL OpenClipboard()
Definition: atlwin.h:970
#define WM_CLOSE
Definition: winuser.h:1603
#define MAX_PATH
Definition: compat.h:26
void RotateNTimes90Degrees(int iN)
Definition: history.cpp:239
#define IDM_FORMATICONBAR
Definition: definitions.h:89
#define PathFindFileName
Definition: shlwapi.h:911
HGLOBAL hDevMode
Definition: commdlg.h:467
CFullscreenWindow fullscreenWindow
Definition: main.cpp:64
HWND hStatusBar
Definition: main.cpp:35
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define ShellAbout
Definition: shellapi.h:688
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL showMiniature
Definition: main.cpp:61
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
void placeSelWin()
Definition: mouse.cpp:16
int GetWidth()
Definition: history.cpp:194
#define IDM_EDITINVERTSELECTION
Definition: definitions.h:81
TCHAR filepathname[1000]
Definition: main.cpp:52
CAttributesDialog attributesDialog
Definition: dialogs.cpp:20
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:304
void alignChildrenToMainWindow()
Definition: winproc.cpp:51
int GetHeight()
Definition: history.cpp:199
#define IDM_VIEWZOOM50
Definition: definitions.h:92
LRESULT OnDestroy(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:180
CSizeboxWindow sizeboxLeftCenter
Definition: main.cpp:76
#define IDM_FILEEXIT
Definition: definitions.h:73
#define TB_CHECKBUTTON
Definition: commctrl.h:1039
#define CHECKED_IF(a)
Definition: definitions.h:25
void SetFgColor(int newColor)
ImageModel imageModel
Definition: main.cpp:32
#define TOOL_FREESEL
Definition: definitions.h:135
HWND m_hWnd
Definition: atlwin.h:268
#define IDM_FILEASWALLPAPERPLANE
Definition: definitions.h:63
#define IDM_EDITCUT
Definition: definitions.h:77
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
#define IDM_EDITPASTE
Definition: definitions.h:79
BOOL DestroyWindow()
Definition: atlwin.h:428
static IHTMLWindow2 * window
Definition: events.c:77
CPaletteWindow paletteWindow
Definition: main.cpp:68
BOOL HasUndoSteps()
Definition: history.cpp:172
HINSTANCE hProgInstance
Definition: main.cpp:50
#define IDI_APPICON
Definition: resource.h:166
CString strFile1
Definition: registry.h:30
BOOL SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC)
Definition: dib.cpp:68
void SetZoom(int nZoom)
Definition: toolsmodel.cpp:109
#define LoadCursor
Definition: winuser.h:5787
#define TOOL_RECTSEL
Definition: definitions.h:136
#define IDM_IMAGESTRETCHSKEW
Definition: definitions.h:102
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void ForceRefreshSelectionContents()
Definition: selection.cpp:56
#define IDM_HELPINFO
Definition: definitions.h:114
HWND hwndOwner
Definition: commdlg.h:466
CString strFile4
Definition: registry.h:33
#define IDM_IMAGEDRAWOPAQUE
Definition: definitions.h:107
#define IDM_EDITDELETESELECTION
Definition: definitions.h:80
bool IsEmpty() const
Definition: atlsimpstr.h:379
#define IDM_COLORSMODERNPALETTE
Definition: definitions.h:110
#define IDM_EDITREDO
Definition: definitions.h:76
POINT percentage
Definition: dialogs.h:86
#define IDM_FILESAVEAS
Definition: definitions.h:53
CSizeboxWindow sizeboxLeftBottom
Definition: main.cpp:78
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1265
#define IDM_FILE2
Definition: definitions.h:69
PaletteModel paletteModel
Definition: main.cpp:28
BOOL WINAPI DeleteDC(_In_ HDC)
#define IDM_FILESAVE
Definition: definitions.h:52
LPSTR lpstrFile
Definition: commdlg.h:336
void InsertFromHBITMAP(HBITMAP hBm)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
int GetActiveTool()
Definition: toolsmodel.cpp:60
HGLOBAL hDevNames
Definition: commdlg.h:468
HBITMAP DoLoadImageFile(HWND hwnd, LPCTSTR name, BOOL fIsMainFile)
Definition: dib.cpp:159
#define ENABLED_IF(a)
Definition: definitions.h:27
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:372
#define WM_HSCROLL
Definition: winuser.h:1725
#define IMAGE_BITMAP
Definition: winuser.h:211
#define SB_SETPARTS
Definition: commctrl.h:1950
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
HANDLE WINAPI GetClipboardData(_In_ UINT)
LPWSTR lpstrFileTitle
Definition: commdlg.h:369
CScrollboxWindow scrollboxWindow
Definition: main.cpp:69
#define DragQueryFile
Definition: shellapi.h:682
DWORD lStructSize
Definition: commdlg.h:465
BOOL Invalidate(BOOL bErase=TRUE)
Definition: atlwin.h:828
void Undo(void)
Definition: history.cpp:57
#define IDC_ARROW
Definition: winuser.h:682
void FlipVertically()
Definition: history.cpp:231
WORD nToPage
Definition: commdlg.h:472
CSizeboxWindow sizeboxLeftTop
Definition: main.cpp:73
#define IDM_FILEOPEN
Definition: definitions.h:51
BOOL zoomTo(int newZoom, int mouseX, int mouseY)
Definition: winproc.cpp:21
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:543
#define IDM_FILE3
Definition: definitions.h:70
LRESULT OnSysColorChange(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:364
#define IDM_VIEWZOOM200
Definition: definitions.h:94
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
LRESULT OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:322
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:526
LONG bottom
Definition: windef.h:309
#define IDM_VIEWZOOM800
Definition: definitions.h:96
LRESULT OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:221
DWORD Flags
Definition: commdlg.h:470
#define IDM_FILENEW
Definition: definitions.h:50
static HBITMAP
Definition: button.c:44
#define LoadIcon
Definition: winuser.h:5788
#define IDNO
Definition: winuser.h:830
CTextEditWindow textEditWindow
Definition: main.cpp:81
CHOOSECOLOR choosecolor
Definition: main.cpp:36
#define IDCANCEL
Definition: winuser.h:825
RegistrySettings registrySettings
Definition: main.cpp:30
LONG_PTR LRESULT
Definition: windef.h:209
int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
Definition: atlwin.h:934
#define HtmlHelp
Definition: htmlhelp.h:425
HDC hDC
Definition: commdlg.h:469
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
#define IDM_VIEWSHOWMINIATURE
Definition: definitions.h:99
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
BOOL ConfirmSave()
Definition: winproc.cpp:187
#define SRCCOPY
Definition: wingdi.h:332
#define LoadString
Definition: winuser.h:5794
struct Rect Rect
BOOL IsWindowVisible() const
Definition: atlwin.h:890
CSelectionWindow selectionWindow
Definition: main.cpp:71
#define IDM_VIEWTOOLBOX
Definition: definitions.h:86
#define ICON_BIG
Definition: tnclass.cpp:51
#define WM_VSCROLL
Definition: winuser.h:1726
CMainWindow mainWindow
Definition: main.cpp:63
CString strFile3
Definition: registry.h:32