ReactOS 0.4.15-dev-7654-g6bc40d3
winxx.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS header files
3 * LICENSE: CC-BY-4.0 (https://spdx.org/licenses/CC-BY-4.0)
4 * PURPOSE: An unofficial extension of <windowsx.h>
5 * COPYRIGHT: Copyright 2017-2019 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6 */
7
8#ifndef _INC_WINXX
9#define _INC_WINXX 8 /* Version 8 */
10
11#pragma once
12
13#ifndef _INC_WINDOWS
14 #include <windows.h>
15#endif
16#ifndef _INC_WINDOWSX
17 #include <windowsx.h>
18#endif
19#ifndef _INC_COMMCTRL
20 #include <commctrl.h>
21#endif
22#ifndef _RICHEDIT_
23 #include <richedit.h>
24#endif
25
26/* additional message crackers */
27
28/* void Cls_OnNull(HWND hwnd) */
29#ifndef HANDLE_WM_NULL
30#define HANDLE_WM_NULL(hwnd, wParam, lParam, fn) \
31 ((fn)((hwnd)), 0L)
32#define FORWARD_WM_NULL(hwnd, fn) \
33 ((fn)((hwnd), WM_NULL, 0, 0L), 0L)
34#endif
35
36/* INT Cls_OnSetHotKey(HWND hwnd, INT nCode, UINT nOptions) */
37#ifndef HANDLE_WM_SETHOTKEY
38#define HANDLE_WM_SETHOTKEY(hwnd, wParam, lParam, fn) \
39 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)LOWORD(wParam), (UINT)HIWORD(wParam))
40#define FORWARD_WM_SETHOTKEY(hwnd, nCode, nOptions, fn) \
41 (INT)(fn)((hwnd), WM_SETHOTKEY, MAKEWPARAM((nCode), (nOptions)))
42#endif
43
44/* INT Cls_OnGetHotKey(HWND hwnd) */
45#ifndef HANDLE_WM_GETHOTKEY
46#define HANDLE_WM_GETHOTKEY(hwnd, wParam, lParam, fn) \
47 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
48#define FORWARD_WM_GETHOTKEY(hwnd, fn) \
49 (INT)(fn)((hwnd), WM_GETHOTKEY, 0, 0L)
50#endif
51
52/* void Cls_OnPaintIcon(HWND hwnd) */
53#ifndef HANDLE_WM_PAINTICON
54#define HANDLE_WM_PAINTICON(hwnd, wParam, lParam, fn) \
55 ((fn)((hwnd)), 0L)
56#define FORWARD_WM_PAINTICON(hwnd, fn) \
57 ((fn)((hwnd), WM_PAINTICON, 0, 0L), 0L)
58#endif
59
60/* LRESULT Cls_OnGetObject(HWND hwnd, WPARAM wParam, DWORD dwObjId) */
61#ifndef HANDLE_WM_GETOBJECT
62#define HANDLE_WM_GETOBJECT(hwnd, wParam, lParam, fn) \
63 (LRESULT)(fn)((hwnd), (WPARAM)(wParam), (DWORD)(lParam))
64#define FORWARD_WM_GETOBJECT(hwnd, wParam, dwObjId, fn) \
65 (fn)((hwnd), WM_GETOBJECT, (WPARAM)(wParam), (LPARAM)(DWORD)(dwObjId))
66#endif
67
68/* void Cls_OnCancelJournal(HWND hwnd) */
69#ifndef HANDLE_WM_CANCELJOURNAL
70#define HANDLE_WM_CANCELJOURNAL(hwnd, wParam, lParam, fn) \
71 ((fn)((hwnd)), 0L)
72#define FORWARD_WM_CANCELJOURNAL(hwnd, fn) \
73 ((fn)((hwnd), WM_PAINTICON, 0, 0L), 0L)
74#endif
75
76/* void Cls_OnInputLangChangeRequest(HWND hwnd, BOOL bFlag, HKL hKL) */
77#ifndef HANDLE_WM_INPUTLANGCHANGEREQUEST
78#define HANDLE_WM_INPUTLANGCHANGEREQUEST(hwnd, wParam, lParam, fn) \
79 ((fn)((hwnd), (BOOL)(wParam), (HKL)(lParam)), 0L)
80#define FORWARD_WM_INPUTLANGCHANGEREQUEST(hwnd, bFlag, hKL, fn) \
81 ((fn)((hwnd), WM_INPUTLANGCHANGEREQUEST, (WPARAM)(BOOL)(bFlag), \
82 (LPARAM)(HKL)(hKL)), 0L)
83#endif
84
85/* void Cls_OnInputLangChange(HWND hwnd, DWORD dwCharSet, HKL hKL) */
86#ifndef HANDLE_WM_INPUTLANGCHANGE
87#define HANDLE_WM_INPUTLANGCHANGE(hwnd, wParam, lParam, fn) \
88 ((fn)((hwnd), (DWORD)(wParam), (HKL)(lParam)), 0L)
89#define FORWARD_WM_INPUTLANGCHANGE(hwnd, dwCharSet, hKL, fn) \
90 ((fn)((hwnd), WM_INPUTLANGCHANGE, (WPARAM)(DWORD)(dwCharSet), \
91 (LPARAM)(HKL)(hKL)), 0L)
92#endif
93
94/* void Cls_OnTCard(HWND hwnd, UINT idAction, DWORD dwActionData) */
95#ifndef HANDLE_WM_TCARD
96#define HANDLE_WM_TCARD(hwnd, wParam, lParam, fn) \
97 ((fn)((hwnd), (UINT)(wParam), (DWORD)(lParam)), 0L)
98#define FORWARD_WM_TCARD(hwnd, idAction, dwActionData, fn) \
99 ((fn)((hwnd), WM_TCARD, (DWORD)(wParam), (DWORD)(lParam)), 0L)
100#endif
101
102/* void Cls_OnHelp(HWND hwnd, LPHELPINFO lpHelpInfo) */
103#ifndef HANDLE_WM_HELP
104#define HANDLE_WM_HELP(hwnd, wParam, lParam, fn) \
105 ((fn)((hwnd), (LPHELPINFO)(lParam)), 0L)
106#define FORWARD_WM_HELP(hwnd, lpHelpInfo, fn) \
107 ((fn)((hwnd), WM_HELP, 0, (LPARAM)(LPHELPINFO)(lpHelpInfo)), 0L)
108#endif
109
110/* void Cls_OnUserChanged(HWND hwnd) */
111#ifndef HANDLE_WM_USERCHANGED
112#define HANDLE_WM_USERCHANGED(hwnd, wParam, lParam, fn) \
113 ((fn)((hwnd)), 0L)
114#define FORWARD_WM_USERCHANGED(hwnd, fn) \
115 ((fn)((hwnd), WM_USERCHANGED, 0, 0L), 0L)
116#endif
117
118/* INT Cls_OnNotifyFormat(HWND hwnd, HWND hwndTarget, INT nCommand) */
119#ifndef HANDLE_WM_NOTIFYFORMAT
120#define HANDLE_WM_NOTIFYFORMAT(hwnd, wParam, lParam, fn) \
121 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (HWND)(wParam), (INT)(lParam))
122#define FORWARD_WM_NOTIFYFORMAT(hwnd, hwndTarget, nCommand, fn) \
123 (INT)(fn)((hwnd), WM_NOTIFYFORMAT, (WPARAM)(HWND)(hwndTarget), \
124 (LPARAM)(INT)(nCommand))
125#endif
126
127/* void Cls_OnStyleChanging(HWND hwnd, UINT nStyleType, LPSTYLESTRUCT lpStyleStruct) */
128#ifndef HANDLE_WM_STYLECHANGING
129#define HANDLE_WM_STYLECHANGING(hwnd, wParam, lParam, fn) \
130 ((fn)((hwnd), (UINT)(wParam), (LPSTYLESTRUCT)(lParam)), 0L)
131#define FORWARD_WM_STYLECHANGING(hwnd, nStyleType, lpStyleStruct, fn) \
132 ((fn)((hwnd), WM_STYLECHANGING, (WPARAM)(UINT)(nStyleType), \
133 (LPARAM)(LPSTYLESTRUCT)(lpStyleStruct)), 0L)
134#endif
135
136/* void Cls_OnStyleChanged(HWND hwnd, UINT nStyleType, const STYLESTRUCT *lpStyleStruct) */
137#ifndef HANDLE_WM_STYLECHANGED
138#define HANDLE_WM_STYLECHANGED(hwnd, wParam, lParam, fn) \
139 ((fn)((hwnd), (UINT)(wParam), (const STYLESTRUCT *)(lParam)), 0L)
140#define FORWARD_WM_STYLECHANGED(hwnd, nStyleType, lpStyleStruct, fn) \
141 ((fn)((hwnd), WM_STYLECHANGED, (WPARAM)(UINT)(nStyleType), \
142 (LPARAM)(const STYLESTRUCT *)(lpStyleStruct)), 0L)
143#endif
144
145/* HICON Cls_OnGetIcon(HWND hwnd, UINT nType, LPARAM dpi) */
146#ifndef HANDLE_WM_GETICON
147#define HANDLE_WM_GETICON(hwnd, wParam, lParam, fn) \
148 (LRESULT)(HICON)(fn)((hwnd), (INT)(wParam), (LPARAM)(lParam))
149#define FORWARD_WM_GETICON(hwnd, nType, dpi, fn) \
150 (HICON)(fn)((hwnd), WM_GETICON, (WPARAM)(UINT)(nType), (LPARAM)(dpi))
151#endif
152
153/* HICON Cls_OnSetIcon(HWND hwnd, UINT nType, HICON hIcon) */
154#ifndef HANDLE_WM_SETICON
155#define HANDLE_WM_SETICON(hwnd, wParam, lParam, fn) \
156 (LRESULT)(HICON)(fn)((hwnd), (INT)(wParam), (HICON)(lParam))
157#define FORWARD_WM_SETICON(hwnd, nType, hIcon, fn) \
158 (HICON)(fn)((hwnd), WM_SETICON, (WPARAM)(UINT)(nType), (LPARAM)(HICON)(hIcon))
159#endif
160
161/* void Cls_OnSyncPaint(HWND hwnd) */
162#ifndef HANDLE_WM_SYNCPAINT
163#define HANDLE_WM_SYNCPAINT(hwnd, wParam, lParam, fn) \
164 ((fn)((hwnd)), 0L)
165#define FORWARD_WM_SYNCPAINT(hwnd, fn) \
166 ((fn)((hwnd), WM_SYNCPAINT, 0, 0L), 0L)
167#endif
168
169/* void Cls_OnNCXButtonDown(HWND hwnd, BOOL fDoubleClick, UINT nHitTest, WORD fwButton, INT xPos, INT yPos) */
170#ifndef HANDLE_WM_NCXBUTTONDOWN
171#define HANDLE_WM_NCXBUTTONDOWN(hwnd, wParam, lParam, fn) \
172 (LRESULT)((fn)((hwnd), FALSE, GET_NCHITTEST_WPARAM(wParam), GET_XBUTTON_WPARAM(wParam), \
173 GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), TRUE)
174#define HANDLE_WM_NCXBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
175 (LRESULT)((fn)((hwnd), TRUE, GET_NCHITTEST_WPARAM(wParam), GET_XBUTTON_WPARAM(wParam), \
176 GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), TRUE)
177#define FORWARD_WM_NCXBUTTONDOWN(hwnd, fDoubleClick, nHitTest, fwButton, xPos, yPos, fn) \
178 ((fn)((hwnd), ((fDoubleClick) ? WM_NCXBUTTONDBLCLK : WM_NCXBUTTONDOWN), \
179 MAKEWPARAM((nHitTest), (fwButton)), MAKELPARAM((xPos), (yPos))), 0L)
180#endif
181
182/* void Cls_OnNCXButtonUp(HWND hwnd, UINT nHitTest, WORD fwButton, INT xPos, INT yPos) */
183#ifndef HANDLE_WM_NCXBUTTONUP
184#define HANDLE_WM_NCXBUTTONUP(hwnd, wParam, lParam, fn) \
185 (LRESULT)((fn)((hwnd), GET_NCHITTEST_WPARAM(wParam), GET_XBUTTON_WPARAM(wParam), \
186 GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), TRUE)
187#define FORWARD_WM_NCXBUTTONUP(hwnd, nHitTest, fwButton, xPos, yPos, fn) \
188 ((fn)((hwnd), WM_NCXBUTTONUP, MAKEWPARAM((nHitTest), (fwButton)), \
189 MAKELPARAM((xPos), (yPos))), 0L)
190#endif
191
192/* void Cls_OnImeStartComposition(HWND hwnd) */
193#ifndef HANDLE_WM_IME_STARTCOMPOSITION
194#define HANDLE_WM_IME_STARTCOMPOSITION(hwnd, wParam, lParam, fn) \
195 ((fn)((hwnd)), 0L)
196#define FORWARD_WM_IME_STARTCOMPOSITION(hwnd, fn) \
197 ((fn)((hwnd), WM_IME_STARTCOMPOSITION, 0, 0L), 0L)
198#endif
199
200/* void Cls_OnImeEndComposition(HWND hwnd) */
201#ifndef HANDLE_WM_IME_ENDCOMPOSITION
202#define HANDLE_WM_IME_ENDCOMPOSITION(hwnd, wParam, lParam, fn) \
203 ((fn)((hwnd)), 0L)
204#define FORWARD_WM_IME_ENDCOMPOSITION(hwnd, fn) \
205 ((fn)((hwnd), WM_IME_ENDCOMPOSITION, 0, 0L), 0L)
206#endif
207
208/* void Cls_OnImeComposition(HWND hwnd, WORD wChar, DWORD lAttribute) */
209#ifndef HANDLE_WM_IME_COMPOSITION
210#define HANDLE_WM_IME_COMPOSITION(hwnd, wParam, lParam, fn) \
211 ((fn)((hwnd), (WORD)(wParam), (DWORD)(lParam)), 0L)
212#define FORWARD_WM_IME_COMPOSITION(hwnd, wChar, lAttribute, fn) \
213 ((fn)((hwnd), WM_IME_COMPOSITION, (WPARAM)(WORD)(wChar), (DWORD)(lAttribute)), 0L)
214#endif
215
216/* void Cls_OnMenuRButtonUp(HWND hwnd, UINT nPos, HMENU hMenu) */
217#ifndef HANDLE_WM_MENURBUTTONUP
218#define HANDLE_WM_MENURBUTTONUP(hwnd, wParam, lParam, fn) \
219 ((fn)((hwnd), (UINT)(wParam), (HMENU)(lParam)), 0L)
220#define FORWARD_WM_MENURBUTTONUP(hwnd, nPos, hMenu, fn) \
221 ((fn)((hwnd), WM_MENURBUTTONUP, (WPARAM)(UINT)(nPos), (LPARAM)(HMENU)(hMenu)), 0L)
222#endif
223
224/* UINT Cls_OnMenuDrag(HWND hwnd, UINT nPos, HMENU hMenu) */
225#ifndef HANDLE_WM_MENUDRAG
226#define HANDLE_WM_MENUDRAG(hwnd, wParam, lParam, fn) \
227 (LRESULT)(UINT)(fn)((hwnd), (UINT)(wParam), (HMENU)(lParam))
228#define FORWARD_WM_MENUDRAG(hwnd, nPos, hMenu, fn) \
229 (UINT)(fn)((hwnd), WM_MENUDRAG, (WPARAM)(UINT)(nPos), (LPARAM)(HMENU)(hMenu))
230#endif
231
232/* UINT Cls_OnMenuGetObject(HWND hwnd, MENUGETOBJECTINFO *pmgoi) */
233#ifndef HANDLE_WM_MENUGETOBJECT
234#define HANDLE_WM_MENUGETOBJECT(hwnd, wParam, lParam, fn) \
235 (LRESULT)(UINT)(fn)((hwnd), (MENUGETOBJECTINFO *)(lParam))
236#define FORWARD_WM_MENUGETOBJECT(hwnd, pmgoi, fn) \
237 (UINT)(fn)((hwnd), WM_MENUGETOBJECT, 0, (LPARAM)(MENUGETOBJECTINFO *)(pmgoi))
238#endif
239
240/* void Cls_OnUninitMenuPopup(HWND hwnd, HMENU hMenu, UINT nFlags) */
241#ifndef HANDLE_WM_UNINITMENUPOPUP
242#define HANDLE_WM_UNINITMENUPOPUP(hwnd, wParam, lParam, fn) \
243 ((fn)((hwnd), (HMENU)(wParam), (UINT)(lParam)), 0L)
244#define FORWARD_WM_UNINITMENUPOPUP(hwnd, hMenu, nFlags, fn) \
245 ((fn)((hwnd), WM_UNINITMENUPOPUP, (WPARAM)(HMENU)(hMenu), \
246 (LPARAM)(UINT)(nFlags)), 0L)
247#endif
248
249/* void Cls_OnMenuCommand(HWND hwnd, UINT nPos, HMENU hMenu) */
250#ifndef HANDLE_WM_MENUCOMMAND
251#define HANDLE_WM_MENUCOMMAND(hwnd, wParam, lParam, fn) \
252 ((fn)((hwnd), (UINT)(wParam), (HMENU)(lParam)), 0L)
253#define FORWARD_WM_MENUCOMMAND(hwnd, nPos, hMenu, fn) \
254 ((fn)((hwnd), WM_MENURBUTTONUP, (WPARAM)(UINT)(nPos), \
255 (LPARAM)(HMENU)(hMenu)), 0L)
256#endif
257
258/* void Cls_OnChangeUIState(HWND hwnd, UINT nAction, UINT nUIElement) */
259#ifndef HANDLE_WM_CHANGEUISTATE
260#define HANDLE_WM_CHANGEUISTATE(hwnd, wParam, lParam, fn) \
261 ((fn)((hwnd), (UINT)LOWORD(wParam), (UINT)HIWORD(wParam)), 0L)
262#define FORWARD_WM_CHANGEUISTATE(hwnd, nAction, nUIElement, fn) \
263 ((fn)((hwnd), WM_CHANGEUISTATE, MAKEWPARAM((nAction), (nUIElement)), 0L), 0L)
264#endif
265
266/* void Cls_OnUpdateUIState(HWND hwnd, UINT nAction, UINT nUIElement) */
267#ifndef HANDLE_WM_UPDATEUISTATE
268#define HANDLE_WM_UPDATEUISTATE(hwnd, wParam, lParam, fn) \
269 ((fn)((hwnd), (UINT)LOWORD(wParam), (UINT)HIWORD(wParam)), 0L)
270#define FORWARD_WM_UPDATEUISTATE(hwnd, nAction, nUIElement, fn) \
271 ((fn)((hwnd), WM_UPDATEUISTATE, MAKEWPARAM((nAction), (nUIElement)), 0L), 0L)
272#endif
273
274/* UINT Cls_OnQueryUIState(HWND hwnd) */
275#ifndef HANDLE_WM_QUERYUISTATE
276#define HANDLE_WM_QUERYUISTATE(hwnd, wParam, lParam, fn) \
277 (LRESULT)(UINT)(fn)((hwnd))
278#define FORWARD_WM_QUERYUISTATE(hwnd, fn) \
279 (UINT)(fn)((hwnd), WM_QUERYUISTATE, 0, 0L)
280#endif
281
282/* void Cls_OnXButtonDown(HWND hwnd, BOOL fDoubleClick, WORD fwKeys, WORD fwButton, INT xPos, INT yPos) */
283#ifndef HANDLE_WM_XBUTTONDOWN
284#define HANDLE_WM_XBUTTONDOWN(hwnd, wParam, lParam, fn) \
285 (LRESULT)((fn)((hwnd), FALSE, GET_KEYSTATE_WPARAM(wParam), GET_XBUTTON_WPARAM(wParam), \
286 GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), TRUE)
287#define HANDLE_WM_XBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
288 (LRESULT)((fn)((hwnd), TRUE, GET_KEYSTATE_WPARAM(wParam), GET_XBUTTON_WPARAM(wParam), \
289 GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), TRUE)
290#define FORWARD_WM_XBUTTONDOWN(hwnd, fDoubleClick, fwKeys, fwButton, xPos, yPos, fn) \
291 ((fn)((hwnd), ((fDoubleClick) ? WM_XBUTTONDBLCLK : WM_XBUTTONDOWN), \
292 MAKEWPARAM((fwKeys), (fwButton)), MAKELPARAM((xPos), (yPos))), 0L)
293#endif
294
295/* void Cls_OnXButtonUp(HWND hwnd, WORD fwKeys, WORD fwButton, INT xPos, INT yPos) */
296#ifndef HANDLE_WM_XBUTTONUP
297#define HANDLE_WM_XBUTTONUP(hwnd, wParam, lParam, fn) \
298 (LRESULT)((fn)((hwnd), GET_KEYSTATE_WPARAM(wParam), GET_XBUTTON_WPARAM(wParam), \
299 GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), TRUE)
300#define FORWARD_WM_XBUTTONUP(hwnd, fDoubleClick, fwKeys, fwButton, xPos, yPos, fn) \
301 ((fn)((hwnd), WM_XBUTTONUP, MAKEWPARAM((fwKeys), (fwButton)), \
302 MAKELPARAM((xPos), (yPos))), 0L)
303#endif
304
305/* void Cls_OnEnterMenuLoop(HWND hwnd, BOOL bIsTrackPopupMenu) */
306#ifndef HANDLE_WM_ENTERMENULOOP
307#define HANDLE_WM_ENTERMENULOOP(hwnd, wParam, lParam, fn) \
308 ((fn)((hwnd), (BOOL)(wParam)), 0L)
309#define FORWARD_WM_ENTERMENULOOP(hwnd, bIsTrackPopupMenu, fn) \
310 ((fn)((hwnd), WM_ENTERMENULOOP, (BOOL)(bIsTrackPopupMenu), 0L), 0L)
311#endif
312
313/* void Cls_OnExitMenuLoop(HWND hwnd, BOOL bIsTrackPopupMenu) */
314#ifndef HANDLE_WM_EXITMENULOOP
315#define HANDLE_WM_EXITMENULOOP(hwnd, wParam, lParam, fn) \
316 ((fn)((hwnd), (BOOL)(wParam)), 0L)
317#define FORWARD_WM_EXITMENULOOP(hwnd, bIsTrackPopupMenu, fn) \
318 ((fn)((hwnd), WM_EXITMENULOOP, (BOOL)(bIsTrackPopupMenu), 0L), 0L)
319#endif
320
321/* void Cls_OnNextMenu(HWND hwnd, INT nCode, LPMDINEXTMENU lpMDINextMenu) */
322#ifndef HANDLE_WM_NEXTMENU
323#define HANDLE_WM_NEXTMENU(hwnd, wParam, lParam, fn) \
324 ((fn)((hwnd), (INT)(wParam), (LPMDINEXTMENU)(lParam)), 0L)
325#define FORWARD_WM_NEXTMENU(hwnd, nCode, lpMDINextMenu, fn) \
326 ((fn)((hwnd), WM_NEXTMENU, (WPARAM)(INT)(nCode), \
327 (LPARAM)(LPMDINEXTMENU)(lpMDINextMenu)), 0L)
328#endif
329
330/* void Cls_OnSizing(HWND hwnd, UINT nSide, LPRECT lpRect) */
331#ifndef HANDLE_WM_SIZING
332#define HANDLE_WM_SIZING(hwnd, wParam, lParam, fn) \
333 ((fn)((hwnd), (UINT)(wParam), (LPRECT)(lParam)), 0L)
334#define FORWARD_WM_SIZING(hwnd, nSide, lpRect, fn) \
335 ((fn)((hwnd), WM_SIZING, (WPARAM)(UINT)(nSide), (LPARAM)(LPRECT)(lpRect)), 0L)
336#endif
337
338/* void Cls_OnCaptureChanged(HWND hwnd, HWND hwndNewCapture) */
339#ifndef HANDLE_WM_CAPTURECHANGED
340#define HANDLE_WM_CAPTURECHANGED(hwnd, wParam, lParam, fn) \
341 ((fn)((hwnd), (HWND)(lParam)), 0L)
342#define FORWARD_WM_CAPTURECHANGED(hwnd, hwndNewCapture, fn) \
343 ((fn)((hwnd), WM_CAPTURECHANGED, 0, (LPARAM)(HWND)(hwndNewCapture)), 0L)
344#endif
345
346/* void Cls_OnMoving(HWND hwnd, UINT nSide, LPRECT lpRect) */
347#ifndef HANDLE_WM_MOVING
348#define HANDLE_WM_MOVING(hwnd, wParam, lParam, fn) \
349 ((fn)((hwnd), (UINT)(wParam), (LPRECT)(lParam)), 0L)
350#define FORWARD_WM_MOVING(hwnd, nSide, lpRect, fn) \
351 ((fn)((hwnd), WM_MOVING, (WPARAM)(UINT)(nSide), (LPARAM)(LPRECT)(lpRect)), 0L)
352#endif
353
354/* LRESULT Cls_OnPowerBroadcast(HWND hwnd, UINT nPowerEvent, UINT nEventData) */
355#ifndef HANDLE_WM_POWERBROADCAST
356#define HANDLE_WM_POWERBROADCAST(hwnd, wParam, lParam, fn) \
357 (LRESULT)(fn)((hwnd), (UINT)(wParam), (UINT)(lParam))
358#define FORWARD_WM_POWERBROADCAST(hwnd, nPowerEvent, nEventData, fn) \
359 (LRESULT)(fn)((hwnd), WM_POWERBROADCAST, (WPARAM)(UINT)(nPowerEvent), \
360 (LPARAM)(UINT)(nEventData))
361#endif
362
363/* HMENU Cls_MDIRefreshMenu(HWND hwnd) */
364#ifndef HANDLE_WM_MDIREFRESHMENU
365#define HANDLE_WM_MDIREFRESHMENU(hwnd, wParam, lParam, fn) \
366 (LRESULT)(HMENU)(fn)((hwnd))
367#define FORWARD_WM_MDIREFRESHMENU(hwnd, fn) \
368 (HMENU)(fn)((hwnd), WM_MDIREFRESHMENU, 0, 0L)
369#endif
370
371/* BOOL Cls_OnImeSetContext(HWND hwnd, BOOL fActive, DWORD dwShow) */
372#ifndef HANDLE_WM_IME_SETCONTEXT
373#define HANDLE_WM_IME_SETCONTEXT(hwnd, wParam, lParam, fn) \
374 (LRESULT)(BOOL)(fn)((hwnd), (BOOL)(wParam), (DWORD)(lParam))
375#define FORWARD_WM_IME_SETCONTEXT(hwnd, fActive, dwShow, fn) \
376 (BOOL)(fn)((hwnd), WM_IME_SETCONTEXT, (WPARAM)(BOOL)(fActive), (LPARAM)(DWORD)(dwShow))
377#endif
378
379/* LRESULT Cls_OnImeNotify(HWND hwnd, WPARAM wSubMessage, LPARAM lParam) */
380#ifndef HANDLE_WM_IME_NOTIFY
381#define HANDLE_WM_IME_NOTIFY(hwnd, wParam, lParam, fn) \
382 (LRESULT)(fn)((hwnd), (WPARAM)(wParam), (LPARAM)(lParam))
383#define FORWARD_WM_IME_NOTIFY(hwnd, wSubMessage, lParam, fn) \
384 (LRESULT)(fn)((hwnd), WM_IME_NOTIFY, (WPARAM)(wSubMessage), (LPARAM)(lParam))
385#endif
386
387/* LRESULT Cls_OnImeControl(HWND hwnd, WPARAM wSubMessage, LPVOID lpData) */
388#ifndef HANDLE_WM_IME_CONTROL
389#define HANDLE_WM_IME_CONTROL(hwnd, wParam, lParam, fn) \
390 (LRESULT)(fn)((hwnd), (WPARAM)(wParam), (LPVOID)(lParam))
391#define FORWARD_WM_IME_CONTROL(hwnd, wSubMessage, lpData, fn) \
392 (LRESULT)(fn)((hwnd), WM_IME_CONTROL, (WPARAM)(wSubMessage), (LPARAM)(LPVOID)(lpData))
393#endif
394
395/* void Cls_OnImeCompositionFull(HWND hwnd) */
396#ifndef HANDLE_WM_IME_COMPOSITIONFULL
397#define HANDLE_WM_IME_COMPOSITIONFULL(hwnd, wParam, lParam, fn) \
398 ((fn)((hwnd)), 0L)
399#define FORWARD_WM_IME_COMPOSITIONFULL(hwnd, compactRatio, fn) \
400 ((fn)((hwnd), WM_IME_COMPOSITIONFULL, 0, 0L), 0L)
401#endif
402
403/* void Cls_OnImeSelect(HWND hwnd, BOOL fSelect, HKL hKL) */
404#ifndef HANDLE_WM_IME_SELECT
405#define HANDLE_WM_IME_SELECT(hwnd, wParam, lParam, fn) \
406 ((fn)((hwnd), (BOOL)(wParam), (HKL)(lParam)), 0L)
407#define FORWARD_WM_IME_SELECT(hwnd, fSelect, hKL, fn) \
408 ((fn)((hwnd), WM_IME_SELECT, (WPARAM)(BOOL)(fSelect), (LPARAM)(HKL)(hKL)), 0L)
409#endif
410
411/* void Cls_OnImeChar(HWND hwnd, WORD wCharCode, LONG lKeyData) */
412#ifndef HANDLE_WM_IME_CHAR
413#define HANDLE_WM_IME_CHAR(hwnd, wParam, lParam, fn) \
414 ((fn)((hwnd), (WORD)(wParam), (LONG)(lParam)), 0L)
415#define FORWARD_WM_IME_CHAR(hwnd, wCharCode, lKeyData, fn) \
416 ((fn)((hwnd), WM_IME_CHAR, (WPARAM)(WORD)(wCharCode), (LPARAM)(LONG)(lKeyData)), 0L)
417#endif
418
419/* LRESULT Cls_OnImeRequest(HWND hwnd, WPARAM wParam, LPARAM lParam) */
420#ifndef HANDLE_WM_IME_REQUEST
421#define HANDLE_WM_IME_REQUEST(hwnd, wParam, lParam, fn) \
422 (LRESULT)(fn)((hwnd), (WPARAM)(wParam), (LPARAM)(lParam))
423#define FORWARD_WM_IME_REQUEST(hwnd, wParam, lParam, fn) \
424 (LRESULT)(fn)((hwnd), WM_IME_REQUEST, (WPARAM)(wParam), (LPARAM)(lParam))
425#endif
426
427/* void Cls_OnImeKey(HWND hwnd, BOOL fDown, UINT nVirtKey, LONG lKeyData) */
428#ifndef HANDLE_WM_IME_KEYDOWN
429#define HANDLE_WM_IME_KEYDOWN(hwnd, wParam, lParam, fn) \
430 ((fn)((hwnd), TRUE, (WORD)(wParam), (LONG)(lParam)), 0L)
431#define FORWARD_WM_IME_KEYDOWN(hwnd, fDown, nVirtKey, lKeyData, fn) \
432 ((fn)((hwnd), ((BOOL)(fDown) ? WM_IME_KEYDOWN : WM_IME_KEYUP), \
433 (WPARAM)(UINT)(nVirtKey), (LPARAM)(LONG)(lKeyData)), 0L)
434#define HANDLE_WM_IME_KEYUP(hwnd, wParam, lParam, fn) \
435 ((fn)((hwnd), FALSE, (WORD)(wParam), (LONG)(lParam)), 0L)
436#define FORWARD_WM_IME_KEYUP(hwnd, fDown, nVirtKey, lKeyData, fn) \
437 ((fn)((hwnd), ((BOOL)(fDown) ? WM_IME_KEYDOWN : WM_IME_KEYUP), \
438 (WPARAM)(UINT)(nVirtKey), (LPARAM)(LONG)(lKeyData)), 0L)
439#endif
440
441/* void Cls_OnMouseHover(HWND hwnd, UINT nFlags, INT xPos, INT yPos) */
442#ifndef HANDLE_WM_MOUSEHOVER
443#define HANDLE_WM_MOUSEHOVER(hwnd, wParam, lParam, fn) \
444 ((fn)((hwnd), (UINT)(wParam), GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), 0L)
445#define FORWARD_WM_MOUSEHOVER(hwnd, nFlags, xPos, yPos, fn) \
446 ((fn)((hwnd), WM_MOUSEHOVER, (WPARAM)(UINT)(nFlags), \
447 MAKELPARAM((xPos), (yPos))), 0L)
448#endif
449
450/* void Cls_OnMouseLeave(HWND hwnd) */
451#ifndef HANDLE_WM_MOUSELEAVE
452#define HANDLE_WM_MOUSELEAVE(hwnd, wParam, lParam, fn) \
453 ((fn)((hwnd)), 0L)
454#define FORWARD_WM_MOUSELEAVE(hwnd, fn) \
455 ((fn)((hwnd), WM_MOUSELEAVE, 0, 0L), 0L)
456#endif
457
458/* void Cls_OnNCMouseHover(HWND hwnd, UINT nHitTest, INT xPos, INT yPos) */
459#ifndef HANDLE_WM_NCMOUSEHOVER
460#define HANDLE_WM_NCMOUSEHOVER(hwnd, wParam, lParam, fn) \
461 ((fn)((hwnd), (INT)(wParam), GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), 0L)
462#define FORWARD_WM_NCMOUSEHOVER(hwnd, nHitTest, xPos, yPos, fn) \
463 ((fn)((hwnd), WM_NCMOUSEHOVER, (WPARAM)(UINT)(nHitTest), \
464 MAKELPARAM((xPos), (yPos))), 0L)
465#endif
466
467/* void Cls_OnNCMouseLeave(HWND hwnd) */
468#ifndef HANDLE_WM_NCMOUSELEAVE
469#define HANDLE_WM_NCMOUSELEAVE(hwnd, wParam, lParam, fn) \
470 ((fn)((hwnd)), 0L)
471#define FORWARD_WM_NCMOUSELEAVE(hwnd, fn) \
472 ((fn)((hwnd), WM_NCMOUSELEAVE, 0, 0L), 0L)
473#endif
474
475/* void Cls_OnPrint(HWND hwnd, HDC hDC, UINT uFlags) */
476#ifndef HANDLE_WM_PRINT
477#define HANDLE_WM_PRINT(hwnd, wParam, lParam, fn) \
478 ((fn)((hwnd), (HDC)(wParam), (UINT)(lParam)), 0L)
479#define FORWARD_WM_PRINT(hwnd, hDC, uFlags, fn) \
480 ((fn)((hwnd), WM_PRINT, (WPARAM)(HDC)(hDC), (LPARAM)(uFlags)), 0L)
481#endif
482
483/* void Cls_OnPrintClient(HWND hwnd, HDC hDC, UINT uFlags) */
484#ifndef HANDLE_WM_PRINTCLIENT
485#define HANDLE_WM_PRINTCLIENT(hwnd, wParam, lParam, fn) \
486 ((fn)((hwnd), (HDC)(wParam), (UINT)(lParam)), 0L)
487#define FORWARD_WM_PRINTCLIENT(hwnd, hDC, uFlags, fn) \
488 ((fn)((hwnd), WM_PRINTCLIENT, (WPARAM)(HDC)(hDC), (LPARAM)(uFlags)), 0L)
489#endif
490
491/* BOOL Cls_OnAppCommand(HWND hwnd, HWND hwndTarget, UINT cmd, UINT nDevice, UINT nKey) */
492#ifndef HANDLE_WM_APPCOMMAND
493#define HANDLE_WM_APPCOMMAND(hwnd, wParam, lParam, fn) \
494 (LRESULT)(BOOL)(fn)((hwnd), (HWND)(wParam), GET_APPCOMMAND_LPARAM(lParam), \
495 GET_DEVICE_LPARAM(lParam), GET_KEYSTATE_LPARAM(lParam))
496#define FORWARD_WM_APPCOMMAND(hwnd, hwndTarget, cmd, nDevice, nKey, fn) \
497 (BOOL)(fn)((hwnd), WM_APPCOMMAND, (WPARAM)(hwndTarget), \
498 MAKELPARAM((nKey), ((WORD)(cmd)) | (UINT)(nDevice)))
499#endif
500
501/* void Cls_OnEnterSizeMove(HWND hwnd) */
502#ifndef HANDLE_WM_ENTERSIZEMOVE
503#define HANDLE_WM_ENTERSIZEMOVE(hwnd, wParam, lParam, fn) \
504 ((fn)((hwnd)), 0L)
505#define FORWARD_WM_ENTERSIZEMOVE(hwnd, fn) \
506 ((fn)((hwnd), WM_ENTERSIZEMOVE, 0, 0L), 0L)
507#endif
508
509/* void Cls_OnExitSizeMove(HWND hwnd) */
510#ifndef HANDLE_WM_EXITSIZEMOVE
511#define HANDLE_WM_EXITSIZEMOVE(hwnd, wParam, lParam, fn) \
512 ((fn)((hwnd)), 0L)
513#define FORWARD_WM_EXITSIZEMOVE(hwnd, fn) \
514 ((fn)((hwnd), WM_EXITSIZEMOVE, 0, 0L), 0L)
515#endif
516
517/* HICON Cls_OnQueryDragIcon(HWND hwnd) */
518#undef HANDLE_WM_QUERYDRAGICON
519#define HANDLE_WM_QUERYDRAGICON(hwnd, wParam, lParam, fn) \
520 (LRESULT)(DWORD)(UINT)(UINT_PTR)(fn)(hwnd)
521#undef FORWARD_WM_QUERYDRAGICON
522#define FORWARD_WM_QUERYDRAGICON(hwnd, fn) \
523 (HICON)(UINT_PTR)(UINT)(DWORD)(fn)((hwnd), WM_QUERYDRAGICON, 0L, 0L)
524
525/* HWND Cls_MDICreate(HWND hwnd, const LPMDICREATESTRUCT lpmcs) */
526#undef HANDLE_WM_MDICREATE
527#define HANDLE_WM_MDICREATE(hwnd, wParam, lParam, fn) \
528 (LRESULT)(DWORD)(UINT)(UINT_PTR)(fn)((hwnd), (LPMDICREATESTRUCT)(lParam))
529#undef FORWARD_WM_MDICREATE
530#define FORWARD_WM_MDICREATE(hwnd, lpmcs, fn) \
531 (HWND)(UINT_PTR)(fn)((hwnd), WM_MDICREATE, 0L, (LPARAM)(LPMDICREATESTRUCT)(lpmcs))
532
533/* BOOL Cls_OnNCActivate(HWND hwnd, BOOL fActive, HWND hwndActDeact, BOOL fMinimized) */
534#undef HANDLE_WM_NCACTIVATE
535#define HANDLE_WM_NCACTIVATE(hwnd, wParam, lParam, fn) \
536 (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (BOOL)(wParam), 0L, 0L)
537#undef FORWARD_WM_NCACTIVATE
538#define FORWARD_WM_NCACTIVATE(hwnd, fActive, hwndActDeact, fMinimized, fn) \
539 (BOOL)(DWORD)(fn)((hwnd), WM_NCACTIVATE, (WPARAM)(BOOL)(fActive), 0L)
540
541/* LRESULT Cls_OnSettingChange(HWND hwnd, UINT_PTR wFlag, LPCTSTR pszSection) */
542#undef HANDLE_WM_SETTINGCHANGE
543#define HANDLE_WM_SETTINGCHANGE(hwnd,wParam,lParam,fn) \
544 ((fn)((hwnd), (UINT_PTR)(wParam), (LPCTSTR)(LPARAM)(lParam)), 0L)
545#undef FORWARD_WM_SETTINGCHANGE
546#define FORWARD_WM_SETTINGCHANGE(hwnd,wFlag,pszSection,fn) \
547 (LRESULT)(fn)((hwnd), WM_SETTINGCHANGE, (WPARAM)(UINT_PTR)(wFlag), (LPARAM)(LPCTSTR)(pszSection))
548
549/* LONG Edit_OnGetSel(HWND hwnd, LPDWORD lpdwStart, LPDWORD lpdwEnd) */
550#define HANDLE_EM_GETSEL(hwnd, wParam, lParam, fn) \
551 (LRESULT)(LONG)(fn)((hwnd), (LPDWORD)(wParam), (LPDWORD)(lParam))
552
553/* void Edit_OnSetSel(HWND hwnd, INT nStart, INT nEnd) */
554#define HANDLE_EM_SETSEL(hwnd, wParam, lParam, fn) \
555 ((fn)((hwnd), (INT)(wParam), (INT)(lParam)), 0L)
556
557/* void Edit_OnGetRect(HWND hwnd, LPRECT prc) */
558#define HANDLE_EM_GETRECT(hwnd, wParam, lParam, fn) \
559 ((fn)((hwnd), (LPRECT)(lParam)), 0L)
560
561/* void Edit_OnSetRect(HWND hwnd, LPCRECT prc) */
562#define HANDLE_EM_SETRECT(hwnd, wParam, lParam, fn) \
563 ((fn)((hwnd), (LPCRECT)(lParam)), 0L)
564
565/* void Edit_OnSetRectNP(HWND hwnd, LPCRECT prc) */
566#define HANDLE_EM_SETRECTNP(hwnd, wParam, lParam, fn) \
567 ((fn)((hwnd), (LPCRECT)(lParam)), 0L)
568
569/* DWORD Edit_OnScroll(HWND hwnd, INT nScroll) */
570#define HANDLE_EM_SCROLL(hwnd, wParam, lParam, fn) \
571 (LRESULT)(DWORD)(fn)((hwnd), (INT)(wParam))
572
573/* BOOL Edit_OnLineScroll(HWND hwnd, INT cxScroll, INT cyScroll) */
574#define HANDLE_EM_LINESCROLL(hwnd, wParam, lParam, fn) \
575 (LRESULT)(BOOL)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
576
577/* BOOL Edit_OnScrollCaret(HWND hwnd) */
578#define HANDLE_EM_SCROLLCARET(hwnd, wParam, lParam, fn) \
579 (LRESULT)(BOOL)(fn)((hwnd))
580
581/* BOOL Edit_OnGetModify(HWND hwnd) */
582#define HANDLE_EM_GETMODIFY(hwnd, wParam, lParam, fn) \
583 (LRESULT)(BOOL)(fn)((hwnd))
584
585/* void Edit_OnSetModify(HWND hwnd, BOOL fModified) */
586#define HANDLE_EM_SETMODIFY(hwnd, wParam, lParam, fn) \
587 ((fn)((hwnd), (BOOL)(wParam)), 0L)
588
589/* INT Edit_OnGetLineCount(HWND hwnd) */
590#define HANDLE_EM_GETLINECOUNT(hwnd, wParam, lParam, fn) \
591 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
592
593/* INT Edit_OnLineIndex(HWND hwnd, INT line) */
594#define HANDLE_EM_LINEINDEX(hwnd, wParam, lParam, fn) \
595 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
596
597/* void Edit_OnSetHandle(HWND hwnd, HLOCAL hloc) */
598#define HANDLE_EM_SETHANDLE(hwnd, wParam, lParam, fn) \
599 ((fn)((hwnd), (HLOCAL)(wParam)), 0L)
600
601/* HLOCAL Edit_OnGetHandle(HWND hwnd) */
602#define HANDLE_EM_GETHANDLE(hwnd, wParam, lParam, fn) \
603 (LRESULT)(HLOCAL)(fn)((hwnd))
604
605/* INT Edit_OnGetThumb(HWND hwnd) */
606#define HANDLE_EM_GETTHUMB(hwnd, wParam, lParam, fn) \
607 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
608
609/* INT Edit_OnLineLength(HWND hwnd, INT ich) */
610#define HANDLE_EM_LINELENGTH(hwnd, wParam, lParam, fn) \
611 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
612
613/* void Edit_OnReplaceSel(HWND hwnd, BOOL fCanUndo, LPCTSTR lpszReplace) */
614#define HANDLE_EM_REPLACESEL(hwnd, wParam, lParam, fn) \
615 ((fn)((hwnd), (BOOL)(wParam), (LPCTSTR)(lParam)), 0L)
616
617/* INT Edit_OnGetLine(HWND hwnd, INT line, LPCTSTR lpch) */
618#define HANDLE_EM_GETLINE(hwnd, wParam, lParam, fn) \
619 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
620
621/* NOTE: EM_LIMITTEXT is same value as EM_SETLIMITTEXT */
622/* void Edit_OnLimitText(HWND hwnd, LONG cchMax) */
623#define HANDLE_EM_LIMITTEXT(hwnd, wParam, lParam, fn) \
624 ((fn)((hwnd), (LONG)(wParam)), 0L)
625
626/* BOOL Edit_OnCanUndo(HWND hwnd) */
627#define HANDLE_EM_CANUNDO(hwnd, wParam, lParam, fn) \
628 (LRESULT)(BOOL)(fn)((hwnd))
629
630/* BOOL Edit_OnUndo(HWND hwnd) */
631#define HANDLE_EM_UNDO(hwnd, wParam, lParam, fn) \
632 (LRESULT)(BOOL)(fn)((hwnd))
633
634/* BOOL Edit_OnFmtLines(HWND hwnd, BOOL fAddEOL) */
635#define HANDLE_EM_FMTLINES(hwnd, wParam, lParam, fn) \
636 (LRESULT)(BOOL)(fn)((hwnd), (BOOL)(wParam))
637
638/* INT Edit_OnLineFromChar(HWND hwnd, INT ich) */
639#define HANDLE_EM_LINEFROMCHAR(hwnd, wParam, lParam, fn) \
640 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
641
642/* BOOL Edit_OnSetTabStops(HWND hwnd, INT cTabs, LPDWORD lpdwTabs) */
643#define HANDLE_EM_SETTABSTOPS(hwnd, wParam, lParam, fn) \
644 (LRESULT)(BOOL)(fn)((hwnd), (INT)(wParam), (LPDWORD)(lParam))
645
646/* void Edit_OnSetPasswordChar(HWND hwnd, UINT ch) */
647#define HANDLE_EM_SETPASSWORDCHAR(hwnd, wParam, lParam, fn) \
648 ((fn)((hwnd), (UINT)(wParam)), 0L)
649
650/* void Edit_OnEmptyUndoBuffer(HWND hwnd) */
651#define HANDLE_EM_EMPTYUNDOBUFFER(hwnd, wParam, lParam, fn) \
652 ((fn)((hwnd)), 0L)
653
654/* INT Edit_OnGetFirstVisibleLine(HWND hwnd) */
655#define HANDLE_EM_GETFIRSTVISIBLELINE(hwnd, wParam, lParam, fn) \
656 (INT)((fn)((hwnd)), 0L)
657
658/* BOOL Edit_OnSetReadOnly(HWND hwnd, BOOL fReadOnly) */
659#define HANDLE_EM_SETREADONLY(hwnd, wParam, lParam, fn) \
660 (BOOL)(fn)((hwnd), (BOOL)(wParam))
661
662/* void Edit_OnSetWordBreakProc(HWND hwnd, EDITWORDBREAKPROC ewbprc) */
663#define HANDLE_EM_SETWORDBREAKPROC(hwnd, wParam, lParam, fn) \
664 ((fn)((hwnd), (EDITWORDBREAKPROC)(lParam)), 0L)
665
666/* EDITWORDBREAKPROC Edit_OnGetWordBreakProc(HWND hwnd) */
667#define HANDLE_EM_GETWORDBREAKPROC(hwnd, wParam, lParam, fn) \
668 (LRESULT)(EDITWORDBREAKPROC)(fn)((hwnd))
669
670/* UINT Edit_OnGetPasswordChar(HWND hwnd) */
671#define HANDLE_EM_GETPASSWORDCHAR(hwnd, wParam, lParam, fn) \
672 (LRESULT)(UINT)(UINT)(fn)((hwnd))
673
674/* void Edit_OnSetMargins(HWND hwnd, UINT fwMargin, WORD wLeft, WORD wRight) */
675#define HANDLE_EM_SETMARGINS(hwnd, wParam, lParam, fn) \
676 ((fn)((hwnd), (UINT)(wParam), LOWORD(lParam), HIWORD(lParam)), 0L)
677
678/* DWORD Edit_OnGetMargins(HWND hwnd) */
679#define HANDLE_EM_GETMARGINS(hwnd, wParam, lParam, fn) \
680 (LRESULT)(DWORD)(fn)((hwnd))
681
682/* void Edit_OnSetLimitText(HWND hwnd, DWORD cbMax) */
683#define HANDLE_EM_SETLIMITTEXT(hwnd, wParam, lParam, fn) \
684 ((fn)((hwnd), (DWORD)(wParam)), 0L)
685
686/* DWORD Edit_OnGetLimitText(HWND hwnd) */
687#define HANDLE_EM_GETLIMITTEXT(hwnd, wParam, lParam, fn) \
688 (LRESULT)(DWORD)(fn)((hwnd))
689
690/* void Edit_OnPosFromChar(HWND hwnd, LPPOINT lpPoint, UINT wCharIndex) */
691#define HANDLE_EM_POSFROMCHAR(hwnd, wParam, lParam, fn) \
692 ((fn)((hwnd), (LPPOINT)(wParam), (UINT)(lParam)), 0L)
693
694/* LONG Edit_OnCharFromPos(HWND hwnd, INT x, INT y) */
695#define HANDLE_EM_CHARFROMPOS(hwnd, wParam, lParam, fn) \
696 (LRESULT)(LONG)(fn)((hwnd), (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam))
697
698/* DWORD Edit_OnSetImeStatus(HWND hwnd, UINT uType, DWORD dwFlags) */
699#define HANDLE_EM_SETIMESTATUS(hwnd, wParam, lParam, fn) \
700 (LRESULT)(DWORD)(fn)((hwnd), (UINT)(wParam), (DWORD)(lParam))
701
702/* DWORD Edit_OnGetImeStatus(HWND hwnd, UINT uType) */
703#define HANDLE_EM_GETIMESTATUS(hwnd, wParam, lParam, fn) \
704 (LRESULT)(DWORD)(fn)((hwnd), (UINT)(wParam))
705
706/* HICON Static_OnSetIcon(HWND hwnd, HICON hIcon) */
707#define HANDLE_STM_SETICON(hwnd, wParam, lParam, fn) \
708 (LRESULT)(HICON)(fn)((hwnd), (HICON)(wParam))
709
710/* HICON Static_OnGetIcon(HWND hwnd) */
711#define HANDLE_STM_GETICON(hwnd, wParam, lParam, fn) \
712 (LRESULT)(HICON)(fn)((hwnd))
713
714/* HANDLE Static_OnSetImage(HWND hwnd, UINT fImageType, HANDLE hImage) */
715#define HANDLE_STM_SETIMAGE(hwnd, wParam, lParam, fn) \
716 (LRESULT)(HANDLE)(fn)((hwnd), (UINT)(wParam), (HANDLE)(lParam))
717
718/* HANDLE Static_OnGetImage(HWND hwnd, UINT fImageType) */
719#define HANDLE_STM_GETIMAGE(hwnd, wParam, lParam, fn) \
720 (LRESULT)(HANDLE)(fn)((hwnd), (UINT)(wParam))
721
722/* INT ListBox_OnAddString(HWND hwnd, LPCTSTR lpsz) */
723#define HANDLE_LB_ADDSTRING(hwnd, wParam, lParam, fn) \
724 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (LPCTSTR)(lParam))
725
726/* INT ListBox_OnInsertString(HWND hwnd, INT index, LPCTSTR lpsz) */
727#define HANDLE_LB_INSERTSTRING(hwnd, wParam, lParam, fn) \
728 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
729
730/* INT ListBox_OnDeleteString(HWND hwnd, INT index) */
731#define HANDLE_LB_DELETESTRING(hwnd, wParam, lParam, fn) \
732 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
733
734/* INT ListBox_OnSelItemRangeEx(HWND hwnd, UINT wFirst, UINT wLast) */
735#define HANDLE_LB_SELITEMRANGEEX(hwnd, wParam, lParam, fn) \
736 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (UINT)(wParam), (UINT)(lParam))
737
738/* void ListBox_OnResetContent(HWND hwnd) */
739#define HANDLE_LB_RESETCONTENT(hwnd, wParam, lParam, fn) \
740 ((fn)((hwnd)), 0L)
741
742/* INT ListBox_OnSetSel(HWND hwnd, BOOL fSelect, UINT index) */
743#define HANDLE_LB_SETSEL(hwnd, wParam, lParam, fn) \
744 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (BOOL)(wParam), (UINT)(lParam))
745
746/* INT ListBox_OnSetCurSel(HWND hwnd, INT index) */
747#define HANDLE_LB_SETCURSEL(hwnd, wParam, lParam, fn) \
748 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
749
750/* INT ListBox_OnGetSel(HWND hwnd, INT index) */
751#define HANDLE_LB_GETSEL(hwnd, wParam, lParam, fn) \
752 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
753
754/* INT ListBox_OnGetCurSel(HWND hwnd) */
755#define HANDLE_LB_GETCURSEL(hwnd, wParam, lParam, fn) \
756 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
757
758/* INT ListBox_OnGetText(HWND hwnd, INT index, LPTSTR lpszBuffer) */
759#define HANDLE_LB_GETTEXT(hwnd, wParam, lParam, fn) \
760 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPTSTR)(lParam))
761
762/* INT ListBox_OnGetTextLen(HWND hwnd, INT index) */
763#define HANDLE_LB_GETTEXTLEN(hwnd, wParam, lParam, fn) \
764 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
765
766/* INT ListBox_OnGetCount(HWND hwnd) */
767#define HANDLE_LB_GETCOUNT(hwnd, wParam, lParam, fn) \
768 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
769
770/* INT ListBox_OnSelectString(HWND hwnd, INT indexStart, LPCTSTR lpszFind) */
771#define HANDLE_LB_SELECTSTRING(hwnd, wParam, lParam, fn) \
772 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
773
774/* INT ListBox_OnDir(HWND hwnd, UINT uAttrs, LPCTSTR lpszFileSpec) */
775#define HANDLE_LB_DIR(hwnd, wParam, lParam, fn) \
776 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (UINT)(wParam), (LPCTSTR)(lParam))
777
778/* INT ListBox_OnGetTopIndex(HWND hwnd) */
779#define HANDLE_LB_GETTOPINDEX(hwnd, wParam, lParam, fn) \
780 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
781
782/* INT ListBox_OnFindString(HWND hwnd, INT indexStart, LPCTSTR lpszFind) */
783#define HANDLE_LB_FINDSTRING(hwnd, wParam, lParam, fn) \
784 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
785
786/* INT ListBox_OnGetSelCount(HWND hwnd) */
787#define HANDLE_LB_GETSELCOUNT(hwnd, wParam, lParam, fn) \
788 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
789
790/* INT ListBox_OnGetSelItems(HWND hwnd, UINT cItems, LPINT lpnItems) */
791#define HANDLE_LB_GETSELITEMS(hwnd, wParam, lParam, fn) \
792 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (UINT)(wParam), (LPINT)(lParam))
793
794/* BOOL ListBox_OnSetTabStops(HWND hwnd, UINT cTabs, LPINT lpnTabs) */
795#define HANDLE_LB_SETTABSTOPS(hwnd, wParam, lParam, fn) \
796 (LRESULT)(BOOL)(fn)((hwnd), (UINT)(wParam), (LPINT)(lParam))
797
798/* INT ListBox_OnGetHorizontalExtent(HWND hwnd) */
799#define HANDLE_LB_GETHORIZONTALEXTENT(hwnd, wParam, lParam, fn) \
800 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
801
802/* void ListBox_OnSetHorizontalExtent(HWND hwnd, INT cxExtent) */
803#define HANDLE_LB_SETHORIZONTALEXTENT(hwnd, wParam, lParam, fn) \
804 ((fn)((hwnd), (INT)(wParam)), 0L)
805
806/* void ListBox_OnSetColumnWidth(HWND hwnd, INT cxColumn) */
807#define HANDLE_LB_SETCOLUMNWIDTH(hwnd, wParam, lParam, fn) \
808 ((fn)((hwnd), (INT)(wParam)), 0L)
809
810/* INT ListBox_OnAddFile(HWND hwnd, LPCTSTR lpszFilename) */
811#define HANDLE_LB_ADDFILE(hwnd, wParam, lParam, fn) \
812 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (LPCTSTR)(lParam))
813
814/* INT ListBox_OnSetTopIndex(HWND hwnd, INT index) */
815#define HANDLE_LB_SETTOPINDEX(hwnd, wParam, lParam, fn) \
816 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
817
818/* INT ListBox_OnGetItemRect(HWND hwnd, INT index, RECT FAR *lprc) */
819#define HANDLE_LB_GETITEMRECT(hwnd, wParam, lParam, fn) \
820 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (RECT FAR *)(lParam))
821
822/* INT_PTR ListBox_OnGetItemData(HWND hwnd, INT index) */
823#define HANDLE_LB_GETITEMDATA(hwnd, wParam, lParam, fn) \
824 (LRESULT)(INT_PTR)(fn)((hwnd), (INT)(wParam))
825
826/* INT_PTR ListBox_OnSetItemData(HWND hwnd, INT index, LPARAM dwData) */
827#define HANDLE_LB_SETITEMDATA(hwnd, wParam, lParam, fn) \
828 (LRESULT)(INT_PTR)(fn)((hwnd), (INT)(wParam), (lParam))
829
830/* INT ListBox_OnSelItemRange(HWND hwnd, BOOL fSelect, UINT wFirst, UINT wLast) */
831#define HANDLE_LB_SELITEMRANGE(hwnd, wParam, lParam, fn) \
832 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (BOOL)(wParam), LOWORD(lParam), HIWORD(lParam))
833
834/* INT ListBox_OnSetAnchorIndex(HWND hwnd, INT index) */
835#define HANDLE_LB_SETANCHORINDEX(hwnd, wParam, lParam, fn) \
836 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
837
838/* INT ListBox_OnGetAnchorIndex(HWND hwnd) */
839#define HANDLE_LB_GETANCHORINDEX(hwnd, wParam, lParam, fn) \
840 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
841
842/* INT ListBox_OnSetCaretIndex(HWND hwnd, INT index, BOOL fScroll) */
843#define HANDLE_LB_SETCARETINDEX(hwnd, wParam, lParam, fn) \
844 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (BOOL)LOWORD(lParam))
845
846/* INT ListBox_OnGetCaretIndex(HWND hwnd) */
847#define HANDLE_LB_GETCARETINDEX(hwnd, wParam, lParam, fn) \
848 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
849
850/* INT ListBox_OnSetItemHeight(HWND hwnd, INT index, INT cyItem) */
851#define HANDLE_LB_SETITEMHEIGHT(hwnd, wParam, lParam, fn) \
852 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (SHORT)LOWORD(lParam))
853
854/* INT ListBox_OnGetItemHeight(HWND hwnd, INT index) */
855#define HANDLE_LB_GETITEMHEIGHT(hwnd, wParam, lParam, fn) \
856 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
857
858/* INT ListBox_OnFindStringExact(HWND hwnd, INT indexStart, LPCTSTR lpszFind) */
859#define HANDLE_LB_FINDSTRINGEXACT(hwnd, wParam, lParam, fn) \
860 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
861
862/* LCID ListBox_OnSetLocale(HWND hwnd, LCID wLocaleID) */
863#define HANDLE_LB_SETLOCALE(hwnd, wParam, lParam, fn) \
864 (LRESULT)(LCID)(fn)((hwnd), (LCID)(wParam))
865
866/* LCID ListBox_OnGetLocale(HWND hwnd) */
867#define HANDLE_LB_GETLOCALE(hwnd, wParam, lParam, fn) \
868 (LRESULT)(LCID)(fn)((hwnd))
869
870/* INT ListBox_OnSetCount(HWND hwnd, INT cItems) */
871#define HANDLE_LB_SETCOUNT(hwnd, wParam, lParam, fn) \
872 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
873
874/* DWORD ListBox_OnInitStorage(HWND hwnd, UINT cItems, DWORD cb) */
875#define HANDLE_LB_INITSTORAGE(hwnd, wParam, lParam, fn) \
876 (LRESULT)(DWORD)(fn)((hwnd), (UINT)(wParam), (DWORD)(lParam))
877
878/* DWORD ListBox_OnItemFromPoint(HWND hwnd, INT xPos, INT yPos) */
879#define HANDLE_LB_ITEMFROMPOINT(hwnd, wParam, lParam, fn) \
880 (LRESULT)(DWORD)(fn)((hwnd), (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam))
881
882/* TODO: HANDLE_LB_MULTIPLEADDSTRING and HANDLE_LB_GETLISTBOXINFO. */
883
884/* DWORD ComboBox_OnGetEditSel(HWND hwnd, LPDWORD lpdwStart, LPDWORD lpdwEnd) */
885#define HANDLE_CB_GETEDITSEL(hwnd, wParam, lParam, fn) \
886 (LRESULT)(DWORD)(fn)((hwnd), (LPDWORD)(wParam), (LPDWORD)(lParam))
887
888/* void ComboBox_OnLimitText(HWND hwnd, UINT cchLimit) */
889#define HANDLE_CB_LIMITTEXT(hwnd, wParam, lParam, fn) \
890 ((fn)((hwnd), (UINT)(wParam)), TRUE)
891
892/* INT ComboBox_OnSetEditSel(HWND hwnd, INT ichStart, INT ichEnd) */
893#define HANDLE_CB_SETEDITSEL(hwnd, wParam, lParam, fn) \
894 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
895
896/* INT ComboBox_OnAddString(HWND hwnd, LPCTSTR lpsz) */
897#define HANDLE_CB_ADDSTRING(hwnd, wParam, lParam, fn) \
898 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (LPCTSTR)(lParam))
899
900/* INT ComboBox_OnDeleteString(HWND hwnd, INT index) */
901#define HANDLE_CB_DELETESTRING(hwnd, wParam, lParam, fn) \
902 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
903
904/* INT ComboBox_OnDir(HWND hwnd, UINT uAttrs, LPCTSTR lpszFileSpec) */
905#define HANDLE_CB_DIR(hwnd, wParam, lParam, fn) \
906 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (UINT)(wParam), (LPCTSTR)(lParam))
907
908/* INT ComboBox_OnGetCount(HWND hwnd) */
909#define HANDLE_CB_GETCOUNT(hwnd, wParam, lParam, fn) \
910 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
911
912/* INT ComboBox_GetCurSel(HWND hwnd) */
913#define HANDLE_CB_GETCURSEL(hwnd, wParam, lParam, fn) \
914 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
915
916/* INT ComboBox_GetLBText(HWND hwnd, INT index, LPTSTR lpszBuffer) */
917#define HANDLE_CB_GETLBTEXT(hwnd, wParam, lParam, fn) \
918 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPTSTR)(lParam))
919
920/* INT ComboBox_OnGetLBTextLen(HWND hwnd, INT index) */
921#define HANDLE_CB_GETLBTEXTLEN(hwnd, wParam, lParam, fn) \
922 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
923
924/* INT ComboBox_OnInsertString(HWND hwnd, INT index, LPCTSTR lpsz) */
925#define HANDLE_CB_INSERTSTRING(hwnd, wParam, lParam, fn) \
926 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
927
928/* void ComboBox_OnResetContent(HWND hwnd) */
929#define HANDLE_CB_RESETCONTENT(hwnd, wParam, lParam, fn) \
930 (LRESULT)((fn)((hwnd)), CB_OKAY)
931
932/* INT ComboBox_OnFindString(HWND hwnd, INT indexStart, LPCTSTR lpszFind) */
933#define HANDLE_CB_FINDSTRING(hwnd, wParam, lParam, fn) \
934 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
935
936/* INT ComboBox_OnSelectString(HWND hwnd, INT indexStart, LPCTSTR lpszSelect) */
937#define HANDLE_CB_SELECTSTRING(hwnd, wParam, lParam, fn) \
938 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
939
940/* INT ComboBox_OnSetCurSel(HWND hwnd, INT index) */
941#define HANDLE_CB_SETCURSEL(hwnd, wParam, lParam, fn) \
942 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
943
944/* BOOL ComboBox_OnShowDropDown(HWND hwnd, BOOL fShow) */
945#define HANDLE_CB_SHOWDROPDOWN(hwnd, wParam, lParam, fn) \
946 (LRESULT)((fn)((hwnd), (BOOL)(wParam)), TRUE)
947
948/* INT_PTR ComboBox_OnGetItemData(HWND hwnd, INT index) */
949#define HANDLE_CB_GETITEMDATA(hwnd, wParam, lParam, fn) \
950 (LRESULT)(INT_PTR)(fn)((hwnd), (INT)(wParam))
951
952/* INT_PTR ComboBox_OnSetItemData(HWND hwnd, INT index, DWORD_PTR dwData) */
953#define HANDLE_CB_SETITEMDATA(hwnd, wParam, lParam, fn) \
954 (LRESULT)(INT_PTR)(fn)((hwnd), (INT)(wParam), (DWORD_PTR)(lParam))
955
956/* void ComboBox_OnGetDroppedControlRect(HWND hwnd, RECT FAR *lprc) */
957#define HANDLE_CB_GETDROPPEDCONTROLRECT(hwnd, wParam, lParam, fn) \
958 (LRESULT)((fn)((hwnd), (RECT FAR *)(lParam)), CB_OKAY)
959
960/* INT ComboBox_OnSetItemHeight(HWND hwnd, INT index, INT height) */
961#define HANDLE_CB_SETITEMHEIGHT(hwnd, wParam, lParam, fn) \
962 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
963
964/* INT ComboBox_OnGetItemHeight(HWND hwnd, INT index) */
965#define HANDLE_CB_GETITEMHEIGHT(hwnd, wParam, lParam, fn) \
966 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
967
968/* INT ComboBox_OnSetExtendedUI(HWND hwnd, BOOL fExtended) */
969#define HANDLE_CB_SETEXTENDEDUI(hwnd, wParam, lParam, fn) \
970 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (BOOL)(wParam))
971
972/* BOOL ComboBox_OnGetExtendedUI(HWND hwnd) */
973#define HANDLE_CB_GETEXTENDEDUI(hwnd, wParam, lParam, fn) \
974 (LRESULT)(INT_PTR)(BOOL)(fn)((hwnd))
975
976/* BOOL ComboBox_OnGetDroppedState(HWND hwnd) */
977#define HANDLE_CB_GETDROPPEDSTATE(hwnd, wParam, lParam, fn) \
978 (LRESULT)(INT_PTR)(BOOL)(fn)((hwnd))
979
980/* INT ComboBox_OnFindStringExact(HWND hwnd, INT indexStart, LPCTSTR lpszFind) */
981#define HANDLE_CB_FINDSTRINGEXACT(hwnd, wParam, lParam, fn) \
982 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (LPCTSTR)(lParam))
983
984/* LCID ComboBox_OnSetLocale(HWND hwnd, LCID wLocaleID) */
985#define HANDLE_CB_SETLOCALE(hwnd, wParam, lParam, fn) \
986 (LRESULT)(LCID)(fn)((hwnd), (LCID)(wParam))
987
988/* LCID ComboBox_OnGetLocale(HWND hwnd) */
989#define HANDLE_CB_GETLOCALE(hwnd, wParam, lParam, fn) \
990 (LRESULT)(LCID)(fn)((hwnd))
991
992/* INT ComboBox_OnGetTopIndex(HWND hwnd) */
993#define HANDLE_CB_GETTOPINDEX(hwnd, wParam, lParam, fn) \
994 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
995
996/* INT ComboBox_OnSetTopIndex(HWND hwnd, INT index) */
997#define HANDLE_CB_SETTOPINDEX(hwnd, wParam, lParam, fn) \
998 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
999
1000/* INT ComboBox_OnGetHorizontalExtent(HWND hwnd) */
1001#define HANDLE_CB_GETHORIZONTALEXTENT(hwnd, wParam, lParam, fn) \
1002 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
1003
1004/* void ComboBox_OnSetHorizontalExtent(HWND hwnd, INT cxExtent) */
1005#define HANDLE_CB_SETHORIZONTALEXTENT(hwnd, wParam, lParam, fn) \
1006 ((fn)((hwnd), (INT)(wParam)), 0L)
1007
1008/* INT ComboBox_OnGetDroppedWidth(HWND hwnd) */
1009#define HANDLE_CB_GETDROPPEDWIDTH(hwnd, wParam, lParam, fn) \
1010 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
1011
1012/* INT ComboBox_OnSetDroppedWidth(HWND hwnd, INT wWidth) */
1013#define HANDLE_CB_SETDROPPEDWIDTH(hwnd, wParam, lParam, fn) \
1014 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam))
1015
1016/* INT ComboBox_OnInitStorage(HWND hwnd, INT cItems, DWORD cb) */
1017#define HANDLE_CB_INITSTORAGE(hwnd, wParam, lParam, fn) \
1018 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (DWORD)(lParam))
1019
1020/* TODO: CB_MULTIPLEADDSTRING and CB_GETCOMBOBOXINFO */
1021
1022/* INT ScrollBar_OnSetPos(HWND hwnd, INT nPos, BOOL fRedraw) */
1023#define HANDLE_SBM_SETPOS(hwnd, wParam, lParam, fn) \
1024 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (BOOL)(lParam))
1025
1026/* INT ScrollBar_OnGetPos(HWND hwnd) */
1027#define HANDLE_SBM_GETPOS(hwnd, wParam, lParam, fn) \
1028 (LRESULT)(INT_PTR)(INT)(fn)((hwnd))
1029
1030/* INT ScrollBar_OnSetRange(HWND hwnd, INT nMinPos, INT nMaxPos) */
1031#define HANDLE_SBM_SETRANGE(hwnd, wParam, lParam, fn) \
1032 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
1033
1034/* INT ScrollBar_OnSetRangeRedraw(HWND hwnd, INT nMinPos, INT nMaxPos) */
1035#define HANDLE_SBM_SETRANGEREDRAW(hwnd, wParam, lParam, fn) \
1036 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
1037
1038/* void ScrollBar_OnGetRange(HWND hwnd, LPINT lpnMinPos, LPINT lpnMaxPos) */
1039#define HANDLE_SBM_GETRANGE(hwnd, wParam, lParam, fn) \
1040 ((fn)((hwnd), (LPINT)(wParam), (LPINT)(lParam)), 0L)
1041
1042/* BOOL ScrollBar_OnEnableArrows(HWND hwnd, UINT fuArrowFlags) */
1043#define HANDLE_SBM_ENABLE_ARROWS(hwnd, wParam, lParam, fn) \
1044 (LRESULT)(INT_PTR)(BOOL)(fn)((hwnd), (UINT)(wParam))
1045
1046/* INT ScrollBar_OnSetScrollInfo(HWND hwnd, BOOL fRedraw, LPSCROLLINFO lpsi) */
1047#define HANDLE_SBM_SETSCROLLINFO(hwnd, wParam, lParam, fn) \
1048 (LRESULT)(INT_PTR)(INT)(fn)((hwnd), (BOOL)(wParam), (LPSCROLLINFO)(lParam))
1049
1050/* BOOL ScrollBar_OnGetScrollInfo(HWND hwnd, LPSCROLLINFO lpsi) */
1051#define HANDLE_SBM_GETSCROLLINFO(hwnd, wParam, lParam, fn) \
1052 (LRESULT)(INT_PTR)(BOOL)(fn)((hwnd), (LPSCROLLINFO)(lParam))
1053
1054/* BOOL ScrollBar_OnGetScrollBarInfo(HWND hwnd, LPSCROLLBARINFO lpsbi) */
1055#define HANDLE_SBM_GETSCROLLBARINFO(hwnd, wParam, lParam, fn) \
1056 (LRESULT)(INT_PTR)(BOOL)(fn)((hwnd), (LPSCROLLBARINFO)(lParam))
1057
1058/* COLORREF ListView_OnGetBkColor(HWND hwnd) */
1059#define HANDLE_LVM_GETBKCOLOR(hwnd, wParam, lParam, fn) \
1060 (COLORREF)(fn)((hwnd))
1061
1062/* BOOL ListView_OnSetBkColor(HWND hwnd, COLORREF clrBk) */
1063#define HANDLE_LVM_SETBKCOLOR(hwnd, wParam, lParam, fn) \
1064 (BOOL)(fn)((hwnd), (COLORREF)(wParam))
1065
1066/* HIMAGELIST ListView_OnGetImageList(HWND hwnd, INT iImageList) */
1067#define HANDLE_LVM_GETIMAGELIST(hwnd, wParam, lParam, fn) \
1068 (LRESULT)(HIMAGELIST)(fn)((hwnd), (INT)(wParam))
1069
1070/* HIMAGELIST ListView_OnSetImageList(HWND hwnd, INT iImageList, HIMAGELIST himl) */
1071#define HANDLE_LVM_SETIMAGELIST(hwnd, wParam, lParam, fn) \
1072 (LRESULT)(HIMAGELIST)(fn)((hwnd), (INT)(wParam), (HIMAGELIST)(lParam))
1073
1074/* INT ListView_OnGetItemCount(HWND hwnd) */
1075#define HANDLE_LVM_GETITEMCOUNT(hwnd, wParam, lParam, fn) \
1076 (INT)(fn)((hwnd))
1077
1078/* BOOL ListView_OnGetItemA(HWND hwnd, LV_ITEMA *pitem) */
1079#define HANDLE_LVM_GETITEMA(hwnd, wParam, lParam, fn) \
1080 (BOOL)(fn)((hwnd), (LV_ITEMA *)(lParam))
1081
1082/* BOOL ListView_OnSetItemA(HWND hwnd, const LV_ITEMA *pitem) */
1083#define HANDLE_LVM_SETITEMA(hwnd, wParam, lParam, fn) \
1084 (BOOL)(fn)((hwnd), (const LV_ITEMA *)(lParam))
1085
1086/* INT ListView_OnInsertItemA(HWND hwnd, const LV_ITEMA *pitem) */
1087#define HANDLE_LVM_INSERTITEMA(hwnd, wParam, lParam, fn) \
1088 (INT)(fn)((hwnd), (const LV_ITEMA *)(lParam))
1089
1090/* BOOL ListView_OnDeleteItem(HWND hwnd, INT i) */
1091#define HANDLE_LVM_DELETEITEM(hwnd, wParam, lParam, fn) \
1092 (BOOL)(fn)((hwnd), (INT)(wParam))
1093
1094/* BOOL ListView_OnDeleteAllItems(HWND hwnd) */
1095#define HANDLE_LVM_DELETEALLITEMS(hwnd, wParam, lParam, fn) \
1096 (BOOL)(fn)((hwnd))
1097
1098/* BOOL ListView_OnGetCallbackMask(HWND hwnd) */
1099#define HANDLE_LVM_GETCALLBACKMASK(hwnd, wParam, lParam, fn) \
1100 (BOOL)(fn)((hwnd))
1101
1102/* BOOL ListView_OnSetCallbackMask(HWND hwnd, UINT mask) */
1103#define HANDLE_LVM_SETCALLBACKMASK(hwnd, wParam, lParam, fn) \
1104 (BOOL)(fn)((hwnd), (UINT)(wParam))
1105
1106/* INT ListView_OnGetNextItem(HWND hwnd, INT i, UINT flags) */
1107#define HANDLE_LVM_GETNEXTITEM(hwnd, wParam, lParam, fn) \
1108 (INT)(fn)((hwnd), (INT)(wParam), (UINT)(lParam))
1109
1110/* INT ListView_OnFindItemA(HWND hwnd, INT iStart, const LV_FINDINFOA *plvfi) */
1111#define HANDLE_LVM_FINDITEMA(hwnd, wParam, lParam, fn) \
1112 (INT)(fn)((hwnd), (INT)(wParam), (const LV_FINDINFOA *)(lParam))
1113
1114/* BOOL ListView_OnGetItemRect(HWND hwnd, INT i, RECT *prc) */
1115#define HANDLE_LVM_GETITEMRECT(hwnd, wParam, lParam, fn) \
1116 (BOOL)(fn)((hwnd), (INT)(wParam), (RECT *)(lParam))
1117
1118/* BOOL ListView_OnSetItemPosition(HWND hwnd, INT i, INT x, INT y) */
1119#define HANDLE_LVM_SETITEMPOSITION(hwnd, wParam, lParam, fn) \
1120 (BOOL)(fn)((hwnd), (INT)(wParam), (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam))
1121
1122/* BOOL ListView_OnGetItemPosition(HWND hwnd, INT i, POINT *ppt) */
1123#define HANDLE_LVM_GETITEMPOSITION(hwnd, wParam, lParam, fn) \
1124 (BOOL)(fn)((hwnd), (INT)(wParam), (POINT *)(lParam))
1125
1126/* INT ListView_OnGetStringWidthA(HWND hwnd, LPCSTR psz) */
1127#define HANDLE_LVM_GETSTRINGWIDTHA(hwnd, wParam, lParam, fn) \
1128 (INT)(fn)((hwnd), (LPCSTR)(lParam))
1129
1130/* INT ListView_OnHitTest(HWND hwnd, LV_HITTESTINFO *pinfo) */
1131#define HANDLE_LVM_HITTEST(hwnd, wParam, lParam, fn) \
1132 (INT)(fn)((hwnd), (LV_HITTESTINFO *)(lParam))
1133
1134/* BOOL ListView_OnEnsureVisible(HWND hwnd, INT i, BOOL fPartialOK) */
1135#define HANDLE_LVM_ENSUREVISIBLE(hwnd, wParam, lParam, fn) \
1136 (BOOL)(fn)((hwnd), (INT)(wParam), (BOOL)(lParam))
1137
1138/* BOOL ListView_OnScroll(HWND hwnd, INT dx, INT dy) */
1139#define HANDLE_LVM_SCROLL(hwnd, wParam, lParam, fn) \
1140 (BOOL)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
1141
1142/* BOOL ListView_OnRedrawItems(HWND hwnd, INT iFirst, INT iLast) */
1143#define HANDLE_LVM_REDRAWITEMS(hwnd, wParam, lParam, fn) \
1144 (BOOL)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
1145
1146/* BOOL ListView_OnArrange(HWND hwnd, UINT code) */
1147#define HANDLE_LVM_ARRANGE(hwnd, wParam, lParam, fn) \
1148 (BOOL)(fn)((hwnd), (UINT)(wParam))
1149
1150/* HWND ListView_OnEditLabelA(HWND hwnd, INT i) */
1151#define HANDLE_LVM_EDITLABELA(hwnd, wParam, lParam, fn) \
1152 (LRESULT)(HWND)(fn)((hwnd), (INT)(wParam))
1153
1154/* HWND ListView_OnGetEditControl(HWND hwnd) */
1155#define HANDLE_LVM_GETEDITCONTROL(hwnd, wParam, lParam, fn) \
1156 (LRESULT)(HWND)(fn)((hwnd))
1157
1158/* BOOL ListView_OnGetColumnA(HWND hwnd, INT iCol, LV_COLUMNA *pcol) */
1159#define HANDLE_LVM_GETCOLUMNA(hwnd, wParam, lParam, fn) \
1160 (BOOL)(fn)((hwnd), (INT)(wParam), (LV_COLUMNA *)(lParam))
1161
1162/* BOOL ListView_OnSetColumnA(HWND hwnd, INT iCol, const LV_COLUMNA *pcol) */
1163#define HANDLE_LVM_SETCOLUMNA(hwnd, wParam, lParam, fn) \
1164 (BOOL)(fn)((hwnd), (INT)(wParam), (const LV_COLUMNA *)(lParam))
1165
1166/* INT ListView_OnInsertColumnA(HWND hwnd, INT iCol, const LV_COLUMNA *pcol) */
1167#define HANDLE_LVM_INSERTCOLUMNA(hwnd, wParam, lParam, fn) \
1168 (INT)(fn)((hwnd), (INT)(wParam), (const LV_COLUMNA *)(lParam))
1169
1170/* BOOL ListView_OnDeleteColumn(HWND hwnd, INT iCol) */
1171#define HANDLE_LVM_DELETECOLUMN(hwnd, wParam, lParam, fn) \
1172 (BOOL)(fn)((hwnd), (INT)(wParam))
1173
1174/* INT ListView_OnGetColumnWidth(HWND hwnd, INT iCol) */
1175#define HANDLE_LVM_GETCOLUMNWIDTH(hwnd, wParam, lParam, fn) \
1176 (INT)(fn)((hwnd), (INT)(wParam))
1177
1178/* BOOL ListView_OnSetColumnWidth(HWND hwnd, INT iCol, INT cx) */
1179#define HANDLE_LVM_SETCOLUMNWIDTH(hwnd, wParam, lParam, fn) \
1180 (BOOL)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
1181
1182/* HWND ListView_OnGetHeader(HWND hwnd) */
1183#define HANDLE_LVM_GETHEADER(hwnd, wParam, lParam, fn) \
1184 (LRESULT)(HWND)(fn)((hwnd))
1185
1186/* HIMAGELIST ListView_OnCreateDragImage(HWND hwnd, INT i, LPPOINT lpptUpLeft) */
1187#define HANDLE_LVM_CREATEDRAGIMAGE(hwnd, wParam, lParam, fn) \
1188 (LRESULT)(HIMAGELIST)(fn)((hwnd), (INT)(wParam), (LPPOINT)(lParam))
1189
1190/* BOOL ListView_OnGetViewRect(HWND hwnd, RECT *prc) */
1191#define HANDLE_LVM_GETVIEWRECT(hwnd, wParam, lParam, fn) \
1192 (BOOL)(fn)((hwnd), (RECT *)(lParam))
1193
1194/* COLORREF ListView_OnGetTextColor(HWND hwnd) */
1195#define HANDLE_LVM_GETTEXTCOLOR(hwnd, wParam, lParam, fn) \
1196 (COLORREF)(fn)((hwnd))
1197
1198/* BOOL ListView_OnSetTextColor(HWND hwnd, COLORREF clrText) */
1199#define HANDLE_LVM_SETTEXTCOLOR(hwnd, wParam, lParam, fn) \
1200 (BOOL)(fn)((hwnd), (COLORREF)(lParam))
1201
1202/* COLORREF ListView_OnGetTextBkColor(HWND hwnd) */
1203#define HANDLE_LVM_GETTEXTBKCOLOR(hwnd, wParam, lParam, fn) \
1204 (COLORREF)(fn)((hwnd))
1205
1206/* BOOL ListView_OnSetTextBkColor(HWND hwnd, COLORREF clrTextBk) */
1207#define HANDLE_LVM_SETTEXTBKCOLOR(hwnd, wParam, lParam, fn) \
1208 (BOOL)(fn)((hwnd), (COLORREF)(lParam))
1209
1210/* INT ListView_OnGetTopIndex(HWND hwnd) */
1211#define HANDLE_LVM_GETTOPINDEX(hwnd, wParam, lParam, fn) \
1212 (INT)(fn)((hwnd))
1213
1214/* INT ListView_OnGetCountPerPage(HWND hwnd) */
1215#define HANDLE_LVM_GETCOUNTPERPAGE(hwnd, wParam, lParam, fn) \
1216 (INT)(fn)((hwnd))
1217
1218/* BOOL ListView_OnGetOrigin(HWND hwnd, POINT *ppt) */
1219#define HANDLE_LVM_GETORIGIN(hwnd, wParam, lParam, fn) \
1220 (BOOL)(fn)((hwnd), (POINT *)(lParam))
1221
1222/* BOOL ListView_OnUpdate(HWND hwnd, INT i) */
1223#define HANDLE_LVM_UPDATE(hwnd, wParam, lParam, fn) \
1224 (BOOL)(fn)((hwnd), (INT)(wParam))
1225
1226/* BOOL ListView_OnSetItemState(HWND hwnd, INT i, LV_ITEM *lvi) */
1227#define HANDLE_LVM_SETITEMSTATE(hwnd, wParam, lParam, fn) \
1228 (BOOL)(fn)((hwnd), (INT)(wParam), (LV_ITEM *)(lParam))
1229
1230/* UINT ListView_OnGetItemState(HWND hwnd, INT i, UINT mask) */
1231#define HANDLE_LVM_GETITEMSTATE(hwnd, wParam, lParam, fn) \
1232 (UINT)(fn)((hwnd), (INT)(wParam), (UINT)(lParam))
1233
1234/* INT ListView_OnGetItemTextA(HWND hwnd, INT i, LV_ITEMA *lvi) */
1235#define HANDLE_LVM_GETITEMTEXTA(hwnd, wParam, lParam, fn) \
1236 (INT)(fn)((hwnd), (INT)(wParam), (LV_ITEMA *)(lParam))
1237
1238/* BOOL ListView_OnSetItemTextA(HWND hwnd, INT i, const LV_ITEMA *lvi) */
1239#define HANDLE_LVM_SETITEMTEXTA(hwnd, wParam, lParam, fn) \
1240 (BOOL)(fn)((hwnd), (INT)(wParam), (const LV_ITEMA *)(lParam))
1241
1242/* void ListView_OnSetItemCount(HWND hwnd, INT cItems) */
1243#define HANDLE_LVM_SETITEMCOUNT(hwnd, wParam, lParam, fn) \
1244 ((fn)((hwnd), (INT)(wParam)), 0L)
1245
1246/* BOOL ListView_OnSortItems(HWND hwnd, LPARAM lPrm, PFNLVCOMPARE pfnCompare) */
1247#define HANDLE_LVM_SORTITEMS(hwnd, wParam, lParam, fn) \
1248 (BOOL)(fn)((hwnd), (LPARAM)(wParam), (PFNLVCOMPARE)(lParam))
1249
1250/* void ListView_OnSetItemPosition32(HWND hwnd, INT i, const POINT *ppt) */
1251#define HANDLE_LVM_SETITEMPOSITION32(hwnd, wParam, lParam, fn) \
1252 ((fn)((hwnd), (INT)(wParam), (const POINT *)(lParam)), 0L)
1253
1254/* UINT ListView_OnGetSelectedCount(HWND hwnd) */
1255#define HANDLE_LVM_GETSELECTEDCOUNT(hwnd, wParam, lParam, fn) \
1256 (UINT)(fn)((hwnd))
1257
1258/* DWORD ListView_OnGetItemSpacing(HWND hwnd, BOOL fSmall) */
1259#define HANDLE_LVM_GETITEMSPACING(hwnd, wParam, lParam, fn) \
1260 (DWORD)(fn)((hwnd), (BOOL)(wParam))
1261
1262/* BOOL ListView_OnGetISearchStringA(HWND hwnd, LPSTR lpsz) */
1263#define HANDLE_LVM_GETISEARCHSTRINGA(hwnd, wParam, lParam, fn) \
1264 (BOOL)(fn)((hwnd), (LPSTR)(lParam))
1265
1266/* DWORD ListView_OnSetIconSpacing(HWND hwnd, INT cx, INT cy) */
1267#define HANDLE_LVM_SETICONSPACING(hwnd, wParam, lParam, fn) \
1268 (DWORD)(fn)((hwnd), (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam))
1269
1270/* DWORD ListView_OnSetExtendedListViewStyle(HWND hwnd, DWORD dwMask, DWORD dw) */
1271#define HANDLE_LVM_SETEXTENDEDLISTVIEWSTYLE(hwnd, wParam, lParam, fn) \
1272 (DWORD)(fn)((hwnd), (DWORD)(wParam), (DWORD)(lParam))
1273
1274/* DWORD ListView_OnGetExtendedListViewStyle(HWND hwnd) */
1275#define HANDLE_LVM_GETEXTENDEDLISTVIEWSTYLE(hwnd, wParam, lParam, fn) \
1276 (DWORD)(fn)((hwnd))
1277
1278/* BOOL ListView_OnGetSubItemRect(HWND hwnd, INT iItem, RECT *prc) */
1279#define HANDLE_LVM_GETSUBITEMRECT(hwnd, wParam, lParam, fn) \
1280 (BOOL)(fn)((hwnd), (INT)(wParam), (RECT *)(lParam))
1281
1282/* INT ListView_OnSubItemHitTest(HWND hwnd, WPARAM wParam, LPLVHITTESTINFO plvhti) */
1283#define HANDLE_LVM_SUBITEMHITTEST(hwnd, wParam, lParam, fn) \
1284 (INT)(fn)((hwnd), (wParam), (LPLVHITTESTINFO)(lParam))
1285
1286/* BOOL ListView_OnSetColumnOrderArray(HWND hwnd, INT iCount, LPINT pi) */
1287#define HANDLE_LVM_SETCOLUMNORDERARRAY(hwnd, wParam, lParam, fn) \
1288 (BOOL)(fn)((hwnd), (INT)(wParam), (LPINT)(lParam))
1289
1290/* BOOL ListView_OnGetColumnOrderArray(HWND hwnd, INT iCount, LPINT pi) */
1291#define HANDLE_LVM_GETCOLUMNORDERARRAY(hwnd, wParam, lParam, fn) \
1292 (BOOL)(fn)((hwnd), (INT)(wParam), (LPINT)(lParam))
1293
1294/* INT ListView_OnSetHotItem(HWND hwnd, INT i) */
1295#define HANDLE_LVM_SETHOTITEM(hwnd, wParam, lParam, fn) \
1296 (INT)(fn)((hwnd), (INT)(wParam))
1297
1298/* INT ListView_OnGetHotItem(HWND hwnd) */
1299#define HANDLE_LVM_GETHOTITEM(hwnd, wParam, lParam, fn) \
1300 (INT)(fn)((hwnd))
1301
1302/* HCURSOR ListView_OnSetHotCursor(HWND hwnd, HCURSOR hcur) */
1303#define HANDLE_LVM_SETHOTCURSOR(hwnd, wParam, lParam, fn) \
1304 (LRESULT)(HCURSOR)(fn)((hwnd), (HCURSOR)(lParam))
1305
1306/* HCURSOR ListView_OnGetHotCursor(HWND hwnd) */
1307#define HANDLE_LVM_GETHOTCURSOR(hwnd, wParam, lParam, fn) \
1308 (LRESULT)(HCURSOR)(fn)((hwnd))
1309
1310/* DWORD ListView_OnApproximateViewRect(HWND hwnd, INT iWidth, INT iHeight, INT iCount) */
1311#define HANDLE_LVM_APPROXIMATEVIEWRECT(hwnd, wParam, lParam, fn) \
1312 (DWORD)(fn)((hwnd), (INT)(wParam), (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam))
1313
1314/* BOOL ListView_OnSetWorkAreas(HWND hwnd, INT nWorkAreas, const RECT *prc) */
1315#define HANDLE_LVM_SETWORKAREAS(hwnd, wParam, lParam, fn) \
1316 (BOOL)(fn)((hwnd), (INT)(wParam), (const RECT *)(lParam))
1317
1318/* INT ListView_OnGetSelectionMark(HWND hwnd) */
1319#define HANDLE_LVM_GETSELECTIONMARK(hwnd, wParam, lParam, fn) \
1320 (INT)(fn)((hwnd))
1321
1322/* INT ListView_OnSetSelectionMark(HWND hwnd, INT i) */
1323#define HANDLE_LVM_SETSELECTIONMARK(hwnd, wParam, lParam, fn) \
1324 (INT)(fn)((hwnd), (INT)(lParam))
1325
1326/* BOOL ListView_OnSetBkImageA(HWND hwnd, const LVBKIMAGEA *plvbki) */
1327#define HANDLE_LVM_SETBKIMAGEA(hwnd, wParam, lParam, fn) \
1328 (BOOL)(fn)((hwnd), (const LVBKIMAGEA *)(lParam))
1329
1330/* BOOL ListView_OnGetBkImageA(HWND hwnd, LVBKIMAGEA *plvbki) */
1331#define HANDLE_LVM_GETBKIMAGEA(hwnd, wParam, lParam, fn) \
1332 (BOOL)(fn)((hwnd), (LVBKIMAGEA *)(lParam))
1333
1334/* BOOL ListView_OnGetWorkAreas(HWND hwnd, INT nWorkAreas, RECT *prc) */
1335#define HANDLE_LVM_GETWORKAREAS(hwnd, wParam, lParam, fn) \
1336 (BOOL)(fn)((hwnd), (INT)(wParam), (RECT *)(lParam))
1337
1338/* DWORD ListView_OnSetHoverTime(HWND hwnd, DWORD dwHoverTimeMs) */
1339#define HANDLE_LVM_SETHOVERTIME(hwnd, wParam, lParam, fn) \
1340 (DWORD)(fn)((hwnd), (DWORD)(lParam))
1341
1342/* DWORD ListView_OnGetHoverTime(HWND hwnd) */
1343#define HANDLE_LVM_GETHOVERTIME(hwnd, wParam, lParam, fn) \
1344 (DWORD)(fn)((hwnd))
1345
1346/* BOOL ListView_OnGetNumberOfWorkAreas(HWND hwnd, UINT *pnWorkAreas) */
1347#define HANDLE_LVM_GETNUMBEROFWORKAREAS(hwnd, wParam, lParam, fn) \
1348 (BOOL)(fn)((hwnd), (UINT *)(lParam))
1349
1350/* HWND ListView_OnSetToolTips(HWND hwnd, HWND hwndNewHwnd) */
1351#define HANDLE_LVM_SETTOOLTIPS(hwnd, wParam, lParam, fn) \
1352 (LRESULT)(HWND)(fn)((hwnd), (HWND)(wParam))
1353
1354/* BOOL ListView_OnGetItemW(HWND hwnd, LV_ITEMW *pitem) */
1355#define HANDLE_LVM_GETITEMW(hwnd, wParam, lParam, fn) \
1356 (BOOL)(fn)((hwnd), (LV_ITEMW *)(lParam))
1357
1358/* BOOL ListView_OnSetItemW(HWND hwnd, const LV_ITEMW *pitem) */
1359#define HANDLE_LVM_SETITEMW(hwnd, wParam, lParam, fn) \
1360 (BOOL)(fn)((hwnd), (const LV_ITEMW *)(lParam))
1361
1362/* INT ListView_OnInsertItemW(HWND hwnd, const LV_ITEMW *pitem) */
1363#define HANDLE_LVM_INSERTITEMW(hwnd, wParam, lParam, fn) \
1364 (INT)(fn)((hwnd), (const LV_ITEMW *)(lParam))
1365
1366/* HWND ListView_OnGetToolTips(HWND hwnd) */
1367#define HANDLE_LVM_GETTOOLTIPS(hwnd, wParam, lParam, fn) \
1368 (LRESULT)(HWND)(fn)((hwnd))
1369
1370/* BOOL ListView_OnSortItemsEx(HWND hwnd, PFNLVCOMPARE pfnCompare, LPARAM lPrm) */
1371#define HANDLE_LVM_SORTITEMSEX(hwnd, wParam, lParam, fn) \
1372 (BOOL)(fn)((hwnd), (PFNLVCOMPARE)(lParam), (LPARAM)(wParam))
1373
1374/* INT ListView_OnFindItemW(HWND hwnd, INT iStart, const LV_FINDINFOW *plvfi) */
1375#define HANDLE_LVM_FINDITEMW(hwnd, wParam, lParam, fn) \
1376 (INT)(fn)((hwnd), (INT)(wParam), (const LV_FINDINFOW *)(lParam))
1377
1378/* INT ListView_OnGetStringWidthW(HWND hwnd, LPCWSTR psz) */
1379#define HANDLE_LVM_GETSTRINGWIDTHW(hwnd, wParam, lParam, fn) \
1380 (INT)(fn)((hwnd), (LPCWSTR)(lParam))
1381
1382#if NTDDI_VERSION >= 0x06000000
1383 /* UINT ListView_OnGetGroupState(HWND hwnd, DWORD dwGroupId, DWORD dwMask) */
1384 #define HANDLE_LVM_GETGROUPSTATE(hwnd, wParam, lParam, fn) \
1385 (UINT)(fn)((hwnd), (DWORD)(wParam), (DWORD)(lParam))
1386
1387 /* INT ListView_OnGetFocusedGroup(HWND hwnd) */
1388 #define HANDLE_LVM_GETFOCUSEDGROUP(hwnd, wParam, lParam, fn) \
1389 (INT)(fn)((hwnd))
1390#endif
1391
1392/* INT ListView_OnGetColumnW(HWND hwnd, INT iCol) */
1393#define HANDLE_LVM_GETCOLUMNW(hwnd, wParam, lParam, fn) \
1394 (INT)(fn)((hwnd), (INT)(wParam))
1395
1396/* BOOL ListView_OnSetColumnW(HWND hwnd, INT iCol, INT cx) */
1397#define HANDLE_LVM_SETCOLUMNW(hwnd, wParam, lParam, fn) \
1398 (BOOL)(fn)((hwnd), (INT)(wParam), (INT)(lParam))
1399
1400/* INT ListView_OnInsertColumnW(HWND hwnd, INT iCol, const LV_COLUMNW *pcol) */
1401#define HANDLE_LVM_INSERTCOLUMNW(hwnd, wParam, lParam, fn) \
1402 (INT)(fn)((hwnd), (INT)(wParam), (const LV_COLUMNW *)(lParam))
1403
1404#if NTDDI_VERSION >= 0x06000000
1405 /* BOOL ListView_OnGetGroupRect(HWND hwnd, INT iGroupId, RECT *prc) */
1406 #define HANDLE_LVM_GETGROUPRECT(hwnd, wParam, lParam, fn) \
1407 (BOOL)(fn)((hwnd), (INT)(wParam), (RECT *)(lParam))
1408#endif
1409
1410/* INT ListView_OnGetItemTextW(HWND hwnd, INT i, LV_ITEMW *pitem) */
1411#define HANDLE_LVM_GETITEMTEXTW(hwnd, wParam, lParam, fn) \
1412 (INT)(fn)((hwnd), (INT)(wParam), (LV_ITEMW *)(lParam))
1413
1414/* INT ListView_OnSetItemTextW(HWND hwnd, INT i, const LV_ITEMW *pitem) */
1415#define HANDLE_LVM_SETITEMTEXTW(hwnd, wParam, lParam, fn) \
1416 (INT)(fn)((hwnd), (INT)(wParam), (const LV_ITEMW *)(lParam))
1417
1418/* BOOL ListView_OnGetISearchStringW(HWND hwnd, LPWSTR lpsz) */
1419#define HANDLE_LVM_GETISEARCHSTRINGW(hwnd, wParam, lParam, fn) \
1420 (BOOL)(fn)((hwnd), (LPWSTR)(lParam))
1421
1422/* HWND ListView_OnEditLabelW(HWND hwnd, INT i) */
1423#define HANDLE_LVM_EDITLABELW(hwnd, wParam, lParam, fn) \
1424 (LRESULT)(HWND)(fn)((hwnd), (INT)(wParam))
1425
1426/* BOOL ListView_OnSetBkImageW(HWND hwnd, const LVBKIMAGEW *plvbki) */
1427#define HANDLE_LVM_SETBKIMAGEW(hwnd, wParam, lParam, fn) \
1428 (BOOL)(fn)((hwnd), (const LVBKIMAGEW *)(lParam))
1429
1430/* BOOL ListView_OnGetBkImageW(HWND hwnd, LVBKIMAGEW *plvbki) */
1431#define HANDLE_LVM_GETBKIMAGEW(hwnd, wParam, lParam, fn) \
1432 (BOOL)(fn)((hwnd), (LVBKIMAGEW *)(lParam))
1433
1434/* void ListView_OnSetSelectedColumn(HWND hwnd, INT iCol) */
1435#define HANDLE_LVM_SETSELECTEDCOLUMN(hwnd, wParam, lParam, fn) \
1436 ((fn)((hwnd), (INT)(wParam)), 0L)
1437
1438/* LRESULT ListView_OnSetTileWidth(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1439#define HANDLE_LVM_SETTILEWIDTH(hwnd, wParam, lParam, fn) \
1440 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1441
1442/* DWORD ListView_OnSetView(HWND hwnd, DWORD iView) */
1443#define HANDLE_LVM_SETVIEW(hwnd, wParam, lParam, fn) \
1444 (DWORD)(fn)((hwnd), (DWORD)(wParam))
1445
1446/* DWORD ListView_OnGetView(HWND hwnd) */
1447#define HANDLE_LVM_GETVIEW(hwnd, wParam, lParam, fn) \
1448 (DWORD)(fn)((hwnd))
1449
1450#if NTDDI_VERSION >= 0x06000000
1451 /* INT ListView_OnInsertGroup(HWND hwnd, INT iGroupId, const LVGROUP *pGroup) */
1452 #define HANDLE_LVM_INSERTGROUP(hwnd, wParam, lParam, fn) \
1453 (INT)(fn)((hwnd), (INT)(wParam), (const LVGROUP *)(lParam))
1454
1455 /* INT ListView_OnSetGroupInfo(HWND hwnd, INT iGroupId, const LVGROUP *pGroup) */
1456 #define HANDLE_LVM_SETGROUPINFO(hwnd, wParam, lParam, fn) \
1457 (INT)(fn)((hwnd), (INT)(wParam), (const LVGROUP *)(lParam))
1458
1459 /* INT ListView_OnGetGroupInfo(HWND hwnd, INT iGroupId, LVGROUP *pGroup) */
1460 #define HANDLE_LVM_GETGROUPINFO(hwnd, wParam, lParam, fn) \
1461 (INT)(fn)((hwnd), (INT)(wParam), (LVGROUP *)(lParam))
1462
1463 /* INT ListView_OnRemoveGroup(HWND hwnd, INT iGroupId) */
1464 #define HANDLE_LVM_REMOVEGROUP(hwnd, wParam, lParam, fn) \
1465 (INT)(fn)((hwnd), (INT)(wParam))
1466
1467 /* LRESULT ListView_OnMoveGroup(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1468 #define HANDLE_LVM_MOVEGROUP(hwnd, wParam, lParam, fn) \
1469 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1470
1471 /* INT ListView_OnGetGroupCount(HWND hwnd) */
1472 #define HANDLE_LVM_GETGROUPCOUNT(hwnd, wParam, lParam, fn) \
1473 (INT)(fn)((hwnd))
1474
1475 /* BOOL ListView_OnGetGroupInfoByIndex(HWND hwnd, INT iIndex, LVGROUP *pgrp) */
1476 #define HANDLE_LVM_GETGROUPINFOBYINDEX(hwnd, wParam, lParam, fn) \
1477 (BOOL)(fn)((hwnd), (INT)(wParam), (LVGROUP *)(lParam))
1478
1479 /* LRESULT ListView_OnMoveItemToGroup(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1480 #define HANDLE_LVM_MOVEITEMTOGROUP(hwnd, wParam, lParam, fn) \
1481 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1482
1483 /* void ListView_OnSetGroupMetrics(HWND hwnd, const LVGROUPMETRICS *pGroupMetrics) */
1484 #define HANDLE_LVM_SETGROUPMETRICS(hwnd, wParam, lParam, fn) \
1485 ((fn)((hwnd), (const LVGROUPMETRICS *)(lParam)), 0L)
1486
1487 /* void ListView_OnGetGroupMetrics(HWND hwnd, LVGROUPMETRICS *pGroupMetrics) */
1488 #define HANDLE_LVM_GETGROUPMETRICS(hwnd, wParam, lParam, fn) \
1489 ((fn)((hwnd), (LVGROUPMETRICS *)(lParam)), 0L)
1490
1491 /* INT ListView_OnEnableGroupView(HWND hwnd, BOOL fEnable) */
1492 #define HANDLE_LVM_ENABLEGROUPVIEW(hwnd, wParam, lParam, fn) \
1493 (INT)(fn)((hwnd), (BOOL)(wParam))
1494
1495 /* BOOL ListView_OnSortGroups(HWND hwnd, PFNLVGROUPCOMPARE pfnGroupCompate, void *plv) */
1496 #define HANDLE_LVM_SORTGROUPS(hwnd, wParam, lParam, fn) \
1497 (BOOL)(fn)((hwnd), (PFNLVGROUPCOMPARE)(wParam), (void *)(lParam))
1498
1499 /* void ListView_OnInsertGroupSorted(HWND hwnd, const LVINSERTGROUPSORTED *structInsert) */
1500 #define HANDLE_LVM_INSERTGROUPSORTED(hwnd, wParam, lParam, fn) \
1501 ((fn)((hwnd), (const LVINSERTGROUPSORTED *)(wParam)), 0L)
1502
1503 /* void ListView_OnRemoveAllGroups(HWND hwnd) */
1504 #define HANDLE_LVM_REMOVEALLGROUPS(hwnd, wParam, lParam, fn) \
1505 ((fn)((hwnd)), 0L)
1506
1507 /* BOOL ListView_OnHasGroup(HWND hwnd, DWORD dwGroupId) */
1508 #define HANDLE_LVM_HASGROUP(hwnd, wParam, lParam, fn) \
1509 (BOOL)(fn)((hwnd), (DWORD)(wParam))
1510#endif
1511
1512/* BOOL ListView_OnSetTileViewInfo(HWND hwnd, const LVTILEVIEWINFO *ptvi) */
1513#define HANDLE_LVM_SETTILEVIEWINFO(hwnd, wParam, lParam, fn) \
1514 (BOOL)(fn)((hwnd), (const LVTILEVIEWINFO *)(lParam))
1515
1516/* void ListView_OnGetTileViewInfo(HWND hwnd, LVTILEVIEWINFO *ptvi) */
1517#define HANDLE_LVM_GETTILEVIEWINFO(hwnd, wParam, lParam, fn) \
1518 ((fn)((hwnd), (LVTILEVIEWINFO *)(lParam)), 0L)
1519
1520/* BOOL ListView_OnSetTileInfo(HWND hwnd, const LVTILEINFO *pti) */
1521#define HANDLE_LVM_SETTILEINFO(hwnd, wParam, lParam, fn) \
1522 (BOOL)(fn)((hwnd), (const LVTILEINFO *)(lParam))
1523
1524/* void ListView_OnGetTileInfo(HWND hwnd, LVTILEINFO *pti) */
1525#define HANDLE_LVM_GETTILEINFO(hwnd, wParam, lParam, fn) \
1526 ((fn)((hwnd), (LVTILEINFO *)(lParam)), 0L)
1527
1528/* BOOL ListView_OnSetInsertMark(HWND hwnd, const LVINSERTMARK *lvim) */
1529#define HANDLE_LVM_SETINSERTMARK(hwnd, wParam, lParam, fn) \
1530 (BOOL)(fn)((hwnd), (const LVINSERTMARK *)(lParam))
1531
1532/* BOOL ListView_OnGetInsertMark(HWND hwnd, LVINSERTMARK *lvim) */
1533#define HANDLE_LVM_GETINSERTMARK(hwnd, wParam, lParam, fn) \
1534 (BOOL)(fn)((hwnd), (LVINSERTMARK *)(lParam))
1535
1536/* INT ListView_OnInsertMarkHitTest(HWND hwnd, LPPOINT point, LPLVINSERTMARK lvim) */
1537#define HANDLE_LVM_INSERTMARKHITTEST(hwnd, wParam, lParam, fn) \
1538 (INT)(fn)((hwnd), (LPPOINT)(wParam), (LPLVINSERTMARK)(lParam))
1539
1540/* INT ListView_OnGetInsertMarkRect(HWND hwnd, LPRECT rc) */
1541#define HANDLE_LVM_GETINSERTMARKRECT(hwnd, wParam, lParam, fn) \
1542 (INT)(fn)((hwnd), (LPRECT)(lParam))
1543
1544/* COLORREF ListView_OnSetInsertMarkColor(HWND hwnd, COLORREF color) */
1545#define HANDLE_LVM_SETINSERTMARKCOLOR(hwnd, wParam, lParam, fn) \
1546 (COLORREF)(fn)((hwnd), (COLORREF)(lParam))
1547
1548/* COLORREF ListView_OnGetInsertMarkColor(HWND hwnd) */
1549#define HANDLE_LVM_GETINSERTMARKCOLOR(hwnd, wParam, lParam, fn) \
1550 (COLORREF)(fn)((hwnd))
1551
1552/* BOOL ListView_OnSetInfoTip(HWND hwnd, const LVSETINFOTIP *plvInfoTip) */
1553#define HANDLE_LVM_SETINFOTIP(hwnd, wParam, lParam, fn) \
1554 (BOOL)(fn)((hwnd), (const LVSETINFOTIP *)(lParam))
1555
1556/* UINT ListView_OnGetSelectedColumn(HWND hwnd) */
1557#define HANDLE_LVM_GETSELECTEDCOLUMN(hwnd, wParam, lParam, fn) \
1558 (UINT)(fn)((hwnd))
1559
1560/* BOOL ListView_OnIsGroupViewEnabled(HWND hwnd) */
1561#define HANDLE_LVM_ISGROUPVIEWENABLED(hwnd, wParam, lParam, fn) \
1562 (BOOL)(fn)((hwnd))
1563
1564/* COLORREF ListView_OnGetOutlineColor(HWND hwnd) */
1565#define HANDLE_LVM_GETOUTLINECOLOR(hwnd, wParam, lParam, fn) \
1566 (COLORREF)(fn)((hwnd))
1567
1568/* COLORREF ListView_OnSetOutlineColor(HWND hwnd, COLORREF color) */
1569#define HANDLE_LVM_SETOUTLINECOLOR(hwnd, wParam, lParam, fn) \
1570 (COLORREF)(fn)((hwnd), (COLORREF)(lParam))
1571
1572/* void ListView_OnCancelEditLabel(HWND hwnd) */
1573#define HANDLE_LVM_CANCELEDITLABEL(hwnd, wParam, lParam, fn) \
1574 ((fn)((hwnd)), 0L)
1575
1576/* UINT ListView_OnMapIndexToID(HWND hwnd, UINT index) */
1577#define HANDLE_LVM_MAPINDEXTOID(hwnd, wParam, lParam, fn) \
1578 (UINT)(fn)((hwnd), (UINT)(wParam))
1579
1580/* UINT ListView_OnMapIDToIndex(HWND hwnd, UINT id) */
1581#define HANDLE_LVM_MAPIDTOINDEX(hwnd, wParam, lParam, fn) \
1582 (UINT)(fn)((hwnd), (UINT)(wParam))
1583
1584/* BOOL ListView_OnIsItemVisible(HWND hwnd, UINT index) */
1585#define HANDLE_LVM_ISITEMVISIBLE(hwnd, wParam, lParam, fn) \
1586 (BOOL)(fn)((hwnd), (UINT)(wParam))
1587
1588#if NTDDI_VERSION >= 0x06000000
1589 /* void ListView_OnGetEmptyText(HWND hwnd, PWSTR pszText, UINT cchText) */
1590 #define HANDLE_LVM_GETEMPTYTEXT(hwnd, wParam, lParam, fn) \
1591 ((fn)((hwnd), (PWSTR)(lParam), (UINT)(wParam)), 0L)
1592
1593 /* BOOL ListView_OnGetFooterRect(HWND hwnd, RECT *prc) */
1594 #define HANDLE_LVM_GETFOOTERRECT(hwnd, wParam, lParam, fn) \
1595 (BOOL)(fn)((hwnd), (RECT *)(lParam))
1596
1597 /* BOOL ListView_OnGetFooterInfo(HWND hwnd, LVFOOTERINFO *plvfi) */
1598 #define HANDLE_LVM_GETFOOTERINFO(hwnd, wParam, lParam, fn) \
1599 (BOOL)(fn)((hwnd), (LVFOOTERINFO *)(lParam))
1600
1601 /* BOOL ListView_OnGetFooterItemRect(HWND hwnd, INT iItem, RECT *prc) */
1602 #define HANDLE_LVM_GETFOOTERITEMRECT(hwnd, wParam, lParam, fn) \
1603 (BOOL)(fn)((hwnd), (INT)(wParam), (RECT *)(lParam))
1604
1605 /* BOOL ListView_OnGetFooterItem(HWND hwnd, INT iItem, LVFOOTERITEM *pfi) */
1606 #define HANDLE_LVM_GETFOOTERITEM(hwnd, wParam, lParam, fn) \
1607 (BOOL)(fn)((hwnd), (INT)(wParam), (LVFOOTERITEM *)(lParam))
1608
1609 /* BOOL ListView_OnGetItemIndexRect(HWND hwnd, const LVITEMINDEX *plvii, RECT *prc) */
1610 #define HANDLE_LVM_GETITEMINDEXRECT(hwnd, wParam, lParam, fn) \
1611 (BOOL)(fn)((hwnd), (const LVITEMINDEX *)(wParam), (RECT *)(lParam))
1612
1613 /* HRESULT ListView_OnSetItemIndexState(HWND hwnd, const LVITEMINDEX *plvii, const LV_ITEM *lvi) */
1614 #define HANDLE_LVM_SETITEMINDEXSTATE(hwnd, wParam, lParam, fn) \
1615 (HRESULT)(fn)((hwnd), (const LVITEMINDEX *)(wParam), (const LV_ITEM *)(lParam))
1616
1617 /* BOOL ListView_OnGetNextItemIndex(HWND hwnd, LVITEMINDEX *plvii, UINT flags) */
1618 #define HANDLE_LVM_GETNEXTITEMINDEX(hwnd, wParam, lParam, fn) \
1619 (BOOL)(fn)((hwnd), (LVITEMINDEX *)(wParam), (UINT)(lParam))
1620#endif
1621
1622/* HTREEITEM TreeView_OnInsertItemA(HWND hwnd, LPTV_INSERTSTRUCTA lpis) */
1623#define HANDLE_TVM_INSERTITEMA(hwnd, wParam, lParam, fn) \
1624 (LRESULT)(HTREEITEM)(fn)((hwnd), (LPTV_INSERTSTRUCTA)(lParam))
1625
1626/* BOOL TreeView_OnDeleteItem(HWND hwnd, HTREEITEM hitem) */
1627#define HANDLE_TVM_DELETEITEM(hwnd, wParam, lParam, fn) \
1628 (BOOL)(fn)((hwnd), (HTREEITEM)(lParam))
1629
1630/* BOOL TreeView_OnExpand(HWND hwnd, HTREEITEM hitem, UINT code) */
1631#define HANDLE_TVM_EXPAND(hwnd, wParam, lParam, fn) \
1632 (BOOL)(fn)((hwnd), (HTREEITEM)(lParam), (UINT)(wParam))
1633
1634/* BOOL TreeView_OnGetItemRect(HWND hwnd, UINT code, RECT *prc) */
1635#define HANDLE_TVM_GETITEMRECT(hwnd, wParam, lParam, fn) \
1636 (BOOL)(fn)((hwnd), (UINT)(wParam), (RECT *)(lParam))
1637
1638/* UINT TreeView_OnGetCount(HWND hwnd) */
1639#define HANDLE_TVM_GETCOUNT(hwnd, wParam, lParam, fn) \
1640 (UINT)(fn)((hwnd))
1641
1642/* UINT TreeView_OnGetIndent(HWND hwnd) */
1643#define HANDLE_TVM_GETINDENT(hwnd, wParam, lParam, fn) \
1644 (UINT)(fn)((hwnd))
1645
1646/* BOOL TreeView_OnSetIndent(HWND hwnd, INT indent) */
1647#define HANDLE_TVM_SETINDENT(hwnd, wParam, lParam, fn) \
1648 (BOOL)(fn)((hwnd), (INT)(wParam))
1649
1650/* HIMAGELIST TreeView_OnGetImageList(HWND hwnd, INT iImage) */
1651#define HANDLE_TVM_GETIMAGELIST(hwnd, wParam, lParam, fn) \
1652 (LRESULT)(HIMAGELIST)(fn)((hwnd), (INT)(wParam))
1653
1654/* HIMAGELIST TreeView_OnSetImageList(HWND hwnd, INT iImage, HIMAGELIST himl) */
1655#define HANDLE_TVM_SETIMAGELIST(hwnd, wParam, lParam, fn) \
1656 (LRESULT)(HIMAGELIST)(fn)((hwnd), (INT)(wParam), (HIMAGELIST)(lParam))
1657
1658/* HTREEITEM TreeView_OnGetNextItem(HWND hwnd, HTREEITEM hitem, UINT code) */
1659#define HANDLE_TVM_GETNEXTITEM(hwnd, wParam, lParam, fn) \
1660 (LRESULT)(HTREEITEM)(fn)((hwnd), (HTREEITEM)(lParam), (UINT)(wParam))
1661
1662/* BOOL TreeView_OnSelectItem(HWND hwnd, UINT code, HTREEITEM hitem) */
1663#define HANDLE_TVM_SELECTITEM(hwnd, wParam, lParam, fn) \
1664 (BOOL)(fn)((hwnd), (UINT)(wParam), (HTREEITEM)(lParam))
1665
1666/* BOOL TreeView_OnGetItemA(HWND hwnd, TV_ITEMA *pitem) */
1667#define HANDLE_TVM_GETITEMA(hwnd, wParam, lParam, fn) \
1668 (BOOL)(fn)((hwnd), (TV_ITEMA *)(lParam))
1669
1670/* BOOL TreeView_OnSetItemA(HWND hwnd, const TV_ITEMA *pitem) */
1671#define HANDLE_TVM_SETITEMA(hwnd, wParam, lParam, fn) \
1672 (BOOL)(fn)((hwnd), (const TV_ITEMA *)(lParam))
1673
1674/* HWND TreeView_OnEditLabelA(HWND hwnd, HTREEITEM hitem) */
1675#define HANDLE_TVM_EDITLABELA(hwnd, wParam, lParam, fn) \
1676 (LRESULT)(HWND)(fn)((hwnd), (HTREEITEM)(lParam))
1677
1678/* HWND TreeView_OnGetEditControl(HWND hwnd) */
1679#define HANDLE_TVM_GETEDITCONTROL(hwnd, wParam, lParam, fn) \
1680 (LRESULT)(HWND)(fn)((hwnd))
1681
1682/* UINT TreeView_OnGetVisibleCount(HWND hwnd) */
1683#define HANDLE_TVM_GETVISIBLECOUNT(hwnd, wParam, lParam, fn) \
1684 (UINT)(fn)((hwnd))
1685
1686/* HTREEITEM TreeView_OnHitTest(HWND hwnd, LPTV_HITTESTINFO lpht) */
1687#define HANDLE_TVM_HITTEST(hwnd, wParam, lParam, fn) \
1688 (LRESULT)(HTREEITEM)(fn)((hwnd), (LPTV_HITTESTINFO)(lParam))
1689
1690/* HIMAGELIST TreeView_OnCreateDragImage(HWND hwnd, HTREEITEM hitem) */
1691#define HANDLE_TVM_CREATEDRAGIMAGE(hwnd, wParam, lParam, fn) \
1692 (LRESULT)(HIMAGELIST)(fn)((hwnd), (HTREEITEM)(lParam))
1693
1694/* BOOL TreeView_OnSortChildren(HWND hwnd, HTREEITEM hitem, BOOL recurse) */
1695#define HANDLE_TVM_SORTCHILDREN(hwnd, wParam, lParam, fn) \
1696 (BOOL)(fn)((hwnd), (HTREEITEM)(lParam), (BOOL)(wParam))
1697
1698/* BOOL TreeView_OnEnsureVisible(HWND hwnd, HTREEITEM hitem) */
1699#define HANDLE_TVM_ENSUREVISIBLE(hwnd, wParam, lParam, fn) \
1700 (BOOL)(fn)((hwnd), (HTREEITEM)(lParam))
1701
1702/* BOOL TreeView_OnSortChildrenCB(HWND hwnd, LPTV_SORTCB psort, BOOL recurse) */
1703#define HANDLE_TVM_SORTCHILDRENCB(hwnd, wParam, lParam, fn) \
1704 (BOOL)(fn)((hwnd), (LPTV_SORTCB)(lParam), (BOOL)(wParam))
1705
1706/* BOOL TreeView_OnEndEditLabelNow(HWND hwnd, BOOL fCancel) */
1707#define HANDLE_TVM_ENDEDITLABELNOW(hwnd, wParam, lParam, fn) \
1708 (BOOL)(fn)((hwnd), (BOOL)(wParam))
1709
1710/* BOOL TreeView_OnGetISearchStringA(HWND hwnd, LPSTR lpsz) */
1711#define HANDLE_TVM_GETISEARCHSTRINGA(hwnd, wParam, lParam, fn) \
1712 (BOOL)(fn)((hwnd), (LPSTR)(lParam))
1713
1714/* HWND TreeView_OnSetToolTips(HWND hwnd, HWND hwndTT) */
1715#define HANDLE_TVM_SETTOOLTIPS(hwnd, wParam, lParam, fn) \
1716 (LRESULT)(HWND)(fn)((hwnd), (HWND)(wParam))
1717
1718/* HWND TreeView_OnGetToolTips(HWND hwnd) */
1719#define HANDLE_TVM_GETTOOLTIPS(hwnd, wParam, lParam, fn) \
1720 (LRESULT)(HWND)(fn)((hwnd))
1721
1722/* BOOL TreeView_OnSetInsertMark(HWND hwnd, HTREEITEM hItem, BOOL fAfter) */
1723#define HANDLE_TVM_SETINSERTMARK(hwnd, wParam, lParam, fn) \
1724 (BOOL)(fn)((hwnd), (HTREEITEM)(lParam), (BOOL)(wParam))
1725
1726/* INT TreeView_OnSetItemHeight(HWND hwnd, INT iHeight) */
1727#define HANDLE_TVM_SETITEMHEIGHT(hwnd, wParam, lParam, fn) \
1728 (INT)(fn)((hwnd), (INT)(wParam))
1729
1730/* INT TreeView_OnGetItemHeight(HWND hwnd) */
1731#define HANDLE_TVM_GETITEMHEIGHT(hwnd, wParam, lParam, fn) \
1732 (INT)(fn)((hwnd))
1733
1734/* COLORREF TreeView_OnSetBkColor(HWND hwnd, COLORREF clr) */
1735#define HANDLE_TVM_SETBKCOLOR(hwnd, wParam, lParam, fn) \
1736 (COLORREF)(fn)((hwnd), (COLORREF)(lParam))
1737
1738/* COLORREF TreeView_OnSetTextColor(HWND hwnd, COLORREF clr) */
1739#define HANDLE_TVM_SETTEXTCOLOR(hwnd, wParam, lParam, fn) \
1740 (COLORREF)(fn)((hwnd), (COLORREF)(lParam))
1741
1742/* COLORREF TreeView_OnGetBkColor(HWND hwnd) */
1743#define HANDLE_TVM_GETBKCOLOR(hwnd, wParam, lParam, fn) \
1744 (COLORREF)(fn)((hwnd))
1745
1746/* COLORREF TreeView_OnGetTextColor(HWND hwnd) */
1747#define HANDLE_TVM_GETTEXTCOLOR(hwnd, wParam, lParam, fn) \
1748 (COLORREF)(fn)((hwnd))
1749
1750/* UINT TreeView_OnSetScrollTime(HWND hwnd, UINT uTime) */
1751#define HANDLE_TVM_SETSCROLLTIME(hwnd, wParam, lParam, fn) \
1752 (UINT)(fn)((hwnd), (UINT)(wParam))
1753
1754/* UINT TreeView_OnGetScrollTime(HWND hwnd) */
1755#define HANDLE_TVM_GETSCROLLTIME(hwnd, wParam, lParam, fn) \
1756 (UINT)(fn)((hwnd))
1757
1758#if NTDDI_VERSION >= 0x06000000
1759 /* INT TreeView_OnSetBorder(HWND hwnd, DWORD dwFlags, INT xBorder, INT yBorder) */
1760 #define HANDLE_TVM_SETBORDER(hwnd, wParam, lParam, fn) \
1761 (INT)(fn)((hwnd), (DWORD)(wParam), (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam))
1762#endif
1763
1764/* COLORREF TreeView_OnSetInsertMarkColor(HWND hwnd, COLORREF clr) */
1765#define HANDLE_TVM_SETINSERTMARKCOLOR(hwnd, wParam, lParam, fn) \
1766 (COLORREF)(fn)((hwnd), (COLORREF)(lParam))
1767
1768/* COLORREF TreeView_OnGetInsertMarkColor(HWND hwnd) */
1769#define HANDLE_TVM_GETINSERTMARKCOLOR(hwnd, wParam, lParam, fn) \
1770 (COLORREF)(fn)((hwnd))
1771
1772/* UINT TreeView_OnGetItemState(HWND hwnd, HTREEITEM hti, UINT mask) */
1773#define HANDLE_TVM_GETITEMSTATE(hwnd, wParam, lParam, fn) \
1774 (UINT)(fn)((hwnd), (HTREEITEM)(wParam), (UINT)(lParam))
1775
1776/* COLORREF TreeView_OnSetLineColor(HWND hwnd, COLORREF clr) */
1777#define HANDLE_TVM_SETLINECOLOR(hwnd, wParam, lParam, fn) \
1778 (COLORREF)(fn)((hwnd), (COLORREF)(lParam))
1779
1780/* COLORREF TreeView_OnGetLineColor(HWND hwnd) */
1781#define HANDLE_TVM_GETLINECOLOR(hwnd, wParam, lParam, fn) \
1782 (COLORREF)(fn)((hwnd))
1783
1784/* HTREEITEM TreeView_OnMapAccIDToHTREEITEM(HWND hwnd, UINT id) */
1785#define HANDLE_TVM_MAPACCIDTOHTREEITEM(hwnd, wParam, lParam, fn) \
1786 (LRESULT)(HTREEITEM)(fn)((hwnd), (UINT)(wParam))
1787
1788/* UINT TreeView_OnMapHTREEITEMToAccID(HWND hwnd, HTREEITEM htreeitem) */
1789#define HANDLE_TVM_MAPHTREEITEMTOACCID(hwnd, wParam, lParam, fn) \
1790 (UINT)(fn)((hwnd), (HTREEITEM)(wParam))
1791
1792#if NTDDI_VERSION >= 0x06000000
1793 /* DWORD TreeView_OnSetExtendedStyle(HWND hwnd, DWORD dw, DWORD mask) */
1794 #define HANDLE_TVM_SETEXTENDEDSTYLE(hwnd, wParam, lParam, fn) \
1795 (DWORD)(fn)((hwnd), (DWORD)(wParam), (DWORD)(lParam))
1796
1797 /* DWORD TreeView_OnGetExtendedStyle(HWND hwnd) */
1798 #define HANDLE_TVM_GETEXTENDEDSTYLE(hwnd, wParam, lParam, fn) \
1799 (DWORD)(fn)((hwnd))
1800#endif
1801
1802/* HTREEITEM TreeView_OnInsertItemW(HWND hwnd, LPTV_INSERTSTRUCTW lpis) */
1803#define HANDLE_TVM_INSERTITEMW(hwnd, wParam, lParam, fn) \
1804 (LRESULT)(HTREEITEM)(fn)((hwnd), (LPTV_INSERTSTRUCTW)(lParam))
1805
1806#if NTDDI_VERSION >= 0x06000000
1807 /* BOOL TreeView_OnSetHot(HWND hwnd, HTREEITEM hitem) */
1808 #define HANDLE_TVM_SETHOT(hwnd, wParam, lParam, fn) \
1809 (BOOL)(fn)((hwnd), (HTREEITEM)(lParam))
1810
1811 /* BOOL TreeView_OnSetAutoScrollInfo(HWND hwnd, UINT uPixPerSec, UINT uUpdateTime) */
1812 #define HANDLE_TVM_SETAUTOSCROLLINFO(hwnd, wParam, lParam, fn) \
1813 (BOOL)(fn)((hwnd), (UINT)(wParam), (UINT)(lParam))
1814#endif
1815
1816/* BOOL TreeView_OnGetItemW(HWND hwnd, TV_ITEMW *pitem) */
1817#define HANDLE_TVM_GETITEMW(hwnd, wParam, lParam, fn) \
1818 (BOOL)(fn)((hwnd), (TV_ITEMW *)(lParam))
1819
1820/* BOOL TreeView_OnSetItemW(HWND hwnd, const TV_ITEMW *pitem) */
1821#define HANDLE_TVM_SETITEMW(hwnd, wParam, lParam, fn) \
1822 (BOOL)(fn)((hwnd), (const TV_ITEMW *)(lParam))
1823
1824/* BOOL TreeView_OnGetISearchStringW(HWND hwnd, LPWSTR lpsz) */
1825#define HANDLE_TVM_GETISEARCHSTRINGW(hwnd, wParam, lParam, fn) \
1826 (BOOL)(fn)((hwnd), (LPWSTR)(lParam))
1827
1828/* HWND TreeView_OnEditLabelW(HWND hwnd, HTREEITEM hitem) */
1829#define HANDLE_TVM_EDITLABELW(hwnd, wParam, lParam, fn) \
1830 (LRESULT)(HWND)(fn)((hwnd), (HTREEITEM)(lParam))
1831
1832#if NTDDI_VERSION >= 0x06000000
1833 /* DWORD TreeView_OnGetSelectedCount(HWND hwnd) */
1834 #define HANDLE_TVM_GETSELECTEDCOUNT(hwnd, wParam, lParam, fn) \
1835 (DWORD)(fn)((hwnd))
1836
1837 /* DWORD TreeView_OnShowInfoTip(HWND hwnd, HTREEITEM hitem) */
1838 #define HANDLE_TVM_SHOWINFOTIP(hwnd, wParam, lParam, fn) \
1839 (DWORD)(fn)((hwnd), (HTREEITEM)(lParam))
1840
1841 /* LRESULT TreeView_OnGetItemPartRect(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1842 #define HANDLE_TVM_GETITEMPARTRECT(hwnd, wParam, lParam, fn) \
1843 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1844#endif
1845
1846#ifdef _UNDOCUSER_H /* UNDOCUMENTED */
1847 /* LRESULT Cls_OnDropObject(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1848 #ifndef HANDLE_WM_DROPOBJECT
1849 #define HANDLE_WM_DROPOBJECT(hwnd, wParam, lParam, fn) \
1850 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1851 #define FORWARD_WM_DROPOBJECT(hwnd, wParam, lParam, fn) \
1852 (LRESULT)((fn)((hwnd), WM_DROPOBJECT, wParam, lParam))
1853 #endif
1854
1855 /* LRESULT Cls_OnQueryDropObject(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1856 #ifndef HANDLE_WM_QUERYDROPOBJECT
1857 #define HANDLE_WM_QUERYDROPOBJECT(hwnd, wParam, lParam, fn) \
1858 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1859 #define FORWARD_WM_QUERYDROPOBJECT(hwnd, wParam, lParam, fn) \
1860 (LRESULT)((fn)((hwnd), WM_QUERYDROPOBJECT, wParam, lParam))
1861 #endif
1862
1863 /* LRESULT Cls_OnBeginDrag(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1864 #ifndef HANDLE_WM_BEGINDRAG
1865 #define HANDLE_WM_BEGINDRAG(hwnd, wParam, lParam, fn) \
1866 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1867 #define FORWARD_WM_BEGINDRAG(hwnd, wParam, lParam, fn) \
1868 (LRESULT)((fn)((hwnd), WM_BEGINDRAG, wParam, lParam))
1869 #endif
1870
1871 /* LRESULT Cls_OnDragLoop(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1872 #ifndef HANDLE_WM_DRAGLOOP
1873 #define HANDLE_WM_DRAGLOOP(hwnd, wParam, lParam, fn) \
1874 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1875 #define FORWARD_WM_DRAGLOOP(hwnd, wParam, lParam, fn) \
1876 (LRESULT)((fn)((hwnd), WM_DRAGLOOP, wParam, lParam))
1877 #endif
1878
1879 /* LRESULT Cls_OnDragSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1880 #ifndef HANDLE_WM_DRAGSELECT
1881 #define HANDLE_WM_DRAGSELECT(hwnd, wParam, lParam, fn) \
1882 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1883 #define FORWARD_WM_DRAGSELECT(hwnd, wParam, lParam, fn) \
1884 (LRESULT)((fn)((hwnd), WM_DRAGSELECT, wParam, lParam))
1885 #endif
1886
1887 /* LRESULT Cls_OnDragMove(HWND hwnd, WPARAM wParam, LPARAM lParam) */
1888 #ifndef HANDLE_WM_DRAGMOVE
1889 #define HANDLE_WM_DRAGMOVE(hwnd, wParam, lParam, fn) \
1890 (LRESULT)(fn)((hwnd), (wParam), (lParam))
1891 #define FORWARD_WM_DRAGMOVE(hwnd, wParam, lParam, fn) \
1892 (LRESULT)((fn)((hwnd), WM_DRAGMOVE, wParam, lParam))
1893 #endif
1894#endif
1895
1896/* LRESULT RichEdit_OnCanPaste(HWND hwnd, UINT uFormat) */
1897#define HANDLE_EM_CANPASTE(hwnd, wParam, lParam, fn) \
1898 (LRESULT)(fn)((hwnd), (UINT)(wParam))
1899
1900/* BOOL RichEdit_OnDisplayBand(HWND hwnd, LPRECT lprc) */
1901#define HANDLE_EM_DISPLAYBAND(hwnd, wParam, lParam, fn) \
1902 (BOOL)(fn)((hwnd), (LPRECT)(lParam))
1903
1904/* void RichEdit_OnExGetSel(HWND hwnd, CHARRANGE *lpchr) */
1905#define HANDLE_EM_EXGETSEL(hwnd, wParam, lParam, fn) \
1906 ((fn)((hwnd), (CHARRANGE *)(lParam)), 0L)
1907
1908/* void RichEdit_OnExLimitText(HWND hwnd, DWORD cchTextMax) */
1909#define HANDLE_EM_EXLIMITTEXT(hwnd, wParam, lParam, fn) \
1910 ((fn)((hwnd), (DWORD)(lParam)), 0L)
1911
1912/* INT RichEdit_OnExLineFromChar(HWND hwnd, DWORD ichCharPos) */
1913#define HANDLE_EM_EXLINEFROMCHAR(hwnd, wParam, lParam, fn) \
1914 (INT)(fn)((hwnd), (DWORD)(wParam))
1915
1916/* INT RichEdit_OnExSetSel(HWND hwnd, INT ichChar) */
1917#define HANDLE_EM_EXSETSEL(hwnd, wParam, lParam, fn) \
1918 (INT)(fn)((hwnd), (INT)(INT_PTR)(lParam))
1919
1920/* INT RichEdit_OnFindText(HWND hwnd, UINT fuFlags, FINDTEXT *lpFindText) */
1921#define HANDLE_EM_FINDTEXT(hwnd, wParam, lParam, fn) \
1922 (INT)(fn)((hwnd), (UINT)(wParam), (FINDTEXT *)(lParam))
1923
1924/* INT RichEdit_OnFormatRange(HWND hwnd, BOOL fRender, FORMATRANGE *lpFmt) */
1925#define HANDLE_EM_FORMATRANGE(hwnd, wParam, lParam, fn) \
1926 (INT)(fn)((hwnd), (BOOL)(wParam), (FORMATRANGE *)(lParam))
1927
1928/* DWORD RichEdit_OnGetCharFormat(HWND hwnd, BOOL fSelection, CHARFORMAT *lpFmt) */
1929#define HANDLE_EM_GETCHARFORMAT(hwnd, wParam, lParam, fn) \
1930 (DWORD)(fn)((hwnd), (BOOL)(wParam), (CHARFORMAT *)(lParam))
1931
1932/* DWORD RichEdit_OnGetEventMask(HWND hwnd) */
1933#define HANDLE_EM_GETEVENTMASK(hwnd, wParam, lParam, fn) \
1934 (DWORD)(fn)((hwnd))
1935
1936/* BOOL RichEdit_OnOleInterface(HWND hwnd, LPVOID *ppObject) */
1937#define HANDLE_EM_GETOLEINTERFACE(hwnd, wParam, lParam, fn) \
1938 (BOOL)(fn)((hwnd), (LPVOID *)(lParam))
1939
1940/* DWORD RichEdit_OnGetParaFormat(HWND hwnd, PARAFORMAT *lpFmt) */
1941#define HANDLE_EM_GETPARAFORMAT(hwnd, wParam, lParam, fn) \
1942 (DWORD)(fn)((hwnd), (PARAFORMAT *)(lParam))
1943
1944/* INT RichEdit_OnGetSelText(HWND hwnd, LPTSTR lpBuf) */
1945#define HANDLE_EM_GETSELTEXT(hwnd, wParam, lParam, fn) \
1946 (INT)(fn)((hwnd), (LPTSTR)(lParam))
1947
1948/* void RichEdit_OnHideSelection(HWND hwnd, BOOL fHide, BOOL fChangeStyle) */
1949#define HANDLE_EM_HIDESELECTION(hwnd, wParam, lParam, fn) \
1950 ((fn)((hwnd), (BOOL)(wParam), (BOOL)(lParam)), 0L)
1951
1952/* void RichEdit_OnPasteSpecial(HWND hwnd, UINT uFormat, REPASTESPECIAL *lpRePasteSpecial) */
1953#define HANDLE_EM_PASTESPECIAL(hwnd, wParam, lParam, fn) \
1954 ((fn)((hwnd), (UINT)(wParam), (REPASTESPECIAL *)(lParam)), 0L)
1955
1956/* void RichEdit_OnRequestResize(HWND hwnd) */
1957#define HANDLE_EM_REQUESTRESIZE(hwnd, wParam, lParam, fn) \
1958 ((fn)((hwnd)), 0L)
1959
1960/* DWORD RichEdit_OnSelectionType(HWND hwnd) */
1961#define HANDLE_EM_SELECTIONTYPE(hwnd, wParam, lParam, fn) \
1962 (DWORD)(fn)((hwnd))
1963
1964/* COLORREF RichEdit_OnSetBkgndColor(HWND hwnd, BOOL fUseSysColor, COLORREF clr) */
1965#define HANDLE_EM_SETBKGNDCOLOR(hwnd, wParam, lParam, fn) \
1966 (DWORD)(fn)((hwnd), (BOOL)(wParam), (COLORREF)(lParam))
1967
1968/* BOOL RichEdit_OnSetCharFormat(HWND hwnd, UINT uFlags, CHARFORMAT *lpFmt) */
1969#define HANDLE_EM_SETCHARFORMAT(hwnd, wParam, lParam, fn) \
1970 (BOOL)(fn)((hwnd), (UINT)(wParam), (CHARFORMAT *)(lParam))
1971
1972/* DWORD RichEdit_OnSetEventMask(HWND hwnd, DWORD dwMask) */
1973#define HANDLE_EM_SETEVENTMASK(hwnd, wParam, lParam, fn) \
1974 (DWORD)(fn)((hwnd), (DWORD)(lParam))
1975
1976/* BOOL RichEdit_OnSetOleCallback(HWND hwnd, void *pCallback) */
1977#define HANDLE_EM_SETOLECALLBACK(hwnd, wParam, lParam, fn) \
1978 (BOOL)(fn)((hwnd), (void *)(lParam))
1979
1980/* BOOL RichEdit_OnSetParaFormat(HWND hwnd, PARAFORMAT *lpFmt) */
1981#define HANDLE_EM_SETPARAFORMAT(hwnd, wParam, lParam, fn) \
1982 (BOOL)(fn)((hwnd), (PARAFORMAT *)(lParam))
1983
1984/* BOOL RichEdit_OnSetTargetDevice(HWND hwnd, HDC hdcTarget, INT cxLineWidth) */
1985#define HANDLE_EM_SETTARGETDEVICE(hwnd, wParam, lParam, fn) \
1986 (BOOL)(fn)((hwnd), (HDC)(wParam), (INT)(lParam))
1987
1988/* DWORD RichEdit_OnStreamIn(HWND hwnd, UINT uFormat, EDITSTREAM *lpStream) */
1989#define HANDLE_EM_STREAMIN(hwnd, wParam, lParam, fn) \
1990 (DWORD)(fn)((hwnd), (UINT)(wParam), (EDITSTREAM *)(lParam))
1991
1992/* DWORD RichEdit_OnStreamOut(HWND hwnd, UINT uFormat, EDITSTREAM *lpStream) */
1993#define HANDLE_EM_STREAMOUT(hwnd, wParam, lParam, fn) \
1994 (DWORD)(fn)((hwnd), (UINT)(wParam), (EDITSTREAM *)(lParam))
1995
1996/* DWORD RichEdit_OnGetTextRange(HWND hwnd, TEXTRANGE *lpRange) */
1997#define HANDLE_EM_GETTEXTRANGE(hwnd, wParam, lParam, fn) \
1998 (DWORD)(fn)((hwnd), (TEXTRANGE *)(lParam))
1999
2000/* DWORD RichEdit_OnFindWordBreak(HWND hwnd, UINT code, DWORD ichStart) */
2001#define HANDLE_EM_FINDWORDBREAK(hwnd, wParam, lParam, fn) \
2002 (DWORD)(fn)((hwnd), (UINT)(wParam), (DWORD)(lParam))
2003
2004/* UINT RichEdit_OnSetOptions(HWND hwnd, UINT fOperation, UINT fOptions) */
2005#define HANDLE_EM_SETOPTIONS(hwnd, wParam, lParam, fn) \
2006 (UINT)(fn)((hwnd), (UINT)(wParam), (UINT)(lParam))
2007
2008/* UINT RichEdit_OnGetOptions(HWND hwnd) */
2009#define HANDLE_EM_GETOPTIONS(hwnd, wParam, lParam, fn) \
2010 (UINT)(fn)((hwnd))
2011
2012/* INT RichEdit_OnFindTextEx(HWND hwnd, UINT fuFlags, FINDTEXTEX *lpFindText) */
2013#define HANDLE_EM_FINDTEXTEX(hwnd, wParam, lParam, fn) \
2014 (INT)(fn)((hwnd), (UINT)(wParam), (FINDTEXTEX *)(lParam))
2015
2016/* void *RichEdit_OnGetWordBreakProcEx(HWND hwnd) */
2017#define HANDLE_EM_GETWORDBREAKPROCEX(hwnd, wParam, lParam, fn) \
2018 (LRESULT)(void *)(fn)((hwnd))
2019
2020/* void *RichEdit_OnSetWordBreakProcEx(HWND hwnd, void *pfn) */
2021#define HANDLE_EM_SETWORDBREAKPROCEX(hwnd, wParam, lParam, fn) \
2022 (LRESULT)(void *)(fn)((hwnd), (void *)(lParam))
2023
2024/* DWORD RichEdit_OnSetUndoLimit(HWND hwnd, DWORD dwMaxUndo) */
2025#define HANDLE_EM_SETUNDOLIMIT(hwnd, wParam, lParam, fn) \
2026 (DWORD)(fn)((hwnd), (DWORD)(wParam))
2027
2028/* BOOL RichEdit_OnRedo(HWND hwnd) */
2029#define HANDLE_EM_REDO(hwnd, wParam, lParam, fn) \
2030 (BOOL)(fn)((hwnd))
2031
2032/* BOOL RichEdit_OnCanRedo(HWND hwnd) */
2033#define HANDLE_EM_CANREDO(hwnd, wParam, lParam, fn) \
2034 (BOOL)(fn)((hwnd))
2035
2036/* INT RichEdit_OnGetUndoName(HWND hwnd) */
2037#define HANDLE_EM_GETUNDONAME(hwnd, wParam, lParam, fn) \
2038 (INT)(fn)((hwnd))
2039
2040/* INT RichEdit_OnGetRedoName(HWND hwnd) */
2041#define HANDLE_EM_GETREDONAME(hwnd, wParam, lParam, fn) \
2042 (INT)(fn)((hwnd))
2043
2044/* void RichEdit_OnStopGroupTyping(HWND hwnd) */
2045#define HANDLE_EM_STOPGROUPTYPING(hwnd, wParam, lParam, fn) \
2046 ((fn)((hwnd)), 0L)
2047
2048/* BOOL RichEdit_OnSetTextMode(HWND hwnd, DWORD dwTextMode) */
2049#define HANDLE_EM_SETTEXTMODE(hwnd, wParam, lParam, fn) \
2050 (BOOL)(fn)((hwnd), (DWORD)(wParam))
2051
2052/* DWORD RichEdit_OnGetTextMode(HWND hwnd) */
2053#define HANDLE_EM_GETTEXTMODE(hwnd, wParam, lParam, fn) \
2054 (DWORD)(fn)((hwnd))
2055
2056#endif