1 |
27 |
unneback |
#define HANDLE_WM_COMMAND(hwnd, wParam, lParam, fn) \
|
2 |
|
|
((fn)((hwnd), (int)(LOWORD(wParam)), (HWND)(lParam), (UINT)HIWORD(wParam)), 0L)
|
3 |
|
|
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
4 |
|
|
(void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
|
5 |
|
|
|
6 |
|
|
#define HANDLE_WM_CREATE(hwnd, wParam, lParam, fn) \
|
7 |
|
|
((fn)((hwnd), (LPCREATESTRUCT)(lParam)) ? 0L : (LRESULT)-1L)
|
8 |
|
|
#define FORWARD_WM_CREATE(hwnd, lpCreateStruct, fn) \
|
9 |
|
|
(BOOL)(DWORD)(fn)((hwnd), WM_CREATE, 0L, (LPARAM)(LPCREATESTRUCT)(lpCreateStruct))
|
10 |
|
|
|
11 |
|
|
#define HANDLE_WM_DESTROY(hwnd, wParam, lParam, fn) \
|
12 |
|
|
((fn)(hwnd), 0L)
|
13 |
|
|
#define FORWARD_WM_DESTROY(hwnd, fn) \
|
14 |
|
|
(void)(fn)((hwnd), WM_DESTROY, 0L, 0L)
|
15 |
|
|
|
16 |
|
|
#define HANDLE_WM_ERASEBKGND(hwnd, wParam, lParam, fn) \
|
17 |
|
|
(LRESULT)(DWORD)(BOOL)(fn)((hwnd), (HDC)(wParam))
|
18 |
|
|
#define FORWARD_WM_ERASEBKGND(hwnd, hdc, fn) \
|
19 |
|
|
(BOOL)(DWORD)(fn)((hwnd), WM_ERASEBKGND, (WPARAM)(HDC)(hdc), 0L)
|
20 |
|
|
|
21 |
|
|
#define HANDLE_WM_LBUTTONDOWN(hwnd, wParam, lParam, fn) \
|
22 |
|
|
((fn)((hwnd), FALSE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
|
23 |
|
|
#define FORWARD_WM_LBUTTONDOWN(hwnd, fDoubleClick, x, y, keyFlags, fn) \
|
24 |
|
|
(void)(fn)((hwnd), (fDoubleClick) ? WM_LBUTTONDBLCLK : WM_LBUTTONDOWN, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
|
25 |
|
|
|
26 |
|
|
#define HANDLE_WM_LBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
|
27 |
|
|
((fn)((hwnd), TRUE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
|
28 |
|
|
|
29 |
|
|
#define HANDLE_WM_LBUTTONUP(hwnd, wParam, lParam, fn) \
|
30 |
|
|
((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
|
31 |
|
|
#define FORWARD_WM_LBUTTONUP(hwnd, x, y, keyFlags, fn) \
|
32 |
|
|
(void)(fn)((hwnd), WM_LBUTTONUP, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
|
33 |
|
|
|
34 |
|
|
#define HANDLE_WM_MOUSEMOVE(hwnd, wParam, lParam, fn) \
|
35 |
|
|
((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
|
36 |
|
|
#define FORWARD_WM_MOUSEMOVE(hwnd, x, y, keyFlags, fn) \
|
37 |
|
|
(void)(fn)((hwnd), WM_MOUSEMOVE, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
|
38 |
|
|
|
39 |
|
|
#define HANDLE_WM_SETFOCUS(hwnd, wParam, lParam, fn) \
|
40 |
|
|
((fn)((hwnd), (HWND)(wParam)), 0L)
|
41 |
|
|
#define FORWARD_WM_SETFOCUS(hwnd, hwndOldFocus, fn) \
|
42 |
|
|
(void)(fn)((hwnd), WM_SETFOCUS, (WPARAM)(HWND)(hwndOldFocus), 0L)
|
43 |
|
|
|
44 |
|
|
#define HANDLE_WM_KILLFOCUS(hwnd, wParam, lParam, fn) \
|
45 |
|
|
((fn)((hwnd), (HWND)(wParam)), 0L)
|
46 |
|
|
#define FORWARD_WM_KILLFOCUS(hwnd, hwndNewFocus, fn) \
|
47 |
|
|
(void)(fn)((hwnd), WM_KILLFOCUS, (WPARAM)(HWND)(hwndNewFocus), 0L)
|
48 |
|
|
|
49 |
|
|
#define HANDLE_WM_SETTEXT(hwnd, wParam, lParam, fn) \
|
50 |
|
|
((fn)((hwnd), (LPCTSTR)(lParam)), 0L)
|
51 |
|
|
#define FORWARD_WM_SETTEXT(hwnd, lpszText, fn) \
|
52 |
|
|
(void)(fn)((hwnd), WM_SETTEXT, 0L, (LPARAM)(LPCTSTR)(lpszText))
|
53 |
|
|
|
54 |
|
|
#define HANDLE_MSG(hwnd, message, fn) \
|
55 |
|
|
case (message): return HANDLE_##message((hwnd), (wParam), (lParam), (fn))
|