1 /*
2  * PROJECT:    PAINT for ReactOS
3  * LICENSE:    LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4  * PURPOSE:    Window procedure of the main window and all children apart from
5  *             hPalWin, hToolSettings and hSelection
6  * COPYRIGHT:  Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
7  */
8 
9 #pragma once
10 
11 class CMiniatureWindow : public CWindowImpl<CMiniatureWindow>
12 {
13 public:
14     DECLARE_WND_CLASS_EX(L"MiniatureWindow", CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW,
15                          COLOR_BTNFACE)
16 
17     BEGIN_MSG_MAP(CMiniatureWindow)
18         MESSAGE_HANDLER(WM_MOVE, OnMove)
19         MESSAGE_HANDLER(WM_SIZE, OnSize)
20         MESSAGE_HANDLER(WM_CLOSE, OnClose)
21         MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)
22         MESSAGE_HANDLER(WM_PAINT, OnPaint)
23         MESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo)
24     END_MSG_MAP()
25 
26     CMiniatureWindow();
27     virtual ~CMiniatureWindow();
28 
29     HWND DoCreate(HWND hwndParent);
30 
31 protected:
32     HBITMAP m_hbmCached; // Cached buffer bitmap
33 
34     LRESULT OnMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
35     LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
36     LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
37     LRESULT OnEraseBkgnd(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
38     LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
39     LRESULT OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
40     LRESULT OnGetMinMaxInfo(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
41 };
42