[MSPAINT_NEW] split CMainWindow: factor out CImgAreaWindow and CMiniatureWindow ...
[reactos.git] / reactos / base / applications / mspaint_new / miniature.cpp
1 /*
2 * PROJECT: PAINT for ReactOS
3 * LICENSE: LGPL
4 * FILE: base/applications/mspaint_new/miniature.cpp
5 * PURPOSE: Window procedure of the main window and all children apart from
6 * hPalWin, hToolSettings and hSelection
7 * PROGRAMMERS: Benedikt Freisen
8 */
9
10 /* INCLUDES *********************************************************/
11
12 #include "precomp.h"
13
14 /* FUNCTIONS ********************************************************/
15
16 LRESULT CMiniatureWindow::OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
17 {
18 miniature.ShowWindow(SW_HIDE);
19 showMiniature = FALSE;
20 return 0;
21 }
22
23 LRESULT CMiniatureWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
24 {
25 DefWindowProc(WM_PAINT, wParam, lParam);
26 RECT mclient;
27 HDC hdc;
28 miniature.GetClientRect(&mclient);
29 hdc = miniature.GetDC();
30 StretchBlt(hdc, 0, 0, mclient.right, mclient.bottom, hDrawingDC, 0, 0, imgXRes, imgYRes, SRCCOPY);
31 miniature.ReleaseDC(hdc);
32 return 0;
33 }
34
35 LRESULT CMiniatureWindow::OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
36 {
37 SetCursor(LoadCursor(NULL, IDC_ARROW));
38 return 0;
39 }