1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef _INC_WINDOWSX 7 #define _INC_WINDOWSX 8 9 #include "pshpack.h" 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 #define GetInstanceModule(hInstance) GetModuleHandle((LPCSTR)MAKELP(0,hInstance)) 16 17 #define GlobalPtrHandle(lp) ((HGLOBAL)LOWORD(GlobalHandle(SELECTOROF(lp)))) 18 19 #define GlobalLockPtr(lp) ((WINBOOL)SELECTOROF(GlobalLock(GlobalPtrHandle(lp)))) 20 #define GlobalUnlockPtr(lp) GlobalUnlock(GlobalPtrHandle(lp)) 21 22 #define GlobalAllocPtr(flags,cb) (GlobalLock(GlobalAlloc((flags),(cb)))) 23 #define GlobalReAllocPtr(lp,cbNew,flags) (GlobalUnlockPtr(lp),GlobalLock(GlobalReAlloc(GlobalPtrHandle(lp) ,(cbNew),(flags)))) 24 #define GlobalFreePtr(lp) (GlobalUnlockPtr(lp),(WINBOOL)GlobalFree(GlobalPtrHandle(lp))) 25 26 #define DeletePen(hpen) DeleteObject((HGDIOBJ)(HPEN)(hpen)) 27 #define SelectPen(hdc,hpen) ((HPEN)SelectObject((hdc),(HGDIOBJ)(HPEN)(hpen))) 28 #define GetStockPen(i) ((HPEN)GetStockObject(i)) 29 30 #define DeleteBrush(hbr) DeleteObject((HGDIOBJ)(HBRUSH)(hbr)) 31 #define SelectBrush(hdc,hbr) ((HBRUSH)SelectObject((hdc),(HGDIOBJ)(HBRUSH)(hbr))) 32 #define GetStockBrush(i) ((HBRUSH)GetStockObject(i)) 33 34 #define DeleteRgn(hrgn) DeleteObject((HGDIOBJ)(HRGN)(hrgn)) 35 36 #define CopyRgn(hrgnDst,hrgnSrc) CombineRgn(hrgnDst,hrgnSrc,0,RGN_COPY) 37 #define IntersectRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_AND) 38 #define SubtractRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_DIFF) 39 #define UnionRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_OR) 40 #define XorRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_XOR) 41 42 #define DeletePalette(hpal) DeleteObject((HGDIOBJ)(HPALETTE)(hpal)) 43 44 #define DeleteFont(hfont) DeleteObject((HGDIOBJ)(HFONT)(hfont)) 45 #define SelectFont(hdc,hfont) ((HFONT)SelectObject((hdc),(HGDIOBJ)(HFONT)(hfont))) 46 #define GetStockFont(i) ((HFONT)GetStockObject(i)) 47 48 #define DeleteBitmap(hbm) DeleteObject((HGDIOBJ)(HBITMAP)(hbm)) 49 #define SelectBitmap(hdc,hbm) ((HBITMAP)SelectObject((hdc),(HGDIOBJ)(HBITMAP)(hbm))) 50 51 #define InsetRect(lprc,dx,dy) InflateRect((lprc),-(dx),-(dy)) 52 53 #define GetWindowInstance(hwnd) ((HINSTANCE)GetWindowWord(hwnd,GWW_HINSTANCE)) 54 55 #define GetWindowStyle(hwnd) ((DWORD)GetWindowLong(hwnd,GWL_STYLE)) 56 #define GetWindowExStyle(hwnd) ((DWORD)GetWindowLong(hwnd,GWL_EXSTYLE)) 57 58 #define GetWindowOwner(hwnd) GetWindow(hwnd,GW_OWNER) 59 60 #define GetFirstChild(hwnd) GetTopWindow(hwnd) 61 #define GetFirstSibling(hwnd) GetWindow(hwnd,GW_HWNDFIRST) 62 #define GetLastSibling(hwnd) GetWindow(hwnd,GW_HWNDLAST) 63 #define GetNextSibling(hwnd) GetWindow(hwnd,GW_HWNDNEXT) 64 #define GetPrevSibling(hwnd) GetWindow(hwnd,GW_HWNDPREV) 65 66 #define GetWindowID(hwnd) GetDlgCtrlID(hwnd) 67 68 #define SetWindowRedraw(hwnd,fRedraw) ((void)SendMessage(hwnd,WM_SETREDRAW,(WPARAM)(WINBOOL)(fRedraw),0L)) 69 70 #define SubclassWindow(hwnd,lpfn) ((WNDPROC)SetWindowLong((hwnd),GWL_WNDPROC,(LPARAM)(WNDPROC)(lpfn))) 71 72 #define IsMinimized(hwnd) IsIconic(hwnd) 73 #define IsMaximized(hwnd) IsZoomed(hwnd) 74 #define IsRestored(hwnd) ((GetWindowStyle(hwnd) & (WS_MINIMIZE | WS_MAXIMIZE))==0L) 75 76 #define SetWindowFont(hwnd,hfont,fRedraw) FORWARD_WM_SETFONT((hwnd),(hfont),(fRedraw),SendMessage) 77 78 #define GetWindowFont(hwnd) FORWARD_WM_GETFONT((hwnd),SendMessage) 79 80 #define MapWindowRect(hwndFrom,hwndTo,lprc) MapWindowPoints((hwndFrom),(hwndTo),(POINT *)(lprc),2) 81 82 #define IsLButtonDown() (GetKeyState(VK_LBUTTON) < 0) 83 #define IsRButtonDown() (GetKeyState(VK_RBUTTON) < 0) 84 #define IsMButtonDown() (GetKeyState(VK_MBUTTON) < 0) 85 86 #define SubclassDialog(hwndDlg,lpfn) ((DLGPROC)SetWindowLong(hwndDlg,DWL_DLGPROC,(LPARAM)(DLGPROC)(lpfn))) 87 88 #define SetDlgMsgResult(hwnd,msg,result) (((msg)==WM_CTLCOLOR || (msg)==WM_COMPAREITEM || (msg)==WM_VKEYTOITEM || (msg)==WM_CHARTOITEM || (msg)==WM_QUERYDRAGICON || (msg)==WM_INITDIALOG) ? (WINBOOL)LOWORD(result) : (SetWindowLong((hwnd),DWL_MSGRESULT,(LPARAM)(LRESULT)(result)),TRUE)) 89 90 #define DefDlgProcEx(hwnd,msg,wParam,lParam,pfRecursion) (*(pfRecursion) = TRUE,DefDlgProc(hwnd,msg,wParam,lParam)) 91 92 #define CheckDefDlgRecursion(pfRecursion) if (*(pfRecursion)) { *(pfRecursion) = FALSE; return FALSE; } 93 94 #define HANDLE_MSG(hwnd,message,fn) case (message): return HANDLE_##message((hwnd),(wParam),(lParam),(fn)) 95 96 #define HANDLE_WM_COMPACTING(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam)),0L) 97 #define FORWARD_WM_COMPACTING(hwnd,compactRatio,fn) (void)(fn)((hwnd),WM_COMPACTING,(WPARAM)(UINT)(compactRatio),0L) 98 99 #define HANDLE_WM_WININICHANGE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(LPCSTR)(lParam)),0L) 100 #define FORWARD_WM_WININICHANGE(hwnd,lpszSectionName,fn) (void)(fn)((hwnd),WM_WININICHANGE,0,(LPARAM)(LPCSTR)(lpszSectionName)) 101 102 #define HANDLE_WM_SYSCOLORCHANGE(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 103 #define FORWARD_WM_SYSCOLORCHANGE(hwnd,fn) (void)(fn)((hwnd),WM_SYSCOLORCHANGE,0,0L) 104 105 #define HANDLE_WM_QUERYNEWPALETTE(hwnd,wParam,lParam,fn) MAKELRESULT((WINBOOL)(fn)(hwnd),0) 106 #define FORWARD_WM_QUERYNEWPALETTE(hwnd,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_QUERYNEWPALETTE,0,0L) 107 108 #define HANDLE_WM_PALETTEISCHANGING(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam)),0L) 109 #define FORWARD_WM_PALETTEISCHANGING(hwnd,hwndPaletteChange,fn) (void)(fn)((hwnd),WM_PALETTEISCHANGING,(WPARAM)(HWND)(hwndPaletteChange),0L) 110 111 #define HANDLE_WM_PALETTECHANGED(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam)),0L) 112 #define FORWARD_WM_PALETTECHANGED(hwnd,hwndPaletteChange,fn) (void)(fn)((hwnd),WM_PALETTECHANGED,(WPARAM)(HWND)(hwndPaletteChange),0L) 113 114 #define HANDLE_WM_FONTCHANGE(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 115 #define FORWARD_WM_FONTCHANGE(hwnd,fn) (void)(fn)((hwnd),WM_FONTCHANGE,0,0L) 116 117 #define HANDLE_WM_SPOOLERSTATUS(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(int)LOWORD(lParam)),0L) 118 #define FORWARD_WM_SPOOLERSTATUS(hwnd,status,cJobInQueue,fn) (void)(fn)((hwnd),WM_SPOOLERSTATUS,(WPARAM)(status),MAKELPARAM((UINT)(cJobInQueue),0)) 119 120 #define HANDLE_WM_DEVMODECHANGE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(LPCSTR)(lParam)),0L) 121 #define FORWARD_WM_DEVMODECHANGE(hwnd,lpszDeviceName,fn) (void)(fn)((hwnd),WM_DEVMODECHANGE,0,(LPARAM)(LPCSTR)(lpszDeviceName)) 122 123 #define HANDLE_WM_TIMECHANGE(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 124 #define FORWARD_WM_TIMECHANGE(hwnd,fn) (void)(fn)((hwnd),WM_TIMECHANGE,0,0L) 125 126 #define HANDLE_WM_POWER(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)(wParam)),0L) 127 #define FORWARD_WM_POWER(hwnd,code,fn) (void)(fn)((hwnd),WM_POWER,(WPARAM)(code),0L) 128 129 #define HANDLE_WM_QUERYENDSESSION(hwnd,wParam,lParam,fn) MAKELRESULT((WINBOOL)(fn)(hwnd),0) 130 #define FORWARD_WM_QUERYENDSESSION(hwnd,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_QUERYENDSESSION,0,0L) 131 132 #define HANDLE_WM_ENDSESSION(hwnd,wParam,lParam,fn) ((fn)((hwnd),(WINBOOL)(wParam)),0L) 133 #define FORWARD_WM_ENDSESSION(hwnd,fEnding,fn) (void)(fn)((hwnd),WM_ENDSESSION,(WPARAM)(WINBOOL)(fEnding),0L) 134 135 #define HANDLE_WM_QUIT(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)(wParam)),0L) 136 #define FORWARD_WM_QUIT(hwnd,exitCode,fn) (void)(fn)((hwnd),WM_QUIT,(WPARAM)(exitCode),0L) 137 138 #define HANDLE_WM_SYSTEMERROR(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)(wParam)),0L) 139 #define FORWARD_WM_SYSTEMERROR(hwnd,errCode,fn) (void)(fn)((hwnd),WM_SYSTEMERROR,(WPARAM)(errCode),0L) 140 141 #define HANDLE_WM_CREATE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(CREATESTRUCT *)(lParam)) ? 0L : (LRESULT)-1L) 142 #define FORWARD_WM_CREATE(hwnd,lpCreateStruct,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_CREATE,0,(LPARAM)(CREATESTRUCT *)(lpCreateStruct)) 143 144 #define HANDLE_WM_NCCREATE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(WINBOOL)(fn)((hwnd),(CREATESTRUCT *)(lParam)) 145 #define FORWARD_WM_NCCREATE(hwnd,lpCreateStruct,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_NCCREATE,0,(LPARAM)(CREATESTRUCT *)(lpCreateStruct)) 146 147 #define HANDLE_WM_DESTROY(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 148 #define FORWARD_WM_DESTROY(hwnd,fn) (void)(fn)((hwnd),WM_DESTROY,0,0L) 149 150 #define HANDLE_WM_NCDESTROY(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 151 #define FORWARD_WM_NCDESTROY(hwnd,fn) (void)(fn)((hwnd),WM_NCDESTROY,0,0L) 152 153 #define HANDLE_WM_SHOWWINDOW(hwnd,wParam,lParam,fn) ((fn)((hwnd),(WINBOOL)(wParam),LOWORD(lParam)),0L) 154 #define FORWARD_WM_SHOWWINDOW(hwnd,fShow,status,fn) (void)(fn)((hwnd),WM_SHOWWINDOW,(WPARAM)(WINBOOL)(fShow),MAKELPARAM((UINT)(status),0)) 155 156 #define HANDLE_WM_SETREDRAW(hwnd,wParam,lParam,fn) ((fn)((hwnd),(WINBOOL)(wParam)),0L) 157 #define FORWARD_WM_SETREDRAW(hwnd,fRedraw,fn) (void)(fn)((hwnd),WM_SETREDRAW,(WPARAM)(fRedraw),0L) 158 159 #define HANDLE_WM_ENABLE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(WINBOOL)(wParam)),0L) 160 #define FORWARD_WM_ENABLE(hwnd,fEnable,fn) (void)(fn)((hwnd),WM_ENABLE,(WPARAM)(WINBOOL)(fEnable),0L) 161 162 #define HANDLE_WM_SETTEXT(hwnd,wParam,lParam,fn) ((fn)((hwnd),(LPCSTR)(lParam)),0L) 163 #define FORWARD_WM_SETTEXT(hwnd,lpszText,fn) (void)(fn)((hwnd),WM_SETTEXT,0,(LPARAM)(LPCSTR)(lpszText)) 164 165 #define HANDLE_WM_GETTEXT(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(int)(fn)((hwnd),(int)(wParam),(LPSTR)(lParam)) 166 #define FORWARD_WM_GETTEXT(hwnd,cchTextMax,lpszText,fn) (int)(DWORD)(fn)((hwnd),WM_GETTEXT,(WPARAM)(int)(cchTextMax),(LPARAM)(LPSTR)(lpszText)) 167 168 #define HANDLE_WM_GETTEXTLENGTH(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(int)(fn)(hwnd) 169 #define FORWARD_WM_GETTEXTLENGTH(hwnd,fn) (int)(DWORD)(fn)((hwnd),WM_GETTEXTLENGTH,0,0L) 170 171 #define HANDLE_WM_WINDOWPOSCHANGING(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(WINBOOL)(fn)((hwnd),(WINDOWPOS *)(lParam)) 172 #define FORWARD_WM_WINDOWPOSCHANGING(hwnd,lpwpos,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_WINDOWPOSCHANGING,0,(LPARAM)(WINDOWPOS *)(lpwpos)) 173 174 #define HANDLE_WM_WINDOWPOSCHANGED(hwnd,wParam,lParam,fn) ((fn)((hwnd),(const WINDOWPOS *)(lParam)),0L) 175 #define FORWARD_WM_WINDOWPOSCHANGED(hwnd,lpwpos,fn) (void)(fn)((hwnd),WM_WINDOWPOSCHANGED,0,(LPARAM)(const WINDOWPOS *)(lpwpos)) 176 177 #define HANDLE_WM_MOVE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam)),0L) 178 #define FORWARD_WM_MOVE(hwnd,x,y,fn) (void)(fn)((hwnd),WM_MOVE,0,MAKELPARAM((int)(x),(int)(y))) 179 180 #define HANDLE_WM_SIZE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(int)LOWORD(lParam),(int)HIWORD(lParam)),0L) 181 #define FORWARD_WM_SIZE(hwnd,state,cx,cy,fn) (void)(fn)((hwnd),WM_SIZE,(WPARAM)(UINT)(state),MAKELPARAM((int)(cx),(int)(cy))) 182 183 #define HANDLE_WM_CLOSE(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 184 #define FORWARD_WM_CLOSE(hwnd,fn) (void)(fn)((hwnd),WM_CLOSE,0,0L) 185 186 #define HANDLE_WM_QUERYOPEN(hwnd,wParam,lParam,fn) MAKELRESULT((WINBOOL)(fn)(hwnd),0) 187 #define FORWARD_WM_QUERYOPEN(hwnd,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_QUERYOPEN,0,0L) 188 189 #define HANDLE_WM_GETMINMAXINFO(hwnd,wParam,lParam,fn) ((fn)((hwnd),(MINMAXINFO *)(lParam)),0L) 190 #define FORWARD_WM_GETMINMAXINFO(hwnd,lpMinMaxInfo,fn) (void)(fn)((hwnd),WM_GETMINMAXINFO,0,(LPARAM)(MINMAXINFO *)(lpMinMaxInfo)) 191 192 #define HANDLE_WM_PAINT(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 193 #define FORWARD_WM_PAINT(hwnd,fn) (void)(fn)((hwnd),WM_PAINT,0,0L) 194 195 #define HANDLE_WM_ERASEBKGND(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(WINBOOL)(fn)((hwnd),(HDC)(wParam)) 196 #define FORWARD_WM_ERASEBKGND(hwnd,hdc,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_ERASEBKGND,(WPARAM)(HDC)(hdc),0L) 197 198 #define HANDLE_WM_ICONERASEBKGND(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(WINBOOL)(fn)((hwnd),(HDC)(wParam)) 199 #define FORWARD_WM_ICONERASEBKGND(hwnd,hdc,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_ICONERASEBKGND,(WPARAM)(HDC)(hdc),0L) 200 201 #define HANDLE_WM_NCPAINT(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HRGN)(wParam)),0L) 202 #define FORWARD_WM_NCPAINT(hwnd,hrgn,fn) (void)(fn)((hwnd),WM_NCPAINT,(WPARAM)(HRGN)(hrgn),0L) 203 204 #define HANDLE_WM_NCCALCSIZE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(fn)((hwnd),(WINBOOL)(wParam),(NCCALCSIZE_PARAMS *)(lParam)) 205 #define FORWARD_WM_NCCALCSIZE(hwnd,fCalcValidRects,lpcsp,fn) (UINT)(DWORD)(fn)((hwnd),WM_NCCALCSIZE,(WPARAM)(fCalcValidRects),(LPARAM)(NCCALCSIZE_PARAMS *)(lpcsp)) 206 207 #define HANDLE_WM_NCHITTEST(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam)) 208 #define FORWARD_WM_NCHITTEST(hwnd,x,y,fn) (UINT)(DWORD)(fn)((hwnd),WM_NCHITTEST,0,MAKELPARAM((int)(x),(int)(y))) 209 210 #define HANDLE_WM_QUERYDRAGICON(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(fn)(hwnd) 211 #define FORWARD_WM_QUERYDRAGICON(hwnd,fn) (HICON)(UINT)(DWORD)(fn)((hwnd),WM_QUERYDRAGICON,0,0L) 212 213 #ifdef _INC_SHELLAPI 214 215 #define HANDLE_WM_DROPFILES(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HDROP)(wParam)),0L) 216 #define FORWARD_WM_DROPFILES(hwnd,hdrop,fn) (void)(fn)((hwnd),WM_DROPFILES,(WPARAM)(hdrop),0L) 217 #endif 218 219 #define HANDLE_WM_ACTIVATE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(HWND)LOWORD(lParam),(WINBOOL)HIWORD(lParam)),0L) 220 #define FORWARD_WM_ACTIVATE(hwnd,state,hwndActDeact,fMinimized,fn) (void)(fn)((hwnd),WM_ACTIVATE,(WPARAM)(UINT)(state),MAKELPARAM((UINT)(HWND)(hwndActDeact),(UINT)(WINBOOL)(fMinimized))) 221 222 #define HANDLE_WM_ACTIVATEAPP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(WINBOOL)(wParam),(HTASK)LOWORD(lParam)),0L) 223 #define FORWARD_WM_ACTIVATEAPP(hwnd,fActivate,htaskActDeact,fn) (void)(fn)((hwnd),WM_ACTIVATEAPP,(WPARAM)(WINBOOL)(fActivate),MAKELPARAM((htaskActDeact),0)) 224 225 #define HANDLE_WM_NCACTIVATE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(WINBOOL)(fn)((hwnd),(WINBOOL)(wParam),(HWND)LOWORD(lParam),(WINBOOL)HIWORD(lParam)) 226 #define FORWARD_WM_NCACTIVATE(hwnd,fActive,hwndActDeact,fMinimized,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_NCACTIVATE,(WPARAM)(WINBOOL)(fActive),MAKELPARAM((UINT)(HWND)(hwndActDeact),(UINT)(WINBOOL)(fMinimized))) 227 228 #define HANDLE_WM_SETFOCUS(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam)),0L) 229 #define FORWARD_WM_SETFOCUS(hwnd,hwndOldFocus,fn) (void)(fn)((hwnd),WM_SETFOCUS,(WPARAM)(HWND)(hwndOldFocus),0L) 230 231 #define HANDLE_WM_KILLFOCUS(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam)),0L) 232 #define FORWARD_WM_KILLFOCUS(hwnd,hwndNewFocus,fn) (void)(fn)((hwnd),WM_KILLFOCUS,(WPARAM)(HWND)(hwndNewFocus),0L) 233 234 #define HANDLE_WM_KEYDOWN(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),TRUE,(int)LOWORD(lParam),(UINT)HIWORD(lParam)),0L) 235 #define FORWARD_WM_KEYDOWN(hwnd,vk,cRepeat,flags,fn) (void)(fn)((hwnd),WM_KEYDOWN,(WPARAM)(UINT)(vk),MAKELPARAM((UINT)(cRepeat),(UINT)(flags))) 236 237 #define HANDLE_WM_KEYUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),FALSE,(int)LOWORD(lParam),(UINT)HIWORD(lParam)),0L) 238 #define FORWARD_WM_KEYUP(hwnd,vk,cRepeat,flags,fn) (void)(fn)((hwnd),WM_KEYUP,(WPARAM)(UINT)(vk),MAKELPARAM((UINT)(cRepeat),(UINT)(flags))) 239 240 #define HANDLE_WM_CHAR(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(int)LOWORD(lParam)),0L) 241 #define FORWARD_WM_CHAR(hwnd,ch,cRepeat,fn) (void)(fn)((hwnd),WM_CHAR,(WPARAM)(UINT)(ch),MAKELPARAM((UINT)(cRepeat),0)) 242 243 #define HANDLE_WM_DEADCHAR(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(int)LOWORD(lParam)),0L) 244 #define FORWARD_WM_DEADCHAR(hwnd,ch,cRepeat,fn) (void)(fn)((hwnd),WM_DEADCHAR,(WPARAM)(UINT)(ch),MAKELPARAM((UINT)(cRepeat),0)) 245 246 #define HANDLE_WM_SYSKEYDOWN(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),TRUE,(int)LOWORD(lParam),(UINT)HIWORD(lParam)),0L) 247 #define FORWARD_WM_SYSKEYDOWN(hwnd,vk,cRepeat,flags,fn) (void)(fn)((hwnd),WM_SYSKEYDOWN,(WPARAM)(UINT)(vk),MAKELPARAM((UINT)(cRepeat),(UINT)(flags))) 248 249 #define HANDLE_WM_SYSKEYUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),FALSE,(int)LOWORD(lParam),(UINT)HIWORD(lParam)),0L) 250 #define FORWARD_WM_SYSKEYUP(hwnd,vk,cRepeat,flags,fn) (void)(fn)((hwnd),WM_SYSKEYUP,(WPARAM)(UINT)(vk),MAKELPARAM((UINT)(cRepeat),(UINT)(flags))) 251 252 #define HANDLE_WM_SYSCHAR(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(int)LOWORD(lParam)),0L) 253 #define FORWARD_WM_SYSCHAR(hwnd,ch,cRepeat,fn) (void)(fn)((hwnd),WM_SYSCHAR,(WPARAM)(UINT)(ch),MAKELPARAM((UINT)(cRepeat),0)) 254 255 #define HANDLE_WM_SYSDEADCHAR(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(int)LOWORD(lParam)),0L) 256 #define FORWARD_WM_SYSDEADCHAR(hwnd,ch,cRepeat,fn) (void)(fn)((hwnd),WM_SYSDEADCHAR,(WPARAM)(UINT)(ch),MAKELPARAM((UINT)(cRepeat),0)) 257 258 #define HANDLE_WM_MOUSEMOVE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 259 #define FORWARD_WM_MOUSEMOVE(hwnd,x,y,keyFlags,fn) (void)(fn)((hwnd),WM_MOUSEMOVE,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y))) 260 261 #define HANDLE_WM_LBUTTONDOWN(hwnd,wParam,lParam,fn) ((fn)((hwnd),FALSE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 262 #define FORWARD_WM_LBUTTONDOWN(hwnd,fDoubleClick,x,y,keyFlags,fn) (void)(fn)((hwnd),(fDoubleClick) ? WM_LBUTTONDBLCLK : WM_LBUTTONDOWN,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y))) 263 264 #define HANDLE_WM_LBUTTONDBLCLK(hwnd,wParam,lParam,fn) ((fn)((hwnd),TRUE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 265 266 #define HANDLE_WM_LBUTTONUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 267 #define FORWARD_WM_LBUTTONUP(hwnd,x,y,keyFlags,fn) (void)(fn)((hwnd),WM_LBUTTONUP,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y))) 268 269 #define HANDLE_WM_RBUTTONDOWN(hwnd,wParam,lParam,fn) ((fn)((hwnd),FALSE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 270 #define FORWARD_WM_RBUTTONDOWN(hwnd,fDoubleClick,x,y,keyFlags,fn) (void)(fn)((hwnd),(fDoubleClick) ? WM_RBUTTONDBLCLK : WM_RBUTTONDOWN,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y))) 271 272 #define HANDLE_WM_RBUTTONDBLCLK(hwnd,wParam,lParam,fn) ((fn)((hwnd),TRUE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 273 274 #define HANDLE_WM_RBUTTONUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 275 #define FORWARD_WM_RBUTTONUP(hwnd,x,y,keyFlags,fn) (void)(fn)((hwnd),WM_RBUTTONUP,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y))) 276 277 #define HANDLE_WM_MBUTTONDOWN(hwnd,wParam,lParam,fn) ((fn)((hwnd),FALSE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 278 #define FORWARD_WM_MBUTTONDOWN(hwnd,fDoubleClick,x,y,keyFlags,fn) (void)(fn)((hwnd),(fDoubleClick) ? WM_MBUTTONDBLCLK : WM_MBUTTONDOWN,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y))) 279 280 #define HANDLE_WM_MBUTTONDBLCLK(hwnd,wParam,lParam,fn) ((fn)((hwnd),TRUE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 281 282 #define HANDLE_WM_MBUTTONUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 283 #define FORWARD_WM_MBUTTONUP(hwnd,x,y,keyFlags,fn) (void)(fn)((hwnd),WM_MBUTTONUP,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y))) 284 285 #define HANDLE_WM_NCMOUSEMOVE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 286 #define FORWARD_WM_NCMOUSEMOVE(hwnd,x,y,codeHitTest,fn) (void)(fn)((hwnd),WM_NCMOUSEMOVE,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y))) 287 288 #define HANDLE_WM_NCLBUTTONDOWN(hwnd,wParam,lParam,fn) ((fn)((hwnd),FALSE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 289 #define FORWARD_WM_NCLBUTTONDOWN(hwnd,fDoubleClick,x,y,codeHitTest,fn) (void)(fn)((hwnd),(fDoubleClick) ? WM_NCLBUTTONDBLCLK : WM_NCLBUTTONDOWN,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y))) 290 291 #define HANDLE_WM_NCLBUTTONDBLCLK(hwnd,wParam,lParam,fn) ((fn)((hwnd),TRUE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 292 293 #define HANDLE_WM_NCLBUTTONUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 294 #define FORWARD_WM_NCLBUTTONUP(hwnd,x,y,codeHitTest,fn) (void)(fn)((hwnd),WM_NCLBUTTONUP,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y))) 295 296 #define HANDLE_WM_NCRBUTTONDOWN(hwnd,wParam,lParam,fn) ((fn)((hwnd),FALSE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 297 #define FORWARD_WM_NCRBUTTONDOWN(hwnd,fDoubleClick,x,y,codeHitTest,fn) (void)(fn)((hwnd),(fDoubleClick) ? WM_NCRBUTTONDBLCLK : WM_NCRBUTTONDOWN,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y))) 298 299 #define HANDLE_WM_NCRBUTTONDBLCLK(hwnd,wParam,lParam,fn) ((fn)((hwnd),TRUE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 300 301 #define HANDLE_WM_NCRBUTTONUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 302 #define FORWARD_WM_NCRBUTTONUP(hwnd,x,y,codeHitTest,fn) (void)(fn)((hwnd),WM_NCRBUTTONUP,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y))) 303 304 #define HANDLE_WM_NCMBUTTONDOWN(hwnd,wParam,lParam,fn) ((fn)((hwnd),FALSE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 305 #define FORWARD_WM_NCMBUTTONDOWN(hwnd,fDoubleClick,x,y,codeHitTest,fn) (void)(fn)((hwnd),(fDoubleClick) ? WM_NCMBUTTONDBLCLK : WM_NCMBUTTONDOWN,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y))) 306 307 #define HANDLE_WM_NCMBUTTONDBLCLK(hwnd,wParam,lParam,fn) ((fn)((hwnd),TRUE,(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 308 309 #define HANDLE_WM_NCMBUTTONUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L) 310 #define FORWARD_WM_NCMBUTTONUP(hwnd,x,y,codeHitTest,fn) (void)(fn)((hwnd),WM_NCMBUTTONUP,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y))) 311 312 #define HANDLE_WM_MOUSEACTIVATE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(int)(fn)((hwnd),(HWND)(wParam),(UINT)LOWORD(lParam),(UINT)HIWORD(lParam)) 313 #define FORWARD_WM_MOUSEACTIVATE(hwnd,hwndTopLevel,codeHitTest,msg,fn) (int)(DWORD)(fn)((hwnd),WM_MOUSEACTIVATE,(WPARAM)(HWND)(hwndTopLevel),MAKELPARAM((codeHitTest),(msg))) 314 315 #define HANDLE_WM_CANCELMODE(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 316 #define FORWARD_WM_CANCELMODE(hwnd,fn) (void)(fn)((hwnd),WM_CANCELMODE,0,0L) 317 318 #define HANDLE_WM_TIMER(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam)),0L) 319 #define FORWARD_WM_TIMER(hwnd,id,fn) (void)(fn)((hwnd),WM_TIMER,(WPARAM)(UINT)(id),0L) 320 321 #define HANDLE_WM_INITMENU(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HMENU)(wParam)),0L) 322 #define FORWARD_WM_INITMENU(hwnd,hMenu,fn) (void)(fn)((hwnd),WM_INITMENU,(WPARAM)(HMENU)(hMenu),0L) 323 324 #define HANDLE_WM_INITMENUPOPUP(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HMENU)(wParam),(int)LOWORD(lParam),(WINBOOL)HIWORD(lParam)),0L) 325 #define FORWARD_WM_INITMENUPOPUP(hwnd,hMenu,item,fSystemMenu,fn) (void)(fn)((hwnd),WM_INITMENUPOPUP,(WPARAM)(HMENU)(hMenu),MAKELPARAM((item),(fSystemMenu))) 326 327 #define HANDLE_WM_MENUSELECT(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HMENU)HIWORD(lParam),(LOWORD(lParam) & MF_POPUP) ? 0 : (int)(wParam),(LOWORD(lParam) & MF_POPUP) ? (HMENU)(wParam) : 0,LOWORD(lParam)),0L) 328 #define FORWARD_WM_MENUSELECT(hwnd,hmenu,item,hmenuPopup,flags,fn) (void)(fn)((hwnd),WM_MENUSELECT,((flags) & MF_POPUP) ? (WPARAM)(HMENU)(hmenuPopup) : (WPARAM)(int)(item),MAKELPARAM((flags),(hmenu))) 329 330 #define HANDLE_WM_MENUCHAR(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(fn)((hwnd),(UINT)(wParam),LOWORD(lParam),(HMENU)HIWORD(lParam)) 331 #define FORWARD_WM_MENUCHAR(hwnd,ch,flags,hmenu,fn) (DWORD)(fn)((hwnd),WM_MENUCHAR,(WPARAM)(UINT)(ch),MAKELPARAM((flags),(UINT)(hmenu))) 332 333 #define HANDLE_WM_COMMAND(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)(wParam),(HWND)LOWORD(lParam),(UINT)HIWORD(lParam)),0L) 334 #define FORWARD_WM_COMMAND(hwnd,id,hwndCtl,codeNotify,fn) (void)(fn)((hwnd),WM_COMMAND,(WPARAM)(int)(id),MAKELPARAM((UINT)(hwndCtl),(codeNotify))) 335 336 #define HANDLE_WM_HSCROLL(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)HIWORD(lParam),(UINT)(wParam),(int)LOWORD(lParam)),0L) 337 #define FORWARD_WM_HSCROLL(hwnd,hwndCtl,code,pos,fn) (void)(fn)((hwnd),WM_HSCROLL,(WPARAM)(UINT)(code),MAKELPARAM((pos),(UINT)(hwndCtl))) 338 339 #define HANDLE_WM_VSCROLL(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)HIWORD(lParam),(UINT)(wParam),(int)LOWORD(lParam)),0L) 340 #define FORWARD_WM_VSCROLL(hwnd,hwndCtl,code,pos,fn) (void)(fn)((hwnd),WM_VSCROLL,(WPARAM)(UINT)(code),MAKELPARAM((pos),(UINT)(hwndCtl))) 341 342 #define HANDLE_WM_CUT(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 343 #define FORWARD_WM_CUT(hwnd,fn) (void)(fn)((hwnd),WM_CUT,0,0L) 344 345 #define HANDLE_WM_COPY(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 346 #define FORWARD_WM_COPY(hwnd,fn) (void)(fn)((hwnd),WM_COPY,0,0L) 347 348 #define HANDLE_WM_PASTE(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 349 #define FORWARD_WM_PASTE(hwnd,fn) (void)(fn)((hwnd),WM_PASTE,0,0L) 350 351 #define HANDLE_WM_CLEAR(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 352 #define FORWARD_WM_CLEAR(hwnd,fn) (void)(fn)((hwnd),WM_CLEAR,0,0L) 353 354 #define HANDLE_WM_UNDO(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 355 #define FORWARD_WM_UNDO(hwnd,fn) (void)(fn)((hwnd),WM_UNDO,0,0L) 356 357 #define HANDLE_WM_RENDERFORMAT(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(HANDLE)(fn)((hwnd),(UINT)(wParam)) 358 #define FORWARD_WM_RENDERFORMAT(hwnd,fmt,fn) (HANDLE)(UINT)(DWORD)(fn)((hwnd),WM_RENDERFORMAT,(WPARAM)(UINT)(fmt),0L) 359 360 #define HANDLE_WM_RENDERALLFORMATS(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 361 #define FORWARD_WM_RENDERALLFORMATS(hwnd,fn) (void)(fn)((hwnd),WM_RENDERALLFORMATS,0,0L) 362 363 #define HANDLE_WM_DESTROYCLIPBOARD(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 364 #define FORWARD_WM_DESTROYCLIPBOARD(hwnd,fn) (void)(fn)((hwnd),WM_DESTROYCLIPBOARD,0,0L) 365 366 #define HANDLE_WM_DRAWCLIPBOARD(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 367 #define FORWARD_WM_DRAWCLIPBOARD(hwnd,fn) (void)(fn)((hwnd),WM_DRAWCLIPBOARD,0,0L) 368 369 #define HANDLE_WM_PAINTCLIPBOARD(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam),(const PAINTSTRUCT *)GlobalLock((HGLOBAL)LOWORD(lParam))),GlobalUnlock((HGLOBAL)LOWORD(lParam)),0L) 370 #define FORWARD_WM_PAINTCLIPBOARD(hwnd,hwndCBViewer,lpPaintStruct,fn) (void)(fn)((hwnd),WM_PAINTCLIPBOARD,(WPARAM)(HWND)(hwndCBViewer),(LPARAM)(lpPaintStruct)) 371 372 #define HANDLE_WM_SIZECLIPBOARD(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam),(const RECT *)GlobalLock((HGLOBAL)LOWORD(lParam))),GlobalUnlock((HGLOBAL)LOWORD(lParam)),0L) 373 #define FORWARD_WM_SIZECLIPBOARD(hwnd,hwndCBViewer,lprc,fn) (void)(fn)((hwnd),WM_SIZECLIPBOARD,(WPARAM)(HWND)(hwndCBViewer),(LPARAM)(lprc)) 374 375 #define HANDLE_WM_VSCROLLCLIPBOARD(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam),LOWORD(lParam),(int)HIWORD(lParam)),0L) 376 #define FORWARD_WM_VSCROLLCLIPBOARD(hwnd,hwndCBViewer,code,pos,fn) (void)(fn)((hwnd),WM_VSCROLLCLIPBOARD,(WPARAM)(HWND)(hwndCBViewer),MAKELPARAM((code),(pos))) 377 378 #define HANDLE_WM_HSCROLLCLIPBOARD(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam),LOWORD(lParam),(int)HIWORD(lParam)),0L) 379 #define FORWARD_WM_HSCROLLCLIPBOARD(hwnd,hwndCBViewer,code,pos,fn) (void)(fn)((hwnd),WM_HSCROLLCLIPBOARD,(WPARAM)(HWND)(hwndCBViewer),MAKELPARAM((code),(pos))) 380 381 #define HANDLE_WM_ASKCBFORMATNAME(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)(wParam),(LPSTR)(lParam)),0L) 382 #define FORWARD_WM_ASKCBFORMATNAME(hwnd,cchMax,rgchName,fn) (void)(fn)((hwnd),WM_ASKCBFORMATNAME,(WPARAM)(int)(cchMax),(LPARAM)(rgchName)) 383 384 #define HANDLE_WM_CHANGECBCHAIN(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam),(HWND)LOWORD(lParam)),0L) 385 #define FORWARD_WM_CHANGECBCHAIN(hwnd,hwndRemove,hwndNext,fn) (void)(fn)((hwnd),WM_CHANGECBCHAIN,(WPARAM)(HWND)(hwndRemove),MAKELPARAM((UINT)(hwndNext),0)) 386 387 #define HANDLE_WM_SETCURSOR(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(WINBOOL)(fn)((hwnd),(HWND)(wParam),(UINT)LOWORD(lParam),(UINT)HIWORD(lParam)) 388 #define FORWARD_WM_SETCURSOR(hwnd,hwndCursor,codeHitTest,msg,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_SETCURSOR,(WPARAM)(HWND)(hwndCursor),MAKELPARAM((codeHitTest),(msg))) 389 390 #define HANDLE_WM_SYSCOMMAND(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(int)LOWORD(lParam),(int)HIWORD(lParam)),0L) 391 #define FORWARD_WM_SYSCOMMAND(hwnd,cmd,x,y,fn) (void)(fn)((hwnd),WM_SYSCOMMAND,(WPARAM)(UINT)(cmd),MAKELPARAM((x),(y))) 392 393 #define HANDLE_WM_MDICREATE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(fn)((hwnd),(MDICREATESTRUCT *)(lParam)) 394 #define FORWARD_WM_MDICREATE(hwnd,lpmcs,fn) (HWND)(UINT)(DWORD)(fn)((hwnd),WM_MDICREATE,0,(LPARAM)(lpmcs)) 395 396 #define HANDLE_WM_MDIDESTROY(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam)),0L) 397 #define FORWARD_WM_MDIDESTROY(hwnd,hwndDestroy,fn) (void)(fn)((hwnd),WM_MDIDESTROY,(WPARAM)(hwndDestroy),0L) 398 399 #define HANDLE_WM_MDIACTIVATE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(WINBOOL)(wParam),(HWND)LOWORD(lParam),(HWND)HIWORD(lParam)),0L) 400 #define FORWARD_WM_MDIACTIVATE(hwnd,fActive,hwndActivate,hwndDeactivate,fn) (void)(fn)(hwnd,WM_MDIACTIVATE,(WPARAM)(fActive),MAKELPARAM((hwndActivate),(hwndDeactivate))) 401 402 #define HANDLE_WM_MDIRESTORE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam)),0L) 403 #define FORWARD_WM_MDIRESTORE(hwnd,hwndRestore,fn) (void)(fn)((hwnd),WM_MDIRESTORE,(WPARAM)(hwndRestore),0L) 404 405 #define HANDLE_WM_MDINEXT(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam),(WINBOOL)LOWORD(lParam)),0L) 406 #define FORWARD_WM_MDINEXT(hwnd,hwndCur,fPrev,fn) (HWND)(UINT)(DWORD)(fn)((hwnd),WM_MDINEXT,(WPARAM)(hwndCur),MAKELPARAM((fPrev),0)) 407 408 #define HANDLE_WM_MDIMAXIMIZE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HWND)(wParam)),0L) 409 #define FORWARD_WM_MDIMAXIMIZE(hwnd,hwndMaximize,fn) (void)(fn)((hwnd),WM_MDIMAXIMIZE,(WPARAM)(hwndMaximize),0L) 410 411 #define HANDLE_WM_MDITILE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(fn)((hwnd),(UINT)(wParam)) 412 #define FORWARD_WM_MDITILE(hwnd,cmd,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_MDITILE,(WPARAM)(cmd),0L) 413 414 #define HANDLE_WM_MDICASCADE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(fn)((hwnd),(UINT)(wParam)) 415 #define FORWARD_WM_MDICASCADE(hwnd,cmd,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_MDICASCADE,(WPARAM)(cmd),0L) 416 417 #define HANDLE_WM_MDIICONARRANGE(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 418 #define FORWARD_WM_MDIICONARRANGE(hwnd,fn) (void)(fn)((hwnd),WM_MDIICONARRANGE,0,0L) 419 420 #define HANDLE_WM_MDIGETACTIVE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(fn)(hwnd) 421 #define FORWARD_WM_MDIGETACTIVE(hwnd,fn) (HWND)(UINT)(DWORD)(fn)((hwnd),WM_MDIGETACTIVE,0,0L) 422 423 #define HANDLE_WM_MDISETMENU(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(fn)((hwnd),(WINBOOL)(wParam),(HMENU)LOWORD(lParam),(HMENU)HIWORD(lParam)) 424 #define FORWARD_WM_MDISETMENU(hwnd,fRefresh,hmenuFrame,hmenuWindow,fn) (HMENU)(UINT)(DWORD)(fn)((hwnd),WM_MDISETMENU,(WPARAM)(fRefresh),MAKELPARAM((hmenuFrame),(hmenuWindow))) 425 426 #define HANDLE_WM_CHILDACTIVATE(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 427 #define FORWARD_WM_CHILDACTIVATE(hwnd,fn) (void)(fn)((hwnd),WM_CHILDACTIVATE,0,0L) 428 429 #define HANDLE_WM_INITDIALOG(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(WINBOOL)(fn)((hwnd),(HWND)(wParam),lParam) 430 #define FORWARD_WM_INITDIALOG(hwnd,hwndFocus,lParam,fn) (WINBOOL)(DWORD)(fn)((hwnd),WM_INITDIALOG,(WPARAM)(HWND)(hwndFocus),(lParam)) 431 432 #define HANDLE_WM_NEXTDLGCTL(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(HWND)(fn)((hwnd),(HWND)(wParam),(WINBOOL)LOWORD(lParam)) 433 #define FORWARD_WM_NEXTDLGCTL(hwnd,hwndSetFocus,fNext,fn) (HWND)(UINT)(DWORD)(fn)((hwnd),WM_NEXTDLGCTL,(WPARAM)(HWND)(hwndSetFocus),MAKELPARAM((fNext),0)) 434 435 #define HANDLE_WM_PARENTNOTIFY(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(HWND)LOWORD(lParam),(UINT)HIWORD(lParam)),0L) 436 #define FORWARD_WM_PARENTNOTIFY(hwnd,msg,hwndChild,idChild,fn) (void)(fn)((hwnd),WM_PARENTNOTIFY,(WPARAM)(UINT)(msg),MAKELPARAM((UINT)(HWND)(hwndChild),(UINT)(idChild))) 437 438 #define HANDLE_WM_ENTERIDLE(hwnd,wParam,lParam,fn) ((fn)((hwnd),(UINT)(wParam),(HWND)LOWORD(lParam)),0L) 439 #define FORWARD_WM_ENTERIDLE(hwnd,source,hwndSource,fn) (void)(fn)((hwnd),WM_ENTERIDLE,(WPARAM)(UINT)(source),MAKELPARAM((UINT)(HWND)(hwndSource),0)) 440 441 #define HANDLE_WM_GETDLGCODE(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(fn)(hwnd,(MSG *)(lParam)) 442 #define FORWARD_WM_GETDLGCODE(hwnd,lpmsg,fn) (UINT)(DWORD)(fn)((hwnd),WM_GETDLGCODE,(SELECTOROF(lpmsg) ? lpmsg->wParam : 0),(LPARAM)(lpmsg)) 443 444 #define HANDLE_WM_CTLCOLOR(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd),(HDC)(wParam),(HWND)LOWORD(lParam),(int)(HIWORD(lParam))) 445 #define FORWARD_WM_CTLCOLOR(hwnd,hdc,hwndChild,type,fn) (HBRUSH)(UINT)(DWORD)(fn)((hwnd),WM_CTLCOLOR,(WPARAM)(HDC)(hdc),MAKELPARAM((UINT)(HWND)(hwndChild),(UINT)(int)(type))) 446 447 #define HANDLE_WM_SETFONT(hwnd,wParam,lParam,fn) ((fn)((hwnd),(HFONT)(wParam),(WINBOOL)LOWORD(lParam)),0L) 448 #define FORWARD_WM_SETFONT(hwnd,hfont,fRedraw,fn) (void)(fn)((hwnd),WM_SETFONT,(WPARAM)(HFONT)(hfont),MAKELPARAM((UINT)(WINBOOL)(fRedraw),0)) 449 450 #define HANDLE_WM_GETFONT(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(UINT)(HFONT)(fn)(hwnd) 451 #define FORWARD_WM_GETFONT(hwnd,fn) (HFONT)(UINT)(DWORD)(fn)((hwnd),WM_GETFONT,0,0L) 452 453 #define HANDLE_WM_DRAWITEM(hwnd,wParam,lParam,fn) ((fn)((hwnd),(const DRAWITEMSTRUCT *)(lParam)),0L) 454 #define FORWARD_WM_DRAWITEM(hwnd,lpDrawItem,fn) (void)(fn)((hwnd),WM_DRAWITEM,0,(LPARAM)(const DRAWITEMSTRUCT *)(lpDrawItem)) 455 456 #define HANDLE_WM_MEASUREITEM(hwnd,wParam,lParam,fn) ((fn)((hwnd),(MEASUREITEMSTRUCT *)(lParam)),0L) 457 #define FORWARD_WM_MEASUREITEM(hwnd,lpMeasureItem,fn) (void)(fn)((hwnd),WM_MEASUREITEM,0,(LPARAM)(MEASUREITEMSTRUCT *)(lpMeasureItem)) 458 459 #define HANDLE_WM_DELETEITEM(hwnd,wParam,lParam,fn) ((fn)((hwnd),(const DELETEITEMSTRUCT *)(lParam)),0L) 460 #define FORWARD_WM_DELETEITEM(hwnd,lpDeleteItem,fn) (void)(fn)((hwnd),WM_DELETEITEM,0,(LPARAM)(const DELETEITEMSTRUCT *)(lpDeleteItem)) 461 462 #define HANDLE_WM_COMPAREITEM(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(int)(fn)((hwnd),(const COMPAREITEMSTRUCT *)(lParam)) 463 #define FORWARD_WM_COMPAREITEM(hwnd,lpCompareItem,fn) (int)(DWORD)(fn)((hwnd),WM_COMPAREITEM,0,(LPARAM)(const COMPAREITEMSTRUCT *)(lpCompareItem)) 464 465 #define HANDLE_WM_VKEYTOITEM(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(int)(fn)((hwnd),(UINT)(wParam),(HWND)LOWORD(lParam),(int)HIWORD(lParam)) 466 #define FORWARD_WM_VKEYTOITEM(hwnd,vk,hwndListBox,iCaret,fn) (int)(DWORD)(fn)((hwnd),WM_VKEYTOITEM,(WPARAM)(UINT)(vk),MAKELPARAM((UINT)(hwndListBox),(UINT)(iCaret))) 467 468 #define HANDLE_WM_CHARTOITEM(hwnd,wParam,lParam,fn) (LRESULT)(DWORD)(int)(fn)((hwnd),(UINT)(wParam),(HWND)LOWORD(lParam),(int)HIWORD(lParam)) 469 #define FORWARD_WM_CHARTOITEM(hwnd,ch,hwndListBox,iCaret,fn) (int)(DWORD)(fn)((hwnd),WM_CHARTOITEM,(WPARAM)(UINT)(ch),MAKELPARAM((UINT)(hwndListBox),(UINT)(iCaret))) 470 471 #define HANDLE_WM_QUEUESYNC(hwnd,wParam,lParam,fn) ((fn)(hwnd),0L) 472 #define FORWARD_WM_QUEUESYNC(hwnd,fn) (void)(fn)((hwnd),WM_QUEUESYNC,0,0L) 473 474 #define HANDLE_WM_COMMNOTIFY(hwnd,wParam,lParam,fn) ((fn)((hwnd),(int)(wParam),LOWORD(lParam)),0L) 475 #define FORWARD_WM_COMMNOTIFY(hwnd,cid,flags,fn) (void)(fn)((hwnd),WM_COMMNOTIFY,(WPARAM)(cid),MAKELPARAM((flags),0)) 476 477 #define Static_Enable(hwndCtl,fEnable) EnableWindow((hwndCtl),(fEnable)) 478 479 #define Static_GetText(hwndCtl,lpch,cchMax) GetWindowText((hwndCtl),(lpch),(cchMax)) 480 #define Static_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl) 481 #define Static_SetText(hwndCtl,lpsz) SetWindowText((hwndCtl),(lpsz)) 482 483 #define Static_SetIcon(hwndCtl,hIcon) ((HICON)(UINT)(DWORD)SendMessage((hwndCtl),STM_SETICON,(WPARAM)(HICON)(hIcon),0L)) 484 #define Static_GetIcon(hwndCtl,hIcon) ((HICON)(UINT)(DWORD)SendMessage((hwndCtl),STM_GETICON,0,0L)) 485 486 #define Button_Enable(hwndCtl,fEnable) EnableWindow((hwndCtl),(fEnable)) 487 488 #define Button_GetText(hwndCtl,lpch,cchMax) GetWindowText((hwndCtl),(lpch),(cchMax)) 489 #define Button_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl) 490 #define Button_SetText(hwndCtl,lpsz) SetWindowText((hwndCtl),(lpsz)) 491 492 #define Button_GetCheck(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),BM_GETCHECK,0,0L)) 493 #define Button_SetCheck(hwndCtl,check) ((void)SendMessage((hwndCtl),BM_SETCHECK,(WPARAM)(int)(check),0L)) 494 495 #define Button_GetState(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),BM_GETSTATE,0,0L)) 496 #define Button_SetState(hwndCtl,state) ((UINT)(DWORD)SendMessage((hwndCtl),BM_SETSTATE,(WPARAM)(int)(state),0L)) 497 498 #define Button_SetStyle(hwndCtl,style,fRedraw) ((void)SendMessage((hwndCtl),BM_SETSTYLE,(WPARAM)LOWORD(style),MAKELPARAM(((fRedraw) ? TRUE : FALSE),0))) 499 500 #define Edit_Enable(hwndCtl,fEnable) EnableWindow((hwndCtl),(fEnable)) 501 502 #define Edit_GetText(hwndCtl,lpch,cchMax) GetWindowText((hwndCtl),(lpch),(cchMax)) 503 #define Edit_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl) 504 #define Edit_SetText(hwndCtl,lpsz) SetWindowText((hwndCtl),(lpsz)) 505 506 #define Edit_LimitText(hwndCtl,cchMax) ((void)SendMessage((hwndCtl),EM_LIMITTEXT,(WPARAM)(cchMax),0L)) 507 508 #define Edit_GetLineCount(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),EM_GETLINECOUNT,0,0L)) 509 #define Edit_GetLine(hwndCtl,line,lpch,cchMax) ((*((int *)(lpch)) = (cchMax)),((int)(DWORD)SendMessage((hwndCtl),EM_GETLINE,(WPARAM)(int)(line),(LPARAM)(LPSTR)(lpch)))) 510 511 #define Edit_GetRect(hwndCtl,lprc) ((void)SendMessage((hwndCtl),EM_GETRECT,0,(LPARAM)(RECT *)(lprc))) 512 #define Edit_SetRect(hwndCtl,lprc) ((void)SendMessage((hwndCtl),EM_SETRECT,0,(LPARAM)(const RECT *)(lprc))) 513 #define Edit_SetRectNoPaint(hwndCtl,lprc) ((void)SendMessage((hwndCtl),EM_SETRECTNP,0,(LPARAM)(const RECT *)(lprc))) 514 515 #define Edit_GetSel(hwndCtl) ((DWORD)SendMessage((hwndCtl),EM_GETSEL,0,0L)) 516 #define Edit_SetSel(hwndCtl,ichStart,ichEnd) ((void)SendMessage((hwndCtl),EM_SETSEL,0,MAKELPARAM((ichStart),(ichEnd)))) 517 #define Edit_ReplaceSel(hwndCtl,lpszReplace) ((void)SendMessage((hwndCtl),EM_REPLACESEL,0,(LPARAM)(LPCSTR)(lpszReplace))) 518 519 #define Edit_GetModify(hwndCtl) ((WINBOOL)(DWORD)SendMessage((hwndCtl),EM_GETMODIFY,0,0L)) 520 #define Edit_SetModify(hwndCtl,fModified) ((void)SendMessage((hwndCtl),EM_SETMODIFY,(WPARAM)(UINT)(fModified),0L)) 521 522 #define Edit_LineFromChar(hwndCtl,ich) ((int)(DWORD)SendMessage((hwndCtl),EM_LINEFROMCHAR,(WPARAM)(int)(ich),0L)) 523 #define Edit_LineIndex(hwndCtl,line) ((int)(DWORD)SendMessage((hwndCtl),EM_LINEINDEX,(WPARAM)(int)(line),0L)) 524 #define Edit_LineLength(hwndCtl,line) ((int)(DWORD)SendMessage((hwndCtl),EM_LINELENGTH,(WPARAM)(int)(line),0L)) 525 526 #define Edit_Scroll(hwndCtl,dv,dh) ((void)SendMessage((hwndCtl),EM_LINESCROLL,0,MAKELPARAM((dv),(dh)))) 527 528 #define Edit_CanUndo(hwndCtl) ((WINBOOL)(DWORD)SendMessage((hwndCtl),EM_CANUNDO,0,0L)) 529 #define Edit_Undo(hwndCtl) ((WINBOOL)(DWORD)SendMessage((hwndCtl),EM_UNDO,0,0L)) 530 #define Edit_EmptyUndoBuffer(hwndCtl) ((void)SendMessage((hwndCtl),EM_EMPTYUNDOBUFFER,0,0L)) 531 532 #define Edit_SetPasswordChar(hwndCtl,ch) ((void)SendMessage((hwndCtl),EM_SETPASSWORDCHAR,(WPARAM)(UINT)(ch),0L)) 533 534 #define Edit_SetTabStops(hwndCtl,cTabs,lpTabs) ((void)SendMessage((hwndCtl),EM_SETTABSTOPS,(WPARAM)(int)(cTabs),(LPARAM)(const int *)(lpTabs))) 535 536 #define Edit_FmtLines(hwndCtl,fAddEOL) ((WINBOOL)(DWORD)SendMessage((hwndCtl),EM_FMTLINES,(WPARAM)(WINBOOL)(fAddEOL),0L)) 537 538 #define Edit_GetHandle(hwndCtl) ((HLOCAL)(UINT)(DWORD)SendMessage((hwndCtl),EM_GETHANDLE,0,0L)) 539 #define Edit_SetHandle(hwndCtl,h) ((void)SendMessage((hwndCtl),EM_SETHANDLE,(WPARAM)(UINT)(HLOCAL)(h),0L)) 540 541 #define Edit_GetFirstVisibleLine(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),EM_GETFIRSTVISIBLELINE,0,0L)) 542 543 #define Edit_SetReadOnly(hwndCtl,fReadOnly) ((WINBOOL)(DWORD)SendMessage((hwndCtl),EM_SETREADONLY,(WPARAM)(WINBOOL)(fReadOnly),0L)) 544 545 #define Edit_GetPasswordChar(hwndCtl) ((char)(DWORD)SendMessage((hwndCtl),EM_GETPASSWORDCHAR,0,0L)) 546 547 #define Edit_SetWordBreakProc(hwndCtl,lpfnWordBreak) ((void)SendMessage((hwndCtl),EM_SETWORDBREAKPROC,0,(LPARAM)(EDITWORDBREAKPROC)(lpfnWordBreak))) 548 #define Edit_GetWordBreakProc(hwndCtl) ((EDITWORDBREAKPROC)SendMessage((hwndCtl),EM_GETWORDBREAKPROC,0,0L)) 549 550 #define ScrollBar_Enable(hwndCtl,flags) EnableScrollBar((hwndCtl),SB_CTL,(flags)) 551 552 #define ScrollBar_Show(hwndCtl,fShow) ShowWindow((hwndCtl),(fShow) ? SW_SHOWNORMAL : SW_HIDE) 553 554 #define ScrollBar_SetPos(hwndCtl,pos,fRedraw) SetScrollPos((hwndCtl),SB_CTL,(pos),(fRedraw)) 555 #define ScrollBar_GetPos(hwndCtl) GetScrollPos((hwndCtl),SB_CTL) 556 557 #define ScrollBar_SetRange(hwndCtl,posMin,posMax,fRedraw) SetScrollRange((hwndCtl),SB_CTL,(posMin),(posMax),(fRedraw)) 558 #define ScrollBar_GetRange(hwndCtl,lpposMin,lpposMax) GetScrollRange((hwndCtl),SB_CTL,(lpposMin),(lpposMax)) 559 560 #define ListBox_Enable(hwndCtl,fEnable) EnableWindow((hwndCtl),(fEnable)) 561 562 #define ListBox_GetCount(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),LB_GETCOUNT,0,0L)) 563 #define ListBox_ResetContent(hwndCtl) ((WINBOOL)(DWORD)SendMessage((hwndCtl),LB_RESETCONTENT,0,0L)) 564 565 #define ListBox_AddString(hwndCtl,lpsz) ((int)(DWORD)SendMessage((hwndCtl),LB_ADDSTRING,0,(LPARAM)(LPCSTR)(lpsz))) 566 #define ListBox_InsertString(hwndCtl,index,lpsz) ((int)(DWORD)SendMessage((hwndCtl),LB_INSERTSTRING,(WPARAM)(int)(index),(LPARAM)(LPCSTR)(lpsz))) 567 568 #define ListBox_AddItemData(hwndCtl,data) ((int)(DWORD)SendMessage((hwndCtl),LB_ADDSTRING,0,(LPARAM)(data))) 569 #define ListBox_InsertItemData(hwndCtl,index,data) ((int)(DWORD)SendMessage((hwndCtl),LB_INSERTSTRING,(WPARAM)(int)(index),(LPARAM)(data))) 570 571 #define ListBox_DeleteString(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),LB_DELETESTRING,(WPARAM)(int)(index),0L)) 572 573 #define ListBox_GetTextLen(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),LB_GETTEXTLEN,(WPARAM)(int)(index),0L)) 574 #define ListBox_GetText(hwndCtl,index,lpszBuffer) ((int)(DWORD)SendMessage((hwndCtl),LB_GETTEXT,(WPARAM)(int)(index),(LPARAM)(LPCSTR)(lpszBuffer))) 575 576 #define ListBox_GetItemData(hwndCtl,index) ((LRESULT)(DWORD)SendMessage((hwndCtl),LB_GETITEMDATA,(WPARAM)(int)(index),0L)) 577 #define ListBox_SetItemData(hwndCtl,index,data) ((int)(DWORD)SendMessage((hwndCtl),LB_SETITEMDATA,(WPARAM)(int)(index),(LPARAM)(data))) 578 579 #define ListBox_FindString(hwndCtl,indexStart,lpszFind) ((int)(DWORD)SendMessage((hwndCtl),LB_FINDSTRING,(WPARAM)(int)(indexStart),(LPARAM)(LPCSTR)(lpszFind))) 580 #define ListBox_FindItemData(hwndCtl,indexStart,data) ((int)(DWORD)SendMessage((hwndCtl),LB_FINDSTRING,(WPARAM)(int)(indexStart),(LPARAM)(data))) 581 582 #define ListBox_SetSel(hwndCtl,fSelect,index) ((int)(DWORD)SendMessage((hwndCtl),LB_SETSEL,(WPARAM)(WINBOOL)(fSelect),MAKELPARAM((index),0))) 583 #define ListBox_SelItemRange(hwndCtl,fSelect,first,last) ((int)(DWORD)SendMessage((hwndCtl),LB_SELITEMRANGE,(WPARAM)(WINBOOL)(fSelect),MAKELPARAM((first),(last)))) 584 585 #define ListBox_GetCurSel(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),LB_GETCURSEL,0,0L)) 586 #define ListBox_SetCurSel(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),LB_SETCURSEL,(WPARAM)(int)(index),0L)) 587 588 #define ListBox_SelectString(hwndCtl,indexStart,lpszFind) ((int)(DWORD)SendMessage((hwndCtl),LB_SELECTSTRING,(WPARAM)(int)(indexStart),(LPARAM)(LPCSTR)(lpszFind))) 589 #define ListBox_SelectItemData(hwndCtl,indexStart,data) ((int)(DWORD)SendMessage((hwndCtl),LB_SELECTSTRING,(WPARAM)(int)(indexStart),(LPARAM)(data))) 590 591 #define ListBox_GetSel(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),LB_GETSEL,(WPARAM)(int)(index),0L)) 592 #define ListBox_GetSelCount(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),LB_GETSELCOUNT,0,0L)) 593 #define ListBox_GetTopIndex(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),LB_GETTOPINDEX,0,0L)) 594 #define ListBox_GetSelItems(hwndCtl,cItems,lpItems) ((int)(DWORD)SendMessage((hwndCtl),LB_GETSELITEMS,(WPARAM)(int)(cItems),(LPARAM)(int *)(lpItems))) 595 596 #define ListBox_SetTopIndex(hwndCtl,indexTop) ((int)(DWORD)SendMessage((hwndCtl),LB_SETTOPINDEX,(WPARAM)(int)(indexTop),0L)) 597 598 #define ListBox_SetColumnWidth(hwndCtl,cxColumn) ((void)SendMessage((hwndCtl),LB_SETCOLUMNWIDTH,(WPARAM)(int)(cxColumn),0L)) 599 #define ListBox_GetHorizontalExtent(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),LB_GETHORIZONTALEXTENT,0,0L)) 600 #define ListBox_SetHorizontalExtent(hwndCtl,cxExtent) ((void)SendMessage((hwndCtl),LB_SETHORIZONTALEXTENT,(WPARAM)(int)(cxExtent),0L)) 601 602 #define ListBox_SetTabStops(hwndCtl,cTabs,lpTabs) ((WINBOOL)(DWORD)SendMessage((hwndCtl),LB_SETTABSTOPS,(WPARAM)(int)(cTabs),(LPARAM)(int *)(lpTabs))) 603 604 #define ListBox_GetItemRect(hwndCtl,index,lprc) ((int)(DWORD)SendMessage((hwndCtl),LB_GETITEMRECT,(WPARAM)(int)(index),(LPARAM)(RECT *)(lprc))) 605 606 #define ListBox_SetCaretIndex(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),LB_SETCARETINDEX,(WPARAM)(int)(index),0L)) 607 #define ListBox_GetCaretIndex(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),LB_GETCARETINDEX,0,0L)) 608 609 #define ListBox_SetAnchorIndex(hwndCtl,index) ((void)SendMessage((hwndCtl),LB_SETANCHORINDEX,(WPARAM)(int)(index),0L)) 610 #define ListBox_GetAnchorIndex(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),LB_GETANCHORINDEX,0,0L)) 611 612 #define ListBox_FindStringExact(hwndCtl,indexStart,lpszFind) ((int)(DWORD)SendMessage((hwndCtl),LB_FINDSTRINGEXACT,(WPARAM)(int)(indexStart),(LPARAM)(LPCSTR)(lpszFind))) 613 614 #define ListBox_SetItemHeight(hwndCtl,index,cy) ((int)(DWORD)SendMessage((hwndCtl),LB_SETITEMHEIGHT,(WPARAM)(int)(index),MAKELPARAM((cy),0))) 615 #define ListBox_GetItemHeight(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),LB_GETITEMHEIGHT,(WPARAM)(int)(index),0L)) 616 617 #define ListBox_Dir(hwndCtl,attrs,lpszFileSpec) ((int)(DWORD)SendMessage((hwndCtl),LB_DIR,(WPARAM)(UINT)(attrs),(LPARAM)(LPCSTR)(lpszFileSpec))) 618 #define ListBox_AddFile(hwndCtl,lpszFilename) ((int)(DWORD)SendMessage((hwndCtl),LB_ADDFILE,0,(LPARAM)(LPCSTR)(lpszFilename))) 619 620 #define ComboBox_Enable(hwndCtl,fEnable) EnableWindow((hwndCtl),(fEnable)) 621 622 #define ComboBox_GetText(hwndCtl,lpch,cchMax) GetWindowText((hwndCtl),(lpch),(cchMax)) 623 #define ComboBox_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl) 624 #define ComboBox_SetText(hwndCtl,lpsz) SetWindowText((hwndCtl),(lpsz)) 625 626 #define ComboBox_LimitText(hwndCtl,cchLimit) ((int)(DWORD)SendMessage((hwndCtl),CB_LIMITTEXT,(WPARAM)(int)(cchLimit),0L)) 627 628 #define ComboBox_GetEditSel(hwndCtl) ((DWORD)SendMessage((hwndCtl),CB_GETEDITSEL,0,0L)) 629 #define ComboBox_SetEditSel(hwndCtl,ichStart,ichEnd) ((int)(DWORD)SendMessage((hwndCtl),CB_SETEDITSEL,0,MAKELPARAM((ichStart),(ichEnd)))) 630 631 #define ComboBox_GetCount(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),CB_GETCOUNT,0,0L)) 632 #define ComboBox_ResetContent(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),CB_RESETCONTENT,0,0L)) 633 634 #define ComboBox_AddString(hwndCtl,lpsz) ((int)(DWORD)SendMessage((hwndCtl),CB_ADDSTRING,0,(LPARAM)(LPCSTR)(lpsz))) 635 #define ComboBox_InsertString(hwndCtl,index,lpsz) ((int)(DWORD)SendMessage((hwndCtl),CB_INSERTSTRING,(WPARAM)(int)(index),(LPARAM)(LPCSTR)(lpsz))) 636 637 #define ComboBox_AddItemData(hwndCtl,data) ((int)(DWORD)SendMessage((hwndCtl),CB_ADDSTRING,0,(LPARAM)(data))) 638 #define ComboBox_InsertItemData(hwndCtl,index,data) ((int)(DWORD)SendMessage((hwndCtl),CB_INSERTSTRING,(WPARAM)(int)(index),(LPARAM)(data))) 639 640 #define ComboBox_DeleteString(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),CB_DELETESTRING,(WPARAM)(int)(index),0L)) 641 642 #define ComboBox_GetLBTextLen(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),CB_GETLBTEXTLEN,(WPARAM)(int)(index),0L)) 643 #define ComboBox_GetLBText(hwndCtl,index,lpszBuffer) ((int)(DWORD)SendMessage((hwndCtl),CB_GETLBTEXT,(WPARAM)(int)(index),(LPARAM)(LPCSTR)(lpszBuffer))) 644 645 #define ComboBox_GetItemData(hwndCtl,index) ((LRESULT)(DWORD)SendMessage((hwndCtl),CB_GETITEMDATA,(WPARAM)(int)(index),0L)) 646 #define ComboBox_SetItemData(hwndCtl,index,data) ((int)(DWORD)SendMessage((hwndCtl),CB_SETITEMDATA,(WPARAM)(int)(index),(LPARAM)(data))) 647 648 #define ComboBox_FindString(hwndCtl,indexStart,lpszFind) ((int)(DWORD)SendMessage((hwndCtl),CB_FINDSTRING,(WPARAM)(int)(indexStart),(LPARAM)(LPCSTR)(lpszFind))) 649 #define ComboBox_FindItemData(hwndCtl,indexStart,data) ((int)(DWORD)SendMessage((hwndCtl),CB_FINDSTRING,(WPARAM)(int)(indexStart),(LPARAM)(data))) 650 651 #define ComboBox_GetCurSel(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),CB_GETCURSEL,0,0L)) 652 #define ComboBox_SetCurSel(hwndCtl,index) ((int)(DWORD)SendMessage((hwndCtl),CB_SETCURSEL,(WPARAM)(int)(index),0L)) 653 654 #define ComboBox_SelectString(hwndCtl,indexStart,lpszSelect) ((int)(DWORD)SendMessage((hwndCtl),CB_SELECTSTRING,(WPARAM)(int)(indexStart),(LPARAM)(LPCSTR)(lpszSelect))) 655 #define ComboBox_SelectItemData(hwndCtl,indexStart,data) ((int)(DWORD)SendMessage((hwndCtl),CB_SELECTSTRING,(WPARAM)(int)(indexStart),(LPARAM)(data))) 656 657 #define ComboBox_Dir(hwndCtl,attrs,lpszFileSpec) ((int)(DWORD)SendMessage((hwndCtl),CB_DIR,(WPARAM)(UINT)(attrs),(LPARAM)(LPCSTR)(lpszFileSpec))) 658 659 #define ComboBox_ShowDropdown(hwndCtl,fShow) ((WINBOOL)(DWORD)SendMessage((hwndCtl),CB_SHOWDROPDOWN,(WPARAM)(WINBOOL)(fShow),0L)) 660 661 #define ComboBox_FindStringExact(hwndCtl,indexStart,lpszFind) ((int)(DWORD)SendMessage((hwndCtl),CB_FINDSTRINGEXACT,(WPARAM)(int)(indexStart),(LPARAM)(LPCSTR)(lpszFind))) 662 663 #define ComboBox_GetDroppedState(hwndCtl) ((WINBOOL)(DWORD)SendMessage((hwndCtl),CB_GETDROPPEDSTATE,0,0L)) 664 #define ComboBox_GetDroppedControlRect(hwndCtl,lprc) ((void)SendMessage((hwndCtl),CB_GETDROPPEDCONTROLRECT,0,(LPARAM)(RECT *)(lprc))) 665 666 #define ComboBox_GetItemHeight(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),CB_GETITEMHEIGHT,0,0L)) 667 #define ComboBox_SetItemHeight(hwndCtl,cyItem) ((int)(DWORD)SendMessage((hwndCtl),CB_SETITEMHEIGHT,(WPARAM)(int)(index),0L)) 668 669 #define ComboBox_GetExtendedUI(hwndCtl) ((UINT)(DWORD)SendMessage((hwndCtl),CB_GETEXTENDEDUI,0,0L)) 670 #define ComboBox_SetExtendedUI(hwndCtl,flags) ((int)(DWORD)SendMessage((hwndCtl),CB_SETEXTENDEDUI,(WPARAM)(UINT)(flags),0L)) 671 672 #define GET_WPARAM(wp,lp) (wp) 673 #define GET_LPARAM(wp,lp) (lp) 674 675 #define GET_WM_ACTIVATE_STATE(wp,lp) (wp) 676 #define GET_WM_ACTIVATE_FMINIMIZED(wp,lp) (WINBOOL)HIWORD(lp) 677 #define GET_WM_ACTIVATE_HWND(wp,lp) (HWND)LOWORD(lp) 678 #define GET_WM_ACTIVATE_MPS(s,fmin,hwnd) (WPARAM)(s),MAKELONG(hwnd,fmin) 679 680 #define GET_WM_CHARTOITEM_CHAR(wp,lp) (CHAR)(wp) 681 #define GET_WM_CHARTOITEM_POS(wp,lp) HIWORD(lp) 682 #define GET_WM_CHARTOITEM_HWND(wp,lp) (HWND)LOWORD(lp) 683 #define GET_WM_CHARTOITEM_MPS(ch,pos,hwnd) (WPARAM)(ch),MAKELONG(hwnd,pos) 684 685 #define GET_WM_COMMAND_ID(wp,lp) (wp) 686 #define GET_WM_COMMAND_HWND(wp,lp) (HWND)LOWORD(lp) 687 #define GET_WM_COMMAND_CMD(wp,lp) HIWORD(lp) 688 #define GET_WM_COMMAND_MPS(id,hwnd,cmd) (WPARAM)(id),MAKELONG(hwnd,cmd) 689 690 #define WM_CTLCOLORMSGBOX 0x0132 691 #define WM_CTLCOLOREDIT 0x0133 692 #define WM_CTLCOLORLISTBOX 0x0134 693 #define WM_CTLCOLORBTN 0x0135 694 #define WM_CTLCOLORDLG 0x0136 695 #define WM_CTLCOLORSCROLLBAR 0x0137 696 #define WM_CTLCOLORSTATIC 0x0138 697 698 #define GET_WM_CTLCOLOR_HDC(wp,lp,msg) (HDC)(wp) 699 #define GET_WM_CTLCOLOR_HWND(wp,lp,msg) (HWND)LOWORD(lp) 700 #define GET_WM_CTLCOLOR_TYPE(wp,lp,msg) HIWORD(lp) 701 #define GET_WM_CTLCOLOR_MPS(hdc,hwnd,type) (WPARAM)(hdc),MAKELONG(hwnd,type) 702 703 #define GET_WM_MENUSELECT_CMD(wp,lp) (wp) 704 #define GET_WM_MENUSELECT_FLAGS(wp,lp) LOWORD(lp) 705 #define GET_WM_MENUSELECT_HMENU(wp,lp) (HMENU)HIWORD(lp) 706 #define GET_WM_MENUSELECT_MPS(cmd,f,hmenu) (WPARAM)(cmd),MAKELONG(f,hmenu) 707 708 #define GET_WM_MDIACTIVATE_FACTIVATE(hwnd,wp,lp) (WINBOOL)(wp) 709 #define GET_WM_MDIACTIVATE_HWNDDEACT(wp,lp) (HWND)HIWORD(lp) 710 #define GET_WM_MDIACTIVATE_HWNDACTIVATE(wp,lp) (HWND)LOWORD(lp) 711 712 #define GET_WM_MDIACTIVATE_MPS(f,hwndD,hwndA) (WPARAM)(hwndA),0 713 714 #define GET_WM_MDISETMENU_MPS(hmenuF,hmenuW) 0,MAKELONG(hmenuF,hmenuW) 715 716 #define GET_WM_MENUCHAR_CHAR(wp,lp) (CHAR)(wp) 717 #define GET_WM_MENUCHAR_HMENU(wp,lp) (HMENU)LOWORD(lp) 718 #define GET_WM_MENUCHAR_FMENU(wp,lp) (WINBOOL)HIWORD(lp) 719 #define GET_WM_MENUCHAR_MPS(ch,hmenu,f) (WPARAM)(ch),MAKELONG(hmenu,f) 720 721 #define GET_WM_PARENTNOTIFY_MSG(wp,lp) (wp) 722 #define GET_WM_PARENTNOTIFY_ID(wp,lp) HIWORD(lp) 723 #define GET_WM_PARENTNOTIFY_HWNDCHILD(wp,lp) (HWND)LOWORD(lp) 724 #define GET_WM_PARENTNOTIFY_X(wp,lp) (INT)LOWORD(lp) 725 #define GET_WM_PARENTNOTIFY_Y(wp,lp) (INT)HIWORD(lp) 726 #define GET_WM_PARENTNOTIFY_MPS(msg,id,hwnd) (WPARAM)(msg),MAKELONG(hwnd,id) 727 #define GET_WM_PARENTNOTIFY2_MPS(msg,x,y) (WPARAM)(msg),MAKELONG(x,y) 728 729 #define GET_WM_VKEYTOITEM_CODE(wp,lp) (wp) 730 #define GET_WM_VKEYTOITEM_ITEM(wp,lp) (INT)HIWORD(lp) 731 #define GET_WM_VKEYTOITEM_HWND(wp,lp) (HWND)LOWORD(lp) 732 #define GET_WM_VKEYTOITEM_MPS(code,item,hwnd) (WPARAM)(code),MAKELONG(hwnd,item) 733 734 #define GET_EM_SETSEL_START(wp,lp) LOWORD(lp) 735 #define GET_EM_SETSEL_END(wp,lp) HIWORD(lp) 736 #define GET_EM_SETSEL_MPS(iStart,iEnd) 0,MAKELONG(iStart,iEnd) 737 738 #define GET_EM_LINESCROLL_MPS(vert,horz) 0,MAKELONG(vert,horz) 739 740 #define GET_WM_CHANGECBCHAIN_HWNDNEXT(wp,lp) (HWND)LOWORD(lp) 741 742 #define GET_WM_HSCROLL_CODE(wp,lp) (wp) 743 #define GET_WM_HSCROLL_POS(wp,lp) LOWORD(lp) 744 #define GET_WM_HSCROLL_HWND(wp,lp) (HWND)HIWORD(lp) 745 #define GET_WM_HSCROLL_MPS(code,pos,hwnd) (WPARAM)(code),MAKELONG(pos,hwnd) 746 747 #define GET_WM_VSCROLL_CODE(wp,lp) (wp) 748 #define GET_WM_VSCROLL_POS(wp,lp) LOWORD(lp) 749 #define GET_WM_VSCROLL_HWND(wp,lp) (HWND)HIWORD(lp) 750 #define GET_WM_VSCROLL_MPS(code,pos,hwnd) (WPARAM)(code),MAKELONG(pos,hwnd) 751 752 #include "poppack.h" 753 754 #ifdef __cplusplus 755 } 756 #endif 757 #endif 758