ReactOS 0.4.15-dev-8100-g1887773
proclist.c File Reference
#include "precomp.h"
Include dependency graph for proclist.c:

Go to the source code of this file.

Functions

INT_PTR CALLBACK ProcessListWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Variables

WNDPROC OldProcessListWndProc
 

Function Documentation

◆ ProcessListWndProc()

INT_PTR CALLBACK ProcessListWndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 16 of file proclist.c.

17{
18 HBRUSH hbrBackground;
19 RECT rcItem;
20 RECT rcClip;
21 HDC hDC;
22 int DcSave;
23
24 switch (message)
25 {
26 case WM_ERASEBKGND:
27
28 /*
29 * The list control produces a nasty flicker
30 * when the user is resizing the window because
31 * it erases the background to white, then
32 * paints the list items over it.
33 *
34 * We will clip the drawing so that it only
35 * erases the parts of the list control that
36 * show only the background.
37 */
38
39 /*
40 * Get the device context and save it's state
41 * to be restored after we're done
42 */
43 hDC = (HDC) wParam;
44 DcSave = SaveDC(hDC);
45
46 /*
47 * Get the background brush
48 */
50
51 /*
52 * Calculate the clip rect by getting the RECT
53 * of the first and last items and adding them up.
54 *
55 * We also have to get the item's icon RECT and
56 * subtract it from our clip rect because we don't
57 * use icons in this list control.
58 */
59 rcClip.left = LVIR_BOUNDS;
61 rcItem.left = LVIR_BOUNDS;
63 rcClip.bottom = rcItem.bottom;
64 rcClip.right = rcItem.right;
65 rcItem.left = LVIR_ICON;
67 rcClip.left = rcItem.right;
68
69 /*
70 * Now exclude the clip rect
71 */
72 ExcludeClipRect(hDC, rcClip.left, rcClip.top, rcClip.right, rcClip.bottom);
73
74 /*
75 * Now erase the background
76 *
77 *
78 * FIXME: Should I erase it myself or
79 * pass down the updated HDC and let
80 * the default handler do it?
81 */
82 GetClientRect(hWnd, &rcItem);
83 FillRect(hDC, &rcItem, hbrBackground);
84
85 /*
86 * Now restore the DC state that we
87 * saved earlier
88 */
89 RestoreDC(hDC, DcSave);
90
91 return TRUE;
92 }
93
94 /*
95 * We pass on all messages except WM_ERASEBKGND
96 */
98}
static HDC hDC
Definition: 3dtext.c:33
HWND hWnd
Definition: settings.c:17
WNDPROC OldProcessListWndProc
Definition: proclist.c:12
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
HBRUSH hbrBackground
Definition: enumwnd.c:12
static HDC
Definition: imagelist.c:92
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LVIR_ICON
Definition: commctrl.h:2473
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
#define LVM_GETITEMRECT
Definition: commctrl.h:2477
#define LVIR_BOUNDS
Definition: commctrl.h:2472
Definition: tftpd.h:60
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG_PTR LPARAM
Definition: windef.h:208
int WINAPI ExcludeClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SaveDC(_In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1625
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define GCL_HBRBACKGROUND
Definition: winuser.h:664
#define GetClassLongPtrW
Definition: winuser.h:4564
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by ProcessPageWndProc().

Variable Documentation

◆ OldProcessListWndProc

WNDPROC OldProcessListWndProc

Definition at line 12 of file proclist.c.

Referenced by ProcessListWndProc(), and ProcessPageWndProc().