ReactOS 0.4.15-dev-7942-gd23573b
CMiniatureWindow Class Reference

#include <miniature.h>

Inheritance diagram for CMiniatureWindow:
Collaboration diagram for CMiniatureWindow:

Public Member Functions

 DECLARE_WND_CLASS_EX (L"MiniatureWindow", CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW, COLOR_BTNFACE) CMiniatureWindow()
 
virtual ~CMiniatureWindow ()
 
HWND DoCreate (HWND hwndParent)
 

Protected Member Functions

LRESULT OnMove (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnClose (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEraseBkgnd (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnPaint (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetCursor (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetMinMaxInfo (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 

Protected Attributes

HBITMAP m_hbmCached
 

Detailed Description

Definition at line 11 of file miniature.h.

Constructor & Destructor Documentation

◆ ~CMiniatureWindow()

CMiniatureWindow::~CMiniatureWindow ( )
virtual

Definition at line 21 of file miniature.cpp.

22{
23 if (m_hbmCached)
25}
HBITMAP m_hbmCached
Definition: miniature.h:32
pKey DeleteObject()

Member Function Documentation

◆ DECLARE_WND_CLASS_EX()

CMiniatureWindow::DECLARE_WND_CLASS_EX ( L"MiniatureWindow"  ,
CS_DBLCLKS|CS_HREDRAW CS_VREDRAW,
COLOR_BTNFACE   
)

◆ DoCreate()

HWND CMiniatureWindow::DoCreate ( HWND  hwndParent)

Definition at line 27 of file miniature.cpp.

28{
29 if (m_hWnd)
30 return m_hWnd;
31
32 RECT rc =
33 {
37 };
38
39 WCHAR strTitle[100];
41
43 return Create(hwndParent, rc, strTitle, style, WS_EX_PALETTEWINDOW);
44}
Arabic default style
Definition: afstyles.h:94
HINSTANCE g_hinstExe
Definition: main.cpp:17
RegistrySettings registrySettings
Definition: registry.cpp:14
#define IDS_MINIATURETITLE
Definition: resource.h:193
@ Create
Definition: registry.c:563
DWORD ThumbXPos
Definition: registry.h:26
DWORD ThumbYPos
Definition: registry.h:27
DWORD ThumbWidth
Definition: registry.h:25
DWORD ThumbHeight
Definition: registry.h:24
static HWND hwndParent
Definition: cryptui.c:300
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_CAPTION
Definition: pedump.c:624
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_SYSMENU
Definition: pedump.c:629
long LONG
Definition: pedump.c:60
#define WS_THICKFRAME
Definition: pedump.c:630
#define _countof(array)
Definition: sndvol32.h:68
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define WS_EX_PALETTEWINDOW
Definition: winuser.h:399
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CMainWindow::OnCommand(), and CMainWindow::OnCreate().

◆ OnClose()

LRESULT CMiniatureWindow::OnClose ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 70 of file miniature.cpp.

71{
74 return 0;
75}
DWORD ShowThumbnail
Definition: registry.h:22
#define FALSE
Definition: types.h:117
#define SW_HIDE
Definition: winuser.h:768
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)

◆ OnEraseBkgnd()

LRESULT CMiniatureWindow::OnEraseBkgnd ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 77 of file miniature.cpp.

78{
79 return TRUE; /* Avoid flickering */
80}
#define TRUE
Definition: types.h:120

◆ OnGetMinMaxInfo()

LRESULT CMiniatureWindow::OnGetMinMaxInfo ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 121 of file miniature.cpp.

122{
123 // Avoid too small
125 pInfo->ptMinTrackSize = { 100, 75 };
126 return 0;
127}
LPARAM lParam
Definition: combotst.c:139
POINT ptMinTrackSize
Definition: winuser.h:3630
struct tagMINMAXINFO * LPMINMAXINFO

◆ OnMove()

LRESULT CMiniatureWindow::OnMove ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 46 of file miniature.cpp.

47{
48 if (IsWindowVisible() && !IsIconic() && !IsZoomed())
49 {
50 CRect rc;
51 GetWindowRect(&rc);
54 }
55 return 0;
56}
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI IsIconic(_In_ HWND)
BOOL WINAPI IsZoomed(_In_ HWND)
BOOL WINAPI IsWindowVisible(_In_ HWND)

◆ OnPaint()

LRESULT CMiniatureWindow::OnPaint ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 82 of file miniature.cpp.

83{
84 RECT rc;
85 GetClientRect(&rc);
86
87 // Start painting
88 PAINTSTRUCT ps;
89 HDC hDC = BeginPaint(&ps);
90 if (!hDC)
91 return 0;
92
93 // Use a memory bitmap to reduce flickering
97
98 // FIXME: Consider aspect ratio
99
100 // Fill the background
101 ::FillRect(hdcMem, &rc, (HBRUSH)(COLOR_BTNFACE + 1));
102
103 // Draw the image (hdcMem <-- imageModel)
104 int cxImage = imageModel.GetWidth();
105 int cyImage = imageModel.GetHeight();
106 ::StretchBlt(hdcMem, 0, 0, rc.right, rc.bottom,
107 imageModel.GetDC(), 0, 0, cxImage, cyImage,
108 SRCCOPY);
109
110 // Move the image (hDC <-- hdcMem)
111 ::BitBlt(hDC, 0, 0, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY);
112
113 // Clean up
114 ::SelectObject(hdcMem, hbmOld);
116
117 EndPaint(&ps);
118 return 0;
119}
static HDC hDC
Definition: 3dtext.c:33
int GetWidth() const
Definition: history.cpp:253
int GetHeight() const
Definition: history.cpp:258
HDC GetDC()
Definition: history.cpp:271
HBITMAP CachedBufferDIB(HBITMAP hbm, int minimalWidth, int minimalHeight)
Definition: dib.cpp:115
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
ImageModel imageModel
Definition: history.cpp:11
static HDC
Definition: imagelist.c:92
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
HDC hdcMem
Definition: welcome.c:104
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define SRCCOPY
Definition: wingdi.h:333
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define COLOR_BTNFACE
Definition: winuser.h:928

◆ OnSetCursor()

LRESULT CMiniatureWindow::OnSetCursor ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

◆ OnSize()

LRESULT CMiniatureWindow::OnSize ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
protected

Definition at line 58 of file miniature.cpp.

59{
60 if (IsWindowVisible() && !IsIconic() && !IsZoomed())
61 {
62 CRect rc;
63 GetWindowRect(&rc);
66 }
67 return 0;
68}
int Width() const noexcept
Definition: atltypes.h:461
int Height() const noexcept
Definition: atltypes.h:318

Member Data Documentation

◆ m_hbmCached

HBITMAP CMiniatureWindow::m_hbmCached
protected

Definition at line 32 of file miniature.h.

Referenced by OnPaint(), and ~CMiniatureWindow().


The documentation for this class was generated from the following files: