ReactOS 0.4.15-dev-8146-gdc0ed6d
lrgcell.c File Reference
#include "precomp.h"
Include dependency graph for lrgcell.c:

Go to the source code of this file.

Functions

static HFONT SetLrgFont (PMAP infoPtr)
 
LRESULT CALLBACK LrgCellWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ LrgCellWndProc()

LRESULT CALLBACK LrgCellWndProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 68 of file lrgcell.c.

72{
73 PMAP infoPtr;
74 LRESULT Ret = 0;
75 static INT cxClient, cyClient;
76 static RECT rc;
77 static HFONT hFont = NULL;
78
79 infoPtr = (PMAP)GetWindowLongPtrW(hwnd,
81
82 if (infoPtr == NULL && uMsg != WM_CREATE)
83 {
84 goto HandleDefaultMessage;
85 }
86
87 switch (uMsg)
88 {
89 case WM_CREATE:
90 {
91 infoPtr = (PMAP)(((LPCREATESTRUCTW)lParam)->lpCreateParams);
92
95 (LONG_PTR)infoPtr);
96
97 hFont = SetLrgFont(infoPtr);
98
99 break;
100 }
101
102 case WM_SIZE:
103 {
104 cxClient = LOWORD(lParam);
105 cyClient = HIWORD(lParam);
106
107 rc.left = 0;
108 rc.top = 0;
109 rc.right = cxClient;
110 rc.bottom = cyClient;
111
112 break;
113 }
114
115 case WM_PAINT:
116 {
117 PAINTSTRUCT ps;
118 HDC hdc;
119 HFONT hOldFont;
120
122 &ps);
123
125 0,
126 0,
127 cxClient,
128 cyClient);
129
130 hOldFont = SelectObject(hdc, hFont);
131
133 &infoPtr->pActiveCell->ch,
134 1,
135 &rc,
137
138 SelectObject(hdc, hOldFont);
139
141 &ps);
142
143 UpdateStatusBar(infoPtr->pActiveCell->ch);
144 break;
145 }
146
147 case WM_DESTROY:
148 {
150
151 break;
152 }
153
154 default:
155 {
156HandleDefaultMessage:
157 Ret = DefWindowProcW(hwnd,
158 uMsg,
159 wParam,
160 lParam);
161 break;
162 }
163 }
164
165 return Ret;
166}
struct _MAP * PMAP
HFONT hFont
Definition: main.c:53
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
pKey DeleteObject()
static HFONT SetLrgFont(PMAP infoPtr)
Definition: lrgcell.c:14
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define LOWORD(l)
Definition: pedump.c:82
void UpdateStatusBar(void)
Definition: solitaire.cpp:150
WCHAR ch
Definition: precomp.h:40
Definition: precomp.h:44
PCELL pActiveCell
Definition: precomp.h:51
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define GWLP_USERDATA
Definition: treelist.c:63
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LRESULT
Definition: windef.h:209
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define WM_PAINT
Definition: winuser.h:1620
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define DT_CENTER
Definition: winuser.h:527
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1608
#define WM_SIZE
Definition: winuser.h:1611
#define DT_SINGLELINE
Definition: winuser.h:540
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DT_VCENTER
Definition: winuser.h:543
#define WM_DESTROY
Definition: winuser.h:1609
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5346

Referenced by RegisterMapClasses().

◆ SetLrgFont()

static HFONT SetLrgFont ( PMAP  infoPtr)
static

Definition at line 14 of file lrgcell.c.

15{
16 LOGFONTW lf;
18 HDC hdc;
19 HWND hCombo;
20 LPWSTR lpFontName;
21 INT Len;
22
23 hCombo = GetDlgItem(infoPtr->hParent,
25
26 Len = GetWindowTextLengthW(hCombo);
27
28 if (Len != 0)
29 {
30 lpFontName = HeapAlloc(GetProcessHeap(),
31 0,
32 (Len + 1) * sizeof(WCHAR));
33
34 if (lpFontName)
35 {
36 SendMessageW(hCombo,
38 Len + 1,
39 (LPARAM)lpFontName);
40
41 ZeroMemory(&lf,
42 sizeof(lf));
43
44 hdc = GetDC(infoPtr->hLrgWnd);
46 LOGPIXELSY) / 2;
47 ReleaseDC(infoPtr->hLrgWnd,
48 hdc);
49
52 lpFontName,
53 sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]));
54
56
58 0,
59 lpFontName);
60 }
61 }
62
63 return hFont;
64}
#define IDC_FONTCOMBO
Definition: resource.h:12
#define Len
Definition: deflate.h:82
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
LONG lfHeight
Definition: dimm.idl:59
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfCharSet
Definition: dimm.idl:67
HWND hLrgWnd
Definition: precomp.h:47
HWND hParent
Definition: precomp.h:46
#define ZeroMemory
Definition: winbase.h:1712
LONG_PTR LPARAM
Definition: windef.h:208
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define DEFAULT_CHARSET
Definition: wingdi.h:384
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_GETTEXT
Definition: winuser.h:1618
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HDC WINAPI GetDC(_In_opt_ HWND)
int WINAPI GetWindowTextLengthW(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by LrgCellWndProc().