#ifndef	_WINDOWSX
#define	_WINDOWSX
#define	DECLARE_HANDLE32	DECLARE_HANDLE
#define	GetWindowFont(h)	FORWARD_WM_GETFONT((h),SendMessage)
#define	IsLButtonDown()	(GetKeyState(VK_LBUTTON)<0)
#define	IsMaximized(hwnd)	IsZoomed(hwnd)
#define	IsMButtonDown()	(GetKeyState(VK_MBUTTON)<0)
#define	IsMinimized(hwnd)	IsIconic(hwnd)
#define	IsRButtonDown()	(GetKeyState(VK_RBUTTON)<0)
#define	IsRestored(hwnd)	((GetWindowStyle(hwnd)	&	(WS_MINIMIZE	|	WS_MAXIMIZE))	==	0L)
#define	MapWindowRect(hwndFrom,hwndTo,lprc)	MapWindowPoints((hwndFrom),(hwndTo),(POINT	*)(lprc),2)
#define	SetWindowFont(hwnd,hfont,fR)	FORWARD_WM_SETFONT((hwnd),(hfont),(fR),SendMessage)
#define	Button_Enable(hC,fEnable)	EnableWindow((hC),(fEnable))
#define	Button_GetCheck(hC)	((int)SendMessage((hC),BM_GETCHECK,0L,0L))
#define	Button_GetState(hC)	((int)SendMessage((hC),BM_GETSTATE,0L,0L))
#define	Button_GetText(hC,lpch,cchMax)	GetWindowText((hC),(lpch),(cchMax))
#define	Button_GetTextLength(hC)	GetWindowTextLength(hC)
#define	Button_SetCheck(hC,check)	((void)SendMessage((hC),BM_SETCHECK,(WPARAM)(int)(check),0L))
#define	Button_SetState(hC,state)	((UINT)(DWORD)SendMessage((hC),BM_SETSTATE,(WPARAM)(int)(state),0L))
#define	Button_SetStyle(hC,style,fR)	((void)SendMessage((hC),BM_SETSTYLE,(WPARAM)LOWORD(style),MAKELPARAM(((fR)?TRUE:FALSE),0)))
#define	Button_SetText(hC,lpsz)	SetWindowText((hC),(lpsz))
#define	ComboBox_AddItemData(hC,data)	((int)SendMessage((hC),CB_ADDSTRING,0L,(LPARAM)(data)))
#define	ComboBox_AddString(h,sz)	((int)SendMessage((h),CB_ADDSTRING,0L,(LPARAM)(sz)))
#define	ComboBox_DeleteString(h,i)	((int)SendMessage((h),CB_DELETESTRING,(WPARAM)(i),0L))
#define	ComboBox_Dir(hC,attrs,lpszFileSpec)	((int)SendMessage((hC),CB_DIR,(WPARAM)(UINT)(attrs),(LPARAM)(LPCTSTR)(lpszFileSpec)))
#define	ComboBox_Enable(hC,fEnable)	EnableWindow((hC),(fEnable))
#define	ComboBox_FindItemData(hC,iS,data)	((int)SendMessage((hC),CB_FINDSTRING,(WPARAM)(int)(iS),(LPARAM)(data)))
#define	ComboBox_FindString(hC,iS,lpszFind)	((int)SendMessage((hC),CB_FINDSTRING,(WPARAM)(int)(iS),(LPARAM)(LPCTSTR)(lpszFind)))
#define	ComboBox_FindStringExact(hC,iS,lpszFind)	((int)SendMessage((hC),CB_FINDSTRINGEXACT,(WPARAM)(int)(iS),(LPARAM)(LPCTSTR)(lpszFind)))
#define	ComboBox_GetCount(hC)	((int)SendMessage((hC),CB_GETCOUNT,0L,0L))
#define	ComboBox_GetCurSel(hC)	((int)SendMessage((hC),CB_GETCURSEL,0L,0L))
#define	ComboBox_GetDroppedControlRect(hC,lprc)	((void)SendMessage((hC),CB_GETDROPPEDCONTROLRECT,0L,(LPARAM)(RECT	*)(lprc)))
#define	ComboBox_GetDroppedState(hC)	((WINBOOL)SendMessage((hC),CB_GETDROPPEDSTATE,0L,0L))
#define	ComboBox_GetEditSel(hC)	((DWORD)SendMessage((hC),CB_GETEDITSEL,0L,0L))
#define	ComboBox_GetExtendedUI(hC)	((UINT)SendMessage((hC),CB_GETEXTENDEDUI,0L,0L))
#define	ComboBox_GetItemData(hC,index)	((LRESULT)SendMessage((hC),CB_GETITEMDATA,(WPARAM)(int)(index),0L))
#define	ComboBox_GetItemHeight(hC)	((int)SendMessage((hC),CB_GETITEMHEIGHT,0L,0L))
#define	ComboBox_GetLBText(hC,index,lpszBuffer)	((int)SendMessage((hC),CB_GETLBTEXT,(WPARAM)(int)(index),(LPARAM)(LPCTSTR)(lpszBuffer)))
#define	ComboBox_GetLBTextLen(hC,index)	((int)SendMessage((hC),CB_GETLBTEXTLEN,(WPARAM)(index),0L))
#define	ComboBox_GetText(hC,lpch,cchMax)	GetWindowText((hC),(lpch),(cchMax))
#define	ComboBox_GetTextLength(hC)	GetWindowTextLength(hC)
#define	ComboBox_InsertItemData(hC,index,data)	((int)SendMessage((hC),CB_INSERTSTRING,(WPARAM)(int)(index),(LPARAM)(data)))
#define	ComboBox_InsertString(hC,index,lpsz)	((int)SendMessage((hC),CB_INSERTSTRING,(WPARAM)(int)(index),(LPARAM)(LPCTSTR)(lpsz)))
#define	ComboBox_LimitText(hC,cchLimit)	((int)SendMessage((hC),CB_LIMITTEXT,(WPARAM)(int)(cchLimit),0L))
#define	ComboBox_ResetContent(hC)	((int)SendMessage((hC),CB_RESETCONTENT,0L,0L))
#define	ComboBox_SelectItemData(hC,iS,data)	((int)SendMessage((hC),CB_SELECTSTRING,(WPARAM)(int)(iS),(LPARAM)(data)))
#define	ComboBox_SelectString(hC,iS,lpszSelect)	((int)SendMessage((hC),CB_SELECTSTRING,(WPARAM)(int)(iS),(LPARAM)(LPCTSTR)(lpszSelect)))
#define	ComboBox_SetCurSel(hC,index)	((int)SendMessage((hC),CB_SETCURSEL,(WPARAM)(int)(index),0L))
#define	ComboBox_SetEditSel(hC,ichStart,ichEnd)	((int)SendMessage((hC),CB_SETEDITSEL,0L,MAKELPARAM((ichStart),(ichEnd))))
#define	ComboBox_SetExtendedUI(hC,flags)	((int)SendMessage((hC),CB_SETEXTENDEDUI,(WPARAM)(UINT)(flags),0L))
#define	ComboBox_SetItemData(hC,index,data)	((int)SendMessage((hC),CB_SETITEMDATA,(WPARAM)(int)(index),(LPARAM)(data)))
#define	ComboBox_SetItemHeight(hC,index,cyItem)	((int)SendMessage((hC),CB_SETITEMHEIGHT,(WPARAM)(int)(index),(LPARAM)(int)cyItem))
#define	ComboBox_SetText(hC,lpsz)	SetWindowText((hC),(lpsz))
#define	ComboBox_ShowDropdown(hC,fShow)	((BOOL)SendMessage((hC),CB_SHOWDROPDOWN,(WPARAM)(BOOL)(fShow),0L))
#define	Edit_CanUndo(hC)	((BOOL)SendMessage((hC),EM_CANUNDO,0L,0L))
#define	Edit_EmptyUndoBuffer(hC)	((void)SendMessage((hC),EM_EMPTYUNDOBUFFER,0L,0L))
#define	Edit_Enable(hC,fEnable)	EnableWindow((hC),(fEnable))
#define	Edit_FmtLines(hC,fAddEOL)	((BOOL)(DWORD)SendMessage((hC),EM_FMTLINES,(WPARAM)(BOOL)(fAddEOL),0L))
#define	Edit_GetFirstVisibleLine(hC)	((int)SendMessage((hC),EM_GETFIRSTVISIBLELINE,0L,0L))
#define	Edit_GetHandle(hC)	((HLOCAL)(UINT)(DWORD)SendMessage((hC),EM_GETHANDLE,0L,0L))
#define	Edit_GetLine(hC,line,lpch,cchMax)	((*((int *)(lpch))=(cchMax)),((int)SendMessage((hC),EM_GETLINE,(WPARAM)(int)(line),(LPARAM)(LPTSTR)(lpch))))
#define	Edit_GetLineCount(hC)	((int)SendMessage((hC),EM_GETLINECOUNT,0L,0L))
#define	Edit_GetModify(h)	((WINBOOL)SendMessage((h),EM_GETMODIFY,0L,0L))
#define	Edit_GetPasswordChar(hC)	((TCHAR)SendMessage((hC),EM_GETPASSWORDCHAR,0L,0L))
#define	Edit_GetRect(hC,lprc)	((void)SendMessage((hC),EM_GETRECT,0L,(LPARAM)(RECT	*)(lprc)))
#define	Edit_GetSel(hC)	((DWORD)SendMessage((hC),EM_GETSEL,0L,0L))
#define	Edit_GetText(hC,lpch,cchMax)	GetWindowText((hC),(lpch),(cchMax))
#define	Edit_GetTextLength(hC)	GetWindowTextLength(hC)
#define	Edit_GetWordBreakProc(hC)	((EDITWORDBREAKPROC)SendMessage((hC),EM_GETWORDBREAKPROC,0L,0L))
#define	Edit_LimitText(hC,cchMax)	((void)SendMessage((hC),EM_LIMITTEXT,(WPARAM)(cchMax),0L))
#define	Edit_LineFromChar(h,i)	((int)SendMessage((h),EM_LINEFROMCHAR,(WPARAM)(i),0L))
#define	Edit_LineIndex(hC,line)	((int)SendMessage((hC),EM_LINEINDEX,(WPARAM)(int)(line),0L))
#define	Edit_LineLength(hC,line)	((int)SendMessage((hC),EM_LINELENGTH,(WPARAM)(int)(line),0L))
#define	Edit_ReplaceSel(hC,szR)	((void)SendMessage((hC),EM_REPLACESEL,0L,(LPARAM)(LPCTSTR)(szR)))
#define	Edit_Scroll(hC,dv,dh)	((void)SendMessage((hC),EM_LINESCROLL,(WPARAM)(dh),(LPARAM)(dv)))
#define	Edit_ScrollCaret(h)	((WINBOOL)SendMessage((h),EM_SCROLLCARET,0,0L))
#define	Edit_SetHandle(hC,h)	((void)SendMessage((hC),EM_SETHANDLE,(WPARAM)(UINT)(HLOCAL)(h),0L))
#define	Edit_SetModify(h,f)	((void)SendMessage((h),EM_SETMODIFY,(WPARAM)(f),0L))
#define	Edit_SetPasswordChar(hC,ch)	((void)SendMessage((hC),EM_SETPASSWORDCHAR,(WPARAM)(UINT)(ch),0L))
#define	Edit_SetReadOnly(hC,fReadOnly)	((WINBOOL)SendMessage((hC),EM_SETREADONLY,(WPARAM)(BOOL)(fReadOnly),0L))
#define	Edit_SetRect(hC,lprc)	((void)SendMessage((hC),EM_SETRECT,0L,(LPARAM)(const	RECT	*)(lprc)))
#define	Edit_SetRectNoPaint(hC,lprc)	((void)SendMessage((hC),EM_SETRECTNP,0L,(LPARAM)(const	RECT	*)(lprc)))
#define	Edit_SetSel(hC,ichStart,ichEnd)	((void)SendMessage((hC),EM_SETSEL,(ichStart),(ichEnd)))
#define	Edit_SetTabStops(hC,cTabs,lpTabs)	((void)SendMessage((hC),EM_SETTABSTOPS,(WPARAM)(int)(cTabs),(LPARAM)(const	int	*)(lpTabs)))
#define	Edit_SetText(hC,lpsz)	SetWindowText((hC),(lpsz))
#define	Edit_SetWordBreakProc(h,WB)	((void)SendMessage((h),EM_SETWORDBREAKPROC,0L,(LPARAM)(WB)))
#define	Edit_Undo(h)	((WINBOOL)(DWORD)SendMessage((h),EM_UNDO,0L,0L))
#define	FORWARD_WM_ACTIVATE(h,s,hA,f,fn)	(void)(fn)((h),WM_ACTIVATE,MAKEWPARAM((s),(f)),(LPARAM)(hA))
#define	FORWARD_WM_ACTIVATEAPP(hwnd,fActivate,dwThreadId,fn)	(void)(fn)((hwnd),WM_ACTIVATEAPP,(WPARAM)(BOOL)(fActivate),(LPARAM)(dwThreadId))
#define	FORWARD_WM_ASKCBFORMATNAME(hwnd,cchMax,rgchName,fn)	(void)(fn)((hwnd),WM_ASKCBFORMATNAME,(WPARAM)(int)(cchMax),(LPARAM)(rgchName))
#define	FORWARD_WM_CANCELMODE(hwnd,fn)	(void)(fn)((hwnd),WM_CANCELMODE,0L,0L)
#define	FORWARD_WM_CHANGECBCHAIN(hwnd,hwndRemove,hwndNext,fn)	(void)(fn)((hwnd),WM_CHANGECBCHAIN,(WPARAM)(HWND)(hwndRemove),(LPARAM)(HWND)(hwndNext))
#define	FORWARD_WM_CHAR(hwnd,ch,cRepeat,fn)	(void)(fn)((hwnd),WM_CHAR,(WPARAM)(TCHAR)(ch),MAKELPARAM((cRepeat),0))
#define	FORWARD_WM_CHARTOITEM(hwnd,ch,hwndListBox,iCaret,fn)	(int)(fn)((hwnd),WM_CHARTOITEM,MAKEWPARAM((UINT)(iCaret),(UINT)(ch)),(LPARAM)(hwndListBox))
#define	FORWARD_WM_CHILDACTIVATE(hwnd,fn)	(void)(fn)((hwnd),WM_CHILDACTIVATE,0L,0L)
#define	FORWARD_WM_CLEAR(hwnd,fn)	(void)(fn)((hwnd),WM_CLEAR,0L,0L)
#define	FORWARD_WM_CLOSE(hwnd,fn)	(void)(fn)((hwnd),WM_CLOSE,0L,0L)
#define	FORWARD_WM_COMMAND(hwnd,id,hC,codeNotify,fn)	(void)(fn)((hwnd),WM_COMMAND,MAKEWPARAM((UINT)(id),(UINT)(codeNotify)),(LPARAM)(HWND)(hC))
#define	FORWARD_WM_COMMNOTIFY(hwnd,cid,flags,fn)	(void)(fn)((hwnd),WM_COMMNOTIFY,(WPARAM)(cid),MAKELPARAM((flags),0))
#define	FORWARD_WM_COMPACTING(h,R,f)	(void)(f)((h),WM_COMPACTING,(WPARAM)(R),0L)
#define	FORWARD_WM_COMPAREITEM(hwnd,lpCompareItem,fn)	(int)(fn)((hwnd),WM_COMPAREITEM,(WPARAM)(((const	COMPAREITEMSTRUCT	*)(lpCompareItem))->CtlID),(LPARAM)(const	COMPAREITEMSTRUCT	*)(lpCompareItem))
#define	FORWARD_WM_COPY(hwnd,fn)	(void)(fn)((hwnd),WM_COPY,0L,0L)
#define	FORWARD_WM_CREATE(hwnd,lpCreateStruct,fn)	(WINBOOL)(fn)((hwnd),WM_CREATE,0L,(LPARAM)(LPCREATESTRUCT)(lpCreateStruct))
#define	FORWARD_WM_CTLCOLORBTN(hwnd,hdc,hwC,fn)	(HBRUSH)(fn)((hwnd),WM_CTLCOLORBTN,(WPARAM)(HDC)(hdc),(LPARAM)(HWND)(hwC))
#define	FORWARD_WM_CTLCOLORDLG(hwnd,hdc,hwC,fn)	(HBRUSH)(UINT)(DWORD)(fn)((hwnd),WM_CTLCOLORDLG,(WPARAM)(HDC)(hdc),(LPARAM)(HWND)(hwC))
#define	FORWARD_WM_CTLCOLOREDIT(hwnd,hdc,hwC,fn)	(HBRUSH)(fn)((hwnd),WM_CTLCOLOREDIT,(WPARAM)(HDC)(hdc),(LPARAM)(HWND)(hwC))
#define	FORWARD_WM_CTLCOLORLISTBOX(hwnd,hdc,hwC,fn)	(HBRUSH)(fn)((hwnd),WM_CTLCOLORLISTBOX,(WPARAM)(HDC)(hdc),(LPARAM)(HWND)(hwC))
#define	FORWARD_WM_CTLCOLORMSGBOX(hwnd,hdc,hwC,fn)	(HBRUSH)(fn)((hwnd),WM_CTLCOLORMSGBOX,(WPARAM)(HDC)(hdc),(LPARAM)(HWND)(hwC))
#define	FORWARD_WM_CTLCOLORSCROLLBAR(hwnd,hdc,hwC,fn)	(HBRUSH)(fn)((hwnd),WM_CTLCOLORSCROLLBAR,(WPARAM)(HDC)(hdc),(LPARAM)(HWND)(hwC))
#define	FORWARD_WM_CTLCOLORSTATIC(hwnd,hdc,hwC,fn)	(HBRUSH)(fn)((hwnd),WM_CTLCOLORSTATIC,(WPARAM)(HDC)(hdc),(LPARAM)(HWND)(hwC))
#define	FORWARD_WM_CUT(hwnd,fn)	(void)(fn)((hwnd),WM_CUT,0L,0L)
#define	FORWARD_WM_DEADCHAR(hwnd,ch,c,fn)	(void)(fn)((hwnd),WM_DEADCHAR,(WPARAM)(TCHAR)(ch),MAKELPARAM((c),0))
#define	FORWARD_WM_DELETEITEM(hwnd,lpDeleteItem,fn)	(void)(fn)((hwnd),WM_DELETEITEM,(WPARAM)(((DELETEITEMSTRUCT *)(lpDeleteItem))->CtlID),(LPARAM)(DELETEITEMSTRUCT	*)(lpDeleteItem))
#define	FORWARD_WM_DESTROY(hwnd,fn)	(void)(fn)((hwnd),WM_DESTROY,0L,0L)
#define	FORWARD_WM_DESTROYCLIPBOARD(hwnd,fn)	(void)(fn)((hwnd),WM_DESTROYCLIPBOARD,0,0)
#define	FORWARD_WM_DEVMODECHANGE(hwnd,lpszDeviceName,fn)	(void)(fn)((hwnd),WM_DEVMODECHANGE,0L,(LPARAM)(LPCTSTR)(lpszDeviceName))
#define	FORWARD_WM_DRAWCLIPBOARD(hwnd,fn)	(void)(fn)((hwnd),WM_DRAWCLIPBOARD,0L,0)
#define	FORWARD_WM_DRAWITEM(hwnd,lpDrawItem,fn)	(void)(fn)((hwnd),WM_DRAWITEM,(WPARAM)(((DRAWITEMSTRUCT	*)lpDrawItem)->CtlID),(LPARAM)(DRAWITEMSTRUCT *)(lpDrawItem))
#define	FORWARD_WM_DROPFILES(hwnd,hdrop,fn)	(void)(fn)((hwnd),WM_DROPFILES,(WPARAM)(HDROP)(hdrop),0L)
#define	FORWARD_WM_ENABLE(hwnd,fEnable,fn)	(void)(fn)((hwnd),WM_ENABLE,(WPARAM)(BOOL)(fEnable),0L)
#define	FORWARD_WM_ENDSESSION(hwnd,f,fn)	(void)(fn)((hwnd),WM_ENDSESSION,(WPARAM)(f),0L)
#define	FORWARD_WM_ENTERIDLE(hwnd,sou,S,fn)	(void)(fn)((hwnd),WM_ENTERIDLE,(WPARAM)(sou),(LPARAM)(S))
#define	FORWARD_WM_ERASEBKGND(hwnd,hdc,fn)	(BOOL)(fn)((hwnd),WM_ERASEBKGND,(WPARAM)(HDC)(hdc),0L)
#define	FORWARD_WM_FONTCHANGE(hwnd,fn)	(void)(fn)((hwnd),WM_FONTCHANGE,0L,0)
#define	FORWARD_WM_GETDLGCODE(hwnd,m,fn)	(UINT)(fn)((hwnd),WM_GETDLGCODE,(m?m->wParam:0),(LPARAM)(m))
#define	FORWARD_WM_GETFONT(hwnd,fn)	(HFONT)(fn)((hwnd),WM_GETFONT,0L,0L)
#define	FORWARD_WM_GETMINMAXINFO(hwnd,lpMinMaxInfo,fn)	(void)(fn)((hwnd),WM_GETMINMAXINFO,0L,(LPARAM)(LPMINMAXINFO)(lpMinMaxInfo))
#define	FORWARD_WM_GETTEXT(hwnd,cchTextMax,lpszText,fn)	(int)(fn)((hwnd),WM_GETTEXT,(WPARAM)(int)(cchTextMax),(LPARAM)(LPTSTR)(lpszText))
#define	FORWARD_WM_GETTEXTLENGTH(hwnd,fn)	(int)(fn)((hwnd),WM_GETTEXTLENGTH,0L,0)
#define	FORWARD_WM_HSCROLL(hwnd,hC,code,pos,fn)	(void)(fn)((hwnd),WM_HSCROLL,MAKEWPARAM((UINT)(int)(code),(UINT)(int)(pos)),(LPARAM)(UINT)(hC))
#define	FORWARD_WM_HSCROLLCLIPBOARD(hwnd,hwndCBViewer,code,pos,fn)	(void)(fn)((hwnd),WM_HSCROLLCLIPBOARD,(WPARAM)(HWND)(hwndCBViewer),MAKELPARAM((code),(pos)))
#define	FORWARD_WM_ICONERASEBKGND(hwnd,hdc,fn)	(BOOL)(DWORD)(fn)((hwnd),WM_ICONERASEBKGND,(WPARAM)(HDC)(hdc),0L)
#define	FORWARD_WM_INITDIALOG(hwnd,hwndFocus,lParam,fn)	(BOOL)(DWORD)(fn)((hwnd),WM_INITDIALOG,(WPARAM)(HWND)(hwndFocus),(lParam))
#define	FORWARD_WM_INITMENU(hwnd,hMenu,fn)	(void)(fn)((hwnd),WM_INITMENU,(WPARAM)(HMENU)(hMenu),0L)
#define	FORWARD_WM_INITMENUPOPUP(hwnd,hMenu,item,fSystemMenu,fn)	(void)(fn)((hwnd),WM_INITMENUPOPUP,(WPARAM)(HMENU)(hMenu),MAKELPARAM((item),(fSystemMenu)))
#define	FORWARD_WM_KEYDOWN(hwnd,vk,cRepeat,flags,fn)	(void)(fn)((hwnd),WM_KEYDOWN,(WPARAM)(UINT)(vk),MAKELPARAM((cRepeat),(flags)))
#define	FORWARD_WM_KEYUP(hwnd,vk,cRepeat,flags,fn)	(void)(fn)((hwnd),WM_KEYUP,(WPARAM)(UINT)(vk),MAKELPARAM((cRepeat),(flags)))
#define	FORWARD_WM_KILLFOCUS(hwnd,hwndNewFocus,fn)	(void)(fn)((hwnd),WM_KILLFOCUS,(WPARAM)(HWND)(hwndNewFocus),0L)
#define	FORWARD_WM_LBUTTONDOWN(hwnd,fDoubleClick,x,y,keyFlags,fn)	(void)(fn)((hwnd),(fDoubleClick)?WM_LBUTTONDBLCLK:WM_LBUTTONDOWN,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y)))
#define	FORWARD_WM_LBUTTONUP(hwnd,x,y,keyFlags,fn)	(void)(fn)((hwnd),WM_LBUTTONUP,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y)))
#define	FORWARD_WM_MBUTTONDOWN(hwnd,fDoubleClick,x,y,keyFlags,fn)	(void)(fn)((hwnd),(fDoubleClick)?WM_MBUTTONDBLCLK:WM_MBUTTONDOWN,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y)))
#define	FORWARD_WM_MBUTTONUP(hwnd,x,y,keyFlags,fn)	(void)(fn)((hwnd),WM_MBUTTONUP,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y)))
#define	FORWARD_WM_MDIACTIVATE(hwnd,f,hwndActivate,hwndDeactivate,fn)	(void)(fn)(hwnd,WM_MDIACTIVATE,(WPARAM)(hwndDeactivate),(LPARAM)(hwndActivate))
#define	FORWARD_WM_MDICASCADE(hwnd,cmd,fn)	(BOOL)(DWORD)(fn)((hwnd),WM_MDICASCADE,(WPARAM)(cmd),0L)
#define	FORWARD_WM_MDICREATE(hwnd,lpmcs,fn)	(HWND)(fn)((hwnd),WM_MDICREATE,0L,(LPARAM)(LPMDICREATESTRUCT)(lpmcs))
#define	FORWARD_WM_MDIDESTROY(hwnd,hwndDestroy,fn)	(void)(fn)((hwnd),WM_MDIDESTROY,(WPARAM)(hwndDestroy),0L)
#define	FORWARD_WM_MDIGETACTIVE(hwnd,fn)	(HWND)(UINT)(DWORD)(fn)((hwnd),WM_MDIGETACTIVE,0L,0L)
#define	FORWARD_WM_MDIICONARRANGE(hwnd,fn)	(void)(fn)((hwnd),WM_MDIICONARRANGE,0L,0)
#define	FORWARD_WM_MDIMAXIMIZE(hwnd,hwndMaximize,fn)	(void)(fn)((hwnd),WM_MDIMAXIMIZE,(WPARAM)(hwndMaximize),0L)
#define	FORWARD_WM_MDINEXT(hwnd,hwndCur,fPrev,fn)	(HWND)(UINT)(DWORD)(fn)((hwnd),WM_MDINEXT,(WPARAM)(hwndCur),(LPARAM)(fPrev))
#define	FORWARD_WM_MDIRESTORE(hwnd,hwndRestore,fn)	(void)(fn)((hwnd),WM_MDIRESTORE,(WPARAM)(hwndRestore),0L)
#define	FORWARD_WM_MDISETMENU(hwnd,f,hmF,hmW,fn)	(HMENU)(fn)((hwnd),WM_MDISETMENU,(WPARAM)((f)?(hmF):0),(LPARAM)(hmW))
#define	FORWARD_WM_MDITILE(hwnd,cmd,fn)	(WINBOOL)(fn)((hwnd),WM_MDITILE,(WPARAM)(cmd),0)
#define	FORWARD_WM_MEASUREITEM(hwnd,l,fn)	(void)(fn)((hwnd),WM_MEASUREITEM,(WPARAM)(((MEASUREITEMSTRUCT *)lpMeasureItem)->CtlID),(LPARAM)(MEASUREITEMSTRUCT*)(l))
#define	FORWARD_WM_MENUCHAR(hwnd,ch,flags,hmenu,fn)	(DWORD)(fn)((hwnd),WM_MENUCHAR,MAKEWPARAM(flags,(WORD)(ch)),(LPARAM)(HMENU)(hmenu))
#define	FORWARD_WM_MENUSELECT(hwnd,hmenu,item,hmenuPopup,flags,fn)	(void)(fn)((hwnd),WM_MENUSELECT,MAKEWPARAM((item),(flags)),(LPARAM)(HMENU)((hmenu)?(hmenu):(hmenuPopup)))
#define	FORWARD_WM_MOUSEACTIVATE(hwnd,hTop,c,msg,fn)	(int)(fn)((hwnd),WM_MOUSEACTIVATE,(WPARAM)(hTop),MAKELPARAM((c),(msg)))
#define	FORWARD_WM_MOUSEMOVE(hwnd,x,y,keyFlags,fn)	(void)(fn)((hwnd),WM_MOUSEMOVE,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y)))
#define	FORWARD_WM_MOVE(hwnd,x,y,fn)	(void)(fn)((hwnd),WM_MOVE,0L,MAKELPARAM((x),(y)))
#define	FORWARD_WM_NCACTIVATE(hwnd,f,h,fMinimized,fn)	(BOOL)(fn)((hwnd),WM_NCACTIVATE,(WPARAM)(f),0L)
#define	FORWARD_WM_NCCALCSIZE(hwnd,f,lpcsp,fn)	(UINT)(DWORD)(fn)((hwnd),WM_NCCALCSIZE,0L,(LPARAM)(NCCALCSIZE_PARAMS *)(lpcsp))
#define	FORWARD_WM_NCCREATE(hwnd,lpCreateStruct,fn)	(WINBOOL)(fn)((hwnd),WM_NCCREATE,0L,(LPARAM)(LPCREATESTRUCT)(lpCreateStruct))
#define	FORWARD_WM_NCDESTROY(hwnd,fn)	(void)(fn)((hwnd),WM_NCDESTROY,0L,0L)
#define	FORWARD_WM_NCHITTEST(hwnd,x,y,fn)	(UINT)(fn)((hwnd),WM_NCHITTEST,0L,MAKELPARAM((x),(y)))
#define	FORWARD_WM_NCLBUTTONDOWN(hwnd,fDoubleClick,x,y,codeHitTest,fn)	(void)(fn)((hwnd),(fDoubleClick)?WM_NCLBUTTONDBLCLK:WM_NCLBUTTONDOWN,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y)))
#define	FORWARD_WM_NCLBUTTONUP(hwnd,x,y,codeHitTest,fn)	(void)(fn)((hwnd),WM_NCLBUTTONUP,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y)))
#define	FORWARD_WM_NCMBUTTONDOWN(hwnd,fDoubleClick,x,y,codeHitTest,fn)	(void)(fn)((hwnd),(fDoubleClick)?WM_NCMBUTTONDBLCLK:WM_NCMBUTTONDOWN,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y)))
#define	FORWARD_WM_NCMBUTTONUP(hwnd,x,y,codeHitTest,fn)	(void)(fn)((hwnd),WM_NCMBUTTONUP,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y)))
#define	FORWARD_WM_NCMOUSEMOVE(hwnd,x,y,codeHitTest,fn)	(void)(fn)((hwnd),WM_NCMOUSEMOVE,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y)))
#define	FORWARD_WM_NCPAINT(hwnd,hrgn,fn)	(void)(fn)((hwnd),WM_NCPAINT,(WPARAM)(HRGN)(hrgn),0L)
#define	FORWARD_WM_NCRBUTTONDOWN(hwnd,fDoubleClick,x,y,codeHitTest,fn)	(void)(fn)((hwnd),(fDoubleClick)?WM_NCRBUTTONDBLCLK:WM_NCRBUTTONDOWN,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y)))
#define	FORWARD_WM_NCRBUTTONUP(hwnd,x,y,codeHitTest,fn)	(void)(fn)((hwnd),WM_NCRBUTTONUP,(WPARAM)(UINT)(codeHitTest),MAKELPARAM((x),(y))	)
#define	FORWARD_WM_NEXTDLGCTL(hwnd,hwndSetFocus,fNext,fn)	(HWND)(UINT)(DWORD)(fn)((hwnd),WM_NEXTDLGCTL,(WPARAM)(HWND)(hwndSetFocus),(LPARAM)(fNext))
#define	FORWARD_WM_PAINT(hwnd,fn)	(void)(fn)((hwnd),WM_PAINT,0L,0L)
#define	FORWARD_WM_PAINTCLIPBOARD(hwnd,hwndCBViewer,lpPaintStruct,fn)	(void)(fn)((hwnd),WM_PAINTCLIPBOARD,(WPARAM)(HWND)(hwndCBViewer),(LPARAM)(LPPAINTSTRUCT)(lpPaintStruct))
#define	FORWARD_WM_PALETTECHANGED(hwnd,hwndPaletteChange,fn)	(void)(fn)((hwnd),WM_PALETTECHANGED,(WPARAM)(HWND)(hwndPaletteChange),0L)
#define	FORWARD_WM_PALETTEISCHANGING(h,hwndP,f)	(void)(f)((h),WM_PALETTEISCHANGING,(WPARAM)(hwndP),0L)
#define	FORWARD_WM_PARENTNOTIFY(hwnd,msg,hwC,idChild,fn)	(void)(fn)((hwnd),WM_PARENTNOTIFY,MAKEWPARAM(msg,idChild),(LPARAM)(hwC))
#define	FORWARD_WM_PASTE(hwnd,fn)	(void)(fn)((hwnd),WM_PASTE,0L,0L)
#define	FORWARD_WM_POWER(hwnd,code,fn)	(void)(fn)((hwnd),WM_POWER,(WPARAM)(int)(code),0L)
#define	FORWARD_WM_QUERYDRAGICON(hwnd,fn)	(HICON)(fn)((hwnd),WM_QUERYDRAGICON,0L,0L)
#define	FORWARD_WM_QUERYENDSESSION(hwnd,fn)	(WINBOOL)(fn)((hwnd),WM_QUERYENDSESSION,0L,0L)
#define	FORWARD_WM_QUERYNEWPALETTE(h,f)	(WINBOOL)(f)((h),WM_QUERYNEWPALETTE,0L,0L)
#define	FORWARD_WM_QUERYOPEN(hwnd,fn)	(BOOL)(fn)((hwnd),WM_QUERYOPEN,0L,0L)
#define	FORWARD_WM_QUEUESYNC(hwnd,fn)	(void)(fn)((hwnd),WM_QUEUESYNC,0L,0L)
#define	FORWARD_WM_QUIT(hwnd,exitCode,fn)	(void)(fn)((hwnd),WM_QUIT,(WPARAM)(exitCode),0L)
#define	FORWARD_WM_RBUTTONDOWN(hwnd,fDoubleClick,x,y,keyFlags,fn)	(void)(fn)((hwnd),(fDoubleClick)	?	WM_RBUTTONDBLCLK	:	WM_RBUTTONDOWN,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y)))
#define	FORWARD_WM_RBUTTONUP(hwnd,x,y,keyFlags,fn)	(void)(fn)((hwnd),WM_RBUTTONUP,(WPARAM)(UINT)(keyFlags),MAKELPARAM((x),(y)))
#define	FORWARD_WM_RENDERALLFORMATS(hwnd,fn)	(void)(fn)((hwnd),WM_RENDERALLFORMATS,0L,0L)
#define	FORWARD_WM_RENDERFORMAT(hwnd,fmt,fn)	(HANDLE)(fn)((hwnd),WM_RENDERFORMAT,(WPARAM)(UINT)(fmt),0L)
#define	FORWARD_WM_SETCURSOR(hwnd,Cursor,HT,m,fn)	(BOOL)(fn)((hwnd),WM_SETCURSOR,(WPARAM)(Cursor),MAKELPARAM((HT),(m)))
#define	FORWARD_WM_SETFOCUS(hwnd,hwndOldFocus,fn)	(void)(fn)((hwnd),WM_SETFOCUS,(WPARAM)(HWND)(hwndOldFocus),0L)
#define	FORWARD_WM_SETFONT(hwnd,hfont,fR,fn)	(void)(fn)((hwnd),WM_SETFONT,(WPARAM)(HFONT)(hfont),(LPARAM)(BOOL)(fR))
#define	FORWARD_WM_SETREDRAW(hwnd,fR,fn)	(void)(fn)((hwnd),WM_SETREDRAW,(WPARAM)(BOOL)(fR),0L)
#define	FORWARD_WM_SETTEXT(hwnd,lpszText,fn)	(void)(fn)((hwnd),WM_SETTEXT,0L,(LPARAM)(LPCTSTR)(lpszText))
#define	FORWARD_WM_SHOWWINDOW(hwnd,fShow,status,fn)	(void)(fn)((hwnd),WM_SHOWWINDOW,(WPARAM)(BOOL)(fShow),(LPARAM)(UINT)(status))
#define	FORWARD_WM_SIZE(hwnd,state,cx,cy,fn)	(void)(fn)((hwnd),WM_SIZE,(WPARAM)(UINT)(state),MAKELPARAM((cx),(cy)))
#define	FORWARD_WM_SIZECLIPBOARD(hwnd,hwndCBViewer,lprc,fn)	(void)(fn)((hwnd),WM_SIZECLIPBOARD,(WPARAM)(HWND)(hwndCBViewer),(LPARAM)(LPRECT)(lprc))
#define	FORWARD_WM_SPOOLERSTATUS(hwnd,status,cJobInQueue,fn)	(void)(fn)((hwnd),WM_SPOOLERSTATUS,(WPARAM)(status),MAKELPARAM((cJobInQueue),0))
#define	FORWARD_WM_SYSCHAR(hwnd,ch,cRepeat,fn)	(void)(fn)((hwnd),WM_SYSCHAR,(WPARAM)(TCHAR)(ch),MAKELPARAM((cRepeat),0))
#define	FORWARD_WM_SYSCOLORCHANGE(h,fn)	(void)(fn)((h),WM_SYSCOLORCHANGE,0L,0L)
#define	FORWARD_WM_SYSCOMMAND(hwnd,cmd,x,y,fn)	(void)(fn)((hwnd),WM_SYSCOMMAND,(WPARAM)(UINT)(cmd),MAKELPARAM((x),(y)))
#define	FORWARD_WM_SYSDEADCHAR(hwnd,ch,cRepeat,fn)	(void)(fn)((hwnd),WM_SYSDEADCHAR,(WPARAM)(TCHAR)(ch),MAKELPARAM((cRepeat),0))
#define	FORWARD_WM_SYSKEYDOWN(hwnd,vk,cRepeat,flags,fn)	(void)(fn)((hwnd),WM_SYSKEYDOWN,(WPARAM)(UINT)(vk),MAKELPARAM((cRepeat),(flags)))
#define	FORWARD_WM_SYSKEYUP(hwnd,vk,cRepeat,flags,fn)	(void)(fn)((hwnd),WM_SYSKEYUP,(WPARAM)(UINT)(vk),MAKELPARAM((cRepeat),(flags)))
#define	FORWARD_WM_TIMECHANGE(hwnd,fn)	(void)(fn)((hwnd),WM_TIMECHANGE,0L,0L)
#define	FORWARD_WM_TIMER(hwnd,id,fn)	(void)(fn)((hwnd),WM_TIMER,(WPARAM)(UINT)(id),0L)
#define	FORWARD_WM_UNDO(hwnd,fn)	(void)(fn)((hwnd),WM_UNDO,0L,0L)
#define	FORWARD_WM_VKEYTOITEM(hwnd,vk,hwndListBox,iCaret,fn)	(int)(fn)((hwnd),WM_VKEYTOITEM,MAKEWPARAM((vk),(iCaret)),(LPARAM)(hwndListBox))
#define	FORWARD_WM_VSCROLL(hwnd,hC,code,pos,fn)	(void)(fn)((hwnd),WM_VSCROLL,MAKEWPARAM((UINT)(int)(code),(UINT)(int)(pos)),(LPARAM)(HWND)(hC))
#define	FORWARD_WM_VSCROLLCLIPBOARD(hwnd,hwndCBViewer,code,pos,fn)	(void)(fn)((hwnd),WM_VSCROLLCLIPBOARD,(WPARAM)(HWND)(hwndCBViewer),MAKELPARAM((code),(pos)))
#define	FORWARD_WM_WINDOWPOSCHANGED(hwnd,lpwpos,fn)	(void)(fn)((hwnd),WM_WINDOWPOSCHANGED,0L,(LPARAM)(const	LPWINDOWPOS)(lpwpos))
#define	FORWARD_WM_WINDOWPOSCHANGING(hwnd,lpwpos,fn)	(BOOL)(DWORD)(fn)((hwnd),WM_WINDOWPOSCHANGING,0L,(LPARAM)(LPWINDOWPOS)(lpwpos))
#define	FORWARD_WM_WININICHANGE(h,Sec,f)	(void)(f)((h),WM_WININICHANGE,0L,(LPARAM)(Sec))
#define	GET_EM_LINESCROLL_MPS(vert,horz)	(WPARAM)horz,(LONG)vert
#define	GET_EM_SETSEL_END(wp,lp)	(lp)
#define	GET_EM_SETSEL_MPS(iStart,iEnd)	(WPARAM)(iStart),(LONG)(iEnd)
#define	GET_EM_SETSEL_START(wp,lp)	(INT)(wp)
#define	GET_LPARAM(w,l)	(l)
#define	GET_WM_ACTIVATE_FMINIMIZED(wp,lp)	(BOOL)HIWORD(wp)
#define	GET_WM_ACTIVATE_HWND(wp,lp)	(HWND)(lp)
#define	GET_WM_ACTIVATE_MPS(s,fmin,hwnd)	(WPARAM)MAKELONG((s),(fmin)),(LONG)(hwnd)
#define	GET_WM_ACTIVATE_STATE(w,l)	LOWORD(w)
#define	GET_WM_CHANGECBCHAIN_HWNDNEXT(wp,lp)	(HWND)(lp)
#define	GET_WM_CHARTOITEM_CHAR(wp,lp)	(TCHAR)LOWORD(wp)
#define	GET_WM_CHARTOITEM_HWND(wp,lp)	(HWND)(lp)
#define	GET_WM_CHARTOITEM_MPS(ch,pos,hwnd)	(WPARAM)MAKELONG((pos),(ch)),(LONG)(hwnd)
#define	GET_WM_CHARTOITEM_POS(wp,lp)	HIWORD(wp)
#define	GET_WM_COMMAND_CMD(wp,lp)	HIWORD(wp)
#define	GET_WM_COMMAND_HWND(wp,lp)	(HWND)(lp)
#define	GET_WM_COMMAND_ID(wp,lp)	LOWORD(wp)
#define	GET_WM_COMMAND_MPS(id,hwnd,cmd)	(WPARAM)MAKELONG(id,cmd),(LONG)(hwnd)
#define	GET_WM_CTLCOLOR_HDC(wp,lp,msg)	(HDC)(wp)
#define	GET_WM_CTLCOLOR_HWND(wp,lp,msg)	(HWND)(lp)
#define	GET_WM_CTLCOLOR_MPS(hdc,hwnd,type)	(WPARAM)(hdc),(LONG)(hwnd)
#define	GET_WM_CTLCOLOR_MSG(type)	(WORD)(WM_CTLCOLORMSGBOX+(type))
#define	GET_WM_CTLCOLOR_TYPE(wp,lp,msg)	(WORD)(msg-WM_CTLCOLORMSGBOX)
#define	GET_WM_HSCROLL_CODE(wp,lp)	LOWORD(wp)
#define	GET_WM_HSCROLL_HWND(wp,lp)	(HWND)(lp)
#define	GET_WM_HSCROLL_MPS(code,pos,hwnd)	(WPARAM)MAKELONG(code,pos),(LONG)(hwnd)
#define	GET_WM_HSCROLL_POS(wp,lp)	HIWORD(wp)
#define	GET_WM_MDIACTIVATE_FACTIVATE(hwnd,wp,lp)	(lp==(LONG)hwnd)
#define	GET_WM_MDIACTIVATE_HWNDACTIVATE(wp,lp)	(HWND)(lp)
#define	GET_WM_MDIACTIVATE_HWNDDEACT(wp,lp)	(HWND)(wp)
#define	GET_WM_MDIACTIVATE_MPS(f,hwndD,hwndA)	(WPARAM)(hwndA),0
#define	GET_WM_MDISETMENU_MPS(hmenuF,hmenuW)	(WPARAM)hmenuF,(LONG)hmenuW
#define	GET_WM_MENUCHAR_CHAR(wp,lp)	(TCHAR)LOWORD(wp)
#define	GET_WM_MENUCHAR_FMENU(wp,lp)	(BOOL)HIWORD(wp)
#define	GET_WM_MENUCHAR_HMENU(wp,lp)	(HMENU)(lp)
#define	GET_WM_MENUCHAR_MPS(ch,hmenu,f)	(WPARAM)MAKELONG(ch,f),(LONG)(hmenu)
#define	GET_WM_MENUSELECT_CMD(wp,lp)	LOWORD(wp)
#define	GET_WM_MENUSELECT_FLAGS(wp,lp)	(UINT)(int)(short)HIWORD(wp)
#define	GET_WM_MENUSELECT_HMENU(wp,lp)	(HMENU)(lp)
#define	GET_WM_MENUSELECT_MPS(cmd,f,hmenu)	(WPARAM)MAKELONG(cmd,f),(LONG)(hmenu)
#define	GET_WM_PARENTNOTIFY_HWNDCHILD(wp,lp)	(HWND)(lp)
#define	GET_WM_PARENTNOTIFY_ID(wp,lp)	HIWORD(wp)
#define	GET_WM_PARENTNOTIFY_MPS(msg,id,hwnd)	(WPARAM)MAKELONG(id,msg),(LONG)(hwnd)
#define	GET_WM_PARENTNOTIFY_MSG(wp,lp)	LOWORD(wp)
#define	GET_WM_PARENTNOTIFY_X(wp,lp)	(int)(short)LOWORD(lp)
#define	GET_WM_PARENTNOTIFY_Y(wp,lp)	(int)(short)HIWORD(lp)
#define	GET_WM_PARENTNOTIFY2_MPS(msg,x,y)	(WPARAM)MAKELONG(0,msg),MAKELONG(x,y)
#define	GET_WM_VKEYTOITEM_CODE(wp,lp)	(int)(short)LOWORD(wp)
#define	GET_WM_VKEYTOITEM_HWND(wp,lp)	(HWND)(lp)
#define	GET_WM_VKEYTOITEM_ITEM(wp,lp)	HIWORD(wp)
#define	GET_WM_VKEYTOITEM_MPS(code,item,hwnd)	(WPARAM)MAKELONG(item,code),(LONG)(hwnd)
#define	GET_WM_VSCROLL_CODE(wp,lp)	LOWORD(wp)
#define	GET_WM_VSCROLL_HWND(w,l)	(HWND)(l)
#define	GET_WM_VSCROLL_MPS(c,p,h)	(WPARAM)MAKELONG(c,p),(LONG)(h)
#define	GET_WM_VSCROLL_POS(wp,lp)	HIWORD(wp)
#define	GET_WPARAM(w,l)	(w)
#define	HANDLE_MSG(h,m,f)	case(m):return HANDLE_##m((h),(wParam),(lParam),(f))
#define	HANDLE_WM_ACTIVATE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)LOWORD(wParam),(HWND)(lParam),(BOOL)HIWORD(wParam)),0L)
#define	HANDLE_WM_ACTIVATEAPP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(BOOL)(wParam),(DWORD)(lParam)),0L)
#define	HANDLE_WM_ASKCBFORMATNAME(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(wParam),(LPTSTR)(lParam)),0L)
#define	HANDLE_WM_CANCELMODE(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_CHANGECBCHAIN(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam),(HWND)(lParam)),0L)
#define	HANDLE_WM_CHAR(hwnd,wParam,lParam,fn)	((fn)((hwnd),(TCHAR)(wParam),(int)(short)LOWORD(lParam)),0L)
#define	HANDLE_WM_CHARTOITEM(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(int)(fn)((hwnd),(UINT)LOWORD(wParam),(HWND)(lParam),(int)(short)HIWORD(wParam))
#define	HANDLE_WM_CHILDACTIVATE(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_CLEAR(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_CLOSE(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_COMMAND(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(LOWORD(wParam)),(HWND)(lParam),(UINT)HIWORD(wParam)),0L)
#define	HANDLE_WM_COMMNOTIFY(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(wParam),(UINT)LOWORD(lParam)),0L)
#define	HANDLE_WM_COMPACTING(w,wP,lParam,f)	((f)((w),(UINT)(wP)),0L)
#define	HANDLE_WM_COMPAREITEM(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(int)(fn)((hwnd),(const	COMPAREITEMSTRUCT	*)(lParam))
#define	HANDLE_WM_COPY(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_CREATE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(LPCREATESTRUCT)(lParam))	?	0L	:	(LRESULT)-1L)
#define	HANDLE_WM_CTLCOLORBTN(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd),(HDC)(wParam),(HWND)(lParam),CTLCOLOR_BTN)
#define	HANDLE_WM_CTLCOLORDLG(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd),(HDC)(wParam),(HWND)(lParam),CTLCOLOR_DLG)
#define	HANDLE_WM_CTLCOLOREDIT(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd),(HDC)(wParam),(HWND)(lParam),CTLCOLOR_EDIT)
#define	HANDLE_WM_CTLCOLORLISTBOX(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd),(HDC)(wParam),(HWND)(lParam),CTLCOLOR_LISTBOX)
#define	HANDLE_WM_CTLCOLORMSGBOX(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd),(HDC)(wParam),(HWND)(lParam),CTLCOLOR_MSGBOX)
#define	HANDLE_WM_CTLCOLORSCROLLBAR(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd),(HDC)(wParam),(HWND)(lParam),CTLCOLOR_SCROLLBAR)
#define	HANDLE_WM_CTLCOLORSTATIC(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd),(HDC)(wParam),(HWND)(lParam),CTLCOLOR_STATIC)
#define	HANDLE_WM_CUT(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_DEADCHAR(hwnd,wParam,lParam,fn)	((fn)((hwnd),(TCHAR)(wParam),(int)(short)LOWORD(lParam)),0L)
#define	HANDLE_WM_DELETEITEM(hwnd,wParam,lParam,fn)	((fn)((hwnd),(const	DELETEITEMSTRUCT	*)(lParam)),0L)
#define	HANDLE_WM_DESTROY(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_DESTROYCLIPBOARD(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_DEVMODECHANGE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(LPCTSTR)(lParam)),0L)
#define	HANDLE_WM_DRAWCLIPBOARD(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_DRAWITEM(hwnd,wParam,lParam,fn)	((fn)((hwnd),(const	DRAWITEMSTRUCT	*)(lParam)),0L)
#define	HANDLE_WM_DROPFILES(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HDROP)(wParam)),0L)
#define	HANDLE_WM_ENABLE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(BOOL)(wParam)),0L)
#define	HANDLE_WM_ENDSESSION(hwnd,wParam,lParam,fn)	((fn)((hwnd),(BOOL)(wParam)),0L)
#define	HANDLE_WM_ENTERIDLE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam),(HWND)(lParam)),0L)
#define	HANDLE_WM_ERASEBKGND(hwnd,wParam,lParam,fn)	(LRESULT)(BOOL)(fn)((hwnd),(HDC)(wParam))
#define	HANDLE_WM_FONTCHANGE(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_GETDLGCODE(hwnd,wParam,lParam,fn)	(LRESULT)(UINT)(fn)(hwnd,(LPMSG)(lParam))
#define	HANDLE_WM_GETFONT(hwnd,wParam,lParam,fn)	(LRESULT)(UINT)(HFONT)(fn)(hwnd)
#define	HANDLE_WM_GETMINMAXINFO(hwnd,wParam,lParam,fn)	((fn)((hwnd),(LPMINMAXINFO)(lParam)),0L)
#define	HANDLE_WM_GETTEXT(hwnd,wParam,lParam,fn)	(LRESULT)(int)(fn)((hwnd),(int)(wParam),(LPTSTR)(lParam))
#define	HANDLE_WM_GETTEXTLENGTH(hwnd,wParam,lParam,fn)	(LRESULT)(int)(fn)(hwnd)
#define	HANDLE_WM_HSCROLL(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(lParam),(UINT)(LOWORD(wParam)),(int)(short)HIWORD(wParam)),0L)
#define	HANDLE_WM_HSCROLLCLIPBOARD(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam),(UINT)LOWORD(lParam),(int)(short)HIWORD(lParam)),0L)
#define	HANDLE_WM_ICONERASEBKGND(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(BOOL)(fn)((hwnd),(HDC)(wParam))
#define	HANDLE_WM_INITDIALOG(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(BOOL)(fn)((hwnd),(HWND)(wParam),lParam)
#define	HANDLE_WM_INITMENU(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HMENU)(wParam)),0L)
#define	HANDLE_WM_INITMENUPOPUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HMENU)(wParam),(UINT)LOWORD(lParam),(BOOL)HIWORD(lParam)),0L)
#define	HANDLE_WM_KEYDOWN(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam),TRUE,(int)(short)LOWORD(lParam),(UINT)HIWORD(lParam)),0L)
#define	HANDLE_WM_KEYUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam),FALSE,(int)(short)LOWORD(lParam),(UINT)HIWORD(lParam)),0L)
#define	HANDLE_WM_KILLFOCUS(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam)),0L)
#define	HANDLE_WM_LBUTTONDBLCLK(hwnd,wParam,lParam,fn)	((fn)((hwnd),TRUE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_LBUTTONDOWN(hwnd,wParam,lParam,fn)	((fn)((hwnd),FALSE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_LBUTTONUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_MBUTTONDBLCLK(hwnd,wParam,lParam,fn)	((fn)((hwnd),TRUE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_MBUTTONDOWN(hwnd,wParam,lParam,fn)	((fn)((hwnd),FALSE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_MBUTTONUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_MDIACTIVATE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(BOOL)(lParam==(LPARAM)hwnd),(HWND)(lParam),(HWND)(wParam)),0L)
#define	HANDLE_WM_MDICASCADE(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(fn)((hwnd),(UINT)(wParam))
#define	HANDLE_WM_MDICREATE(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(fn)((hwnd),(LPMDICREATESTRUCT)(lParam))
#define	HANDLE_WM_MDIDESTROY(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam)),0L)
#define	HANDLE_WM_MDIGETACTIVE(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(fn)(hwnd)
#define	HANDLE_WM_MDIICONARRANGE(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_MDIMAXIMIZE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam)),0L)
#define	HANDLE_WM_MDINEXT(hwnd,wParam,lParam,fn)	(LRESULT)(HWND)(fn)((hwnd),(HWND)(wParam),(BOOL)lParam)
#define	HANDLE_WM_MDIRESTORE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam)),0L)
#define	HANDLE_WM_MDISETMENU(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(fn)((hwnd),(BOOL)(wParam),(HMENU)(wParam),(HMENU)(lParam))
#define	HANDLE_WM_MDITILE(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(fn)((hwnd),(UINT)(wParam))
#define	HANDLE_WM_MEASUREITEM(hwnd,wParam,lParam,fn)	((fn)((hwnd),(MEASUREITEMSTRUCT	*)(lParam)),0L)
#define	HANDLE_WM_MENUCHAR(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(fn)((hwnd),(UINT)(LOWORD(wParam)),(UINT)HIWORD(wParam),(HMENU)(lParam))
#define	HANDLE_WM_MENUSELECT(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HMENU)(lParam),(int)(LOWORD(wParam)),(HIWORD(wParam)&MF_POPUP)?GetSubMenu((HMENU)lParam,LOWORD(wParam)):0L,(UINT)(((short)HIWORD(wParam)==-1)?0xFFFFFFFF:HIWORD(wParam))),0L)
#define	HANDLE_WM_MOUSEACTIVATE(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(int)(fn)((hwnd),(HWND)(wParam),(UINT)LOWORD(lParam),(UINT)HIWORD(lParam))
#define	HANDLE_WM_MOUSEMOVE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_MOVE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam)),0L)
#define	HANDLE_WM_NCACTIVATE(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(BOOL)(fn)((hwnd),(BOOL)(wParam),0L,0L)
#define	HANDLE_WM_NCCALCSIZE(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(fn)((hwnd),(BOOL)(0),(NCCALCSIZE_PARAMS	*)(lParam))
#define	HANDLE_WM_NCCREATE(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(BOOL)(fn)((hwnd),(LPCREATESTRUCT)(lParam))
#define	HANDLE_WM_NCDESTROY(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_NCHITTEST(hwnd,wParam,lParam,fn)	(LRESULT)(fn)((hwnd),(int)(short)LOWORD(lParam),(int)HIWORD(lParam))
#define	HANDLE_WM_NCLBUTTONDBLCLK(hwnd,wParam,lParam,fn)	((fn)((hwnd),TRUE,(int)(short)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCLBUTTONDOWN(hwnd,wParam,lParam,fn)	((fn)((hwnd),FALSE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCLBUTTONUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCMBUTTONDBLCLK(hwnd,wParam,lParam,fn)	((fn)((hwnd),TRUE,(int)(short)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCMBUTTONDOWN(hwnd,wParam,lParam,fn)	((fn)((hwnd),FALSE,(int)(short)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCMBUTTONUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCMOUSEMOVE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCPAINT(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HRGN)(wParam)),0L)
#define	HANDLE_WM_NCRBUTTONDBLCLK(hwnd,wParam,lParam,fn)	((fn)((hwnd),TRUE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCRBUTTONDOWN(hwnd,wParam,lParam,fn)	((fn)((hwnd),FALSE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NCRBUTTONUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_NEXTDLGCTL(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HWND)(fn)((hwnd),(HWND)(wParam),(BOOL)(lParam))
#define	HANDLE_WM_PAINT(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_PAINTCLIPBOARD(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam),(const	LPPAINTSTRUCT)GlobalLock((HGLOBAL)(lParam))),GlobalUnlock((HGLOBAL)(lParam)),0L)
#define	HANDLE_WM_PALETTECHANGED(h,wP,lP,fn)	((fn)((h),(HWND)(wP)),0L)
#define	HANDLE_WM_PALETTEISCHANGING(h,wP,lP,fn)	((fn)((h),(HWND)(wP)),0L)
#define	HANDLE_WM_PARENTNOTIFY(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)LOWORD(wParam),(HWND)(lParam),(UINT)HIWORD(wParam)),0L)
#define	HANDLE_WM_PASTE(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_POWER(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(wParam)),0L)
#define	HANDLE_WM_QUERYDRAGICON(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(fn)(hwnd)
#define	HANDLE_WM_QUERYENDSESSION(hwnd,wParam,lParam,fn)	MAKELRESULT((BOOL)(fn)(hwnd),0L)
#define	HANDLE_WM_QUERYNEWPALETTE(h,wP,lP,fn)	MAKELRESULT((WINBOOL)(fn)(h),0L)
#define	HANDLE_WM_QUERYOPEN(hwnd,wParam,lParam,fn)	MAKELRESULT((BOOL)(fn)(hwnd),0L)
#define	HANDLE_WM_QUEUESYNC(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_QUIT(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(wParam)),0L)
#define	HANDLE_WM_RBUTTONDBLCLK(hwnd,wParam,lParam,fn)	((fn)((hwnd),TRUE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_RBUTTONDOWN(hwnd,wParam,lParam,fn)	((fn)((hwnd),FALSE,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_RBUTTONUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),(UINT)(wParam)),0L)
#define	HANDLE_WM_RENDERALLFORMATS(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_RENDERFORMAT(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(UINT)(HANDLE)(fn)((hwnd),(UINT)(wParam))
#define	HANDLE_WM_SETCURSOR(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(BOOL)(fn)((hwnd),(HWND)(wParam),(UINT)LOWORD(lParam),(UINT)HIWORD(lParam))
#define	HANDLE_WM_SETFOCUS(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam)),0L)
#define	HANDLE_WM_SETFONT(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HFONT)(wParam),(BOOL)(lParam)),0L)
#define	HANDLE_WM_SETREDRAW(hwnd,wParam,lParam,fn)	((fn)((hwnd),(BOOL)(wParam)),0L)
#define	HANDLE_WM_SETTEXT(hwnd,wParam,lParam,fn)	((fn)((hwnd),(LPCTSTR)(lParam)),0L)
#define	HANDLE_WM_SHOWWINDOW(hwnd,wParam,lParam,fn)	((fn)((hwnd),(BOOL)(wParam),(UINT)(lParam)),0L)
#define	HANDLE_WM_SIZE(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam),(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam)),0L)
#define	HANDLE_WM_SIZECLIPBOARD(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam),(const	LPRECT)GlobalLock((HGLOBAL)(lParam))),GlobalUnlock((HGLOBAL)(lParam)),0L)
#define	HANDLE_WM_SPOOLERSTATUS(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam),(int)(short)LOWORD(lParam)),0L)
#define	HANDLE_WM_SYSCHAR(hwnd,wParam,lParam,fn)	((fn)((hwnd),(TCHAR)(wParam),(int)(short)LOWORD(lParam)),0L)
#define	HANDLE_WM_SYSCOLORCHANGE(h,wParam,lParam,f)	((f)(h),0L)
#define	HANDLE_WM_SYSCOMMAND(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam),(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam)),0L)
#define	HANDLE_WM_SYSDEADCHAR(hwnd,wParam,lParam,fn)	((fn)((hwnd),(TCHAR)(wParam),(int)(short)LOWORD(lParam)),0L)
#define	HANDLE_WM_SYSKEYDOWN(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam),TRUE,(int)(short)LOWORD(lParam),(UINT)HIWORD(lParam)),0L)
#define	HANDLE_WM_SYSKEYUP(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam),FALSE,(int)(short)LOWORD(lParam),(UINT)HIWORD(lParam)),0L)
#define	HANDLE_WM_TIMECHANGE(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_TIMER(hwnd,wParam,lParam,fn)	((fn)((hwnd),(UINT)(wParam)),0L)
#define	HANDLE_WM_UNDO(hwnd,wParam,lParam,fn)	((fn)(hwnd),0L)
#define	HANDLE_WM_VKEYTOITEM(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(int)(fn)((hwnd),(UINT)LOWORD(wParam),(HWND)(lParam),(int)(short)HIWORD(wParam))
#define	HANDLE_WM_VSCROLL(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(lParam),(UINT)(LOWORD(wParam)),(int)(short)HIWORD(wParam)),0L)
#define	HANDLE_WM_VSCROLLCLIPBOARD(hwnd,wParam,lParam,fn)	((fn)((hwnd),(HWND)(wParam),(UINT)LOWORD(lParam),(int)(short)HIWORD(lParam)),0L)
#define	HANDLE_WM_WINDOWPOSCHANGED(hwnd,wParam,lParam,fn)	((fn)((hwnd),(const	LPWINDOWPOS)(lParam)),0L)
#define	HANDLE_WM_WINDOWPOSCHANGING(hwnd,wParam,lParam,fn)	(LRESULT)(DWORD)(BOOL)(fn)((hwnd),(LPWINDOWPOS)(lParam))
#define	HANDLE_WM_WININICHANGE(h,w,lP,f)	((f)((h),(LPCTSTR)(lP)),0L)
#define	ListBox_AddItemData(hC,data)	((int)SendMessage((hC),LB_ADDSTRING,0L,(LPARAM)(data)))
#define	ListBox_AddString(hC,lpsz)	((int)SendMessage((hC),LB_ADDSTRING,0L,(LPARAM)(LPCTSTR)(lpsz)))
#define	ListBox_DeleteString(hC,index)	((int)SendMessage((hC),LB_DELETESTRING,(WPARAM)(int)(index),0L))
#define	ListBox_Dir(hC,attrs,lpszFileSpec)	((int)SendMessage((hC),LB_DIR,(WPARAM)(UINT)(attrs),(LPARAM)(LPCTSTR)(lpszFileSpec)))
#define	ListBox_Enable(hC,fEnable)	EnableWindow((hC),(fEnable))
#define	ListBox_FindItemData(hC,iS,data)	((int)SendMessage((hC),LB_FINDSTRING,(WPARAM)(int)(iS),(LPARAM)(data)))
#define	ListBox_FindString(hC,iS,lpszFind)	((int)SendMessage((hC),LB_FINDSTRING,(WPARAM)(int)(iS),(LPARAM)(LPCTSTR)(lpszFind)))
#define	ListBox_FindStringExact(hC,iS,lpszFind)	((int)SendMessage((hC),LB_FINDSTRINGEXACT,(WPARAM)(int)(iS),(LPARAM)(LPCTSTR)(lpszFind)))
#define	ListBox_GetCaretIndex(hC)	((int)SendMessage((hC),LB_GETCARETINDEX,0L,0L))
#define	ListBox_GetCount(hC)	((int)SendMessage((hC),LB_GETCOUNT,0L,0L))
#define	ListBox_GetCurSel(hC)	((int)SendMessage((hC),LB_GETCURSEL,0L,0L))
#define	ListBox_GetHorizontalExtent(hC)	((int)SendMessage((hC),LB_GETHORIZONTALEXTENT,0L,0L))
#define	ListBox_GetItemData(hC,index)	((LRESULT)(DWORD)SendMessage((hC),LB_GETITEMDATA,(WPARAM)(int)(index),0L))
#define	ListBox_GetItemHeight(hC,index)	((int)SendMessage((hC),LB_GETITEMHEIGHT,(WPARAM)(int)(index),0L))
#define	ListBox_GetItemRect(hC,index,lprc)	((int)SendMessage((hC),LB_GETITEMRECT,(WPARAM)(int)(index),(LPARAM)(RECT	*)(lprc)))
#define	ListBox_GetSel(hC,index)	((int)SendMessage((hC),LB_GETSEL,(WPARAM)(int)(index),0L))
#define	ListBox_GetSelCount(hC)	((int)SendMessage((hC),LB_GETSELCOUNT,0L,0L))
#define	ListBox_GetSelItems(hC,cItems,lpItems)	((int)SendMessage((hC),LB_GETSELITEMS,(WPARAM)(int)(cItems),(LPARAM)(int	*)(lpItems)))
#define	ListBox_GetText(hC,index,lpszBuffer)	((int)SendMessage((hC),LB_GETTEXT,(WPARAM)(int)(index),(LPARAM)(LPCTSTR)(lpszBuffer)))
#define	ListBox_GetTextLen(hC,index)	((int)SendMessage((hC),LB_GETTEXTLEN,(WPARAM)(int)(index),0L))
#define	ListBox_GetTopIndex(hC)	((int)SendMessage((hC),LB_GETTOPINDEX,0L,0L))
#define	ListBox_InsertItemData(hC,index,data)	((int)SendMessage((hC),LB_INSERTSTRING,(WPARAM)(int)(index),(LPARAM)(data)))
#define	ListBox_InsertString(hC,index,lpsz)	((int)SendMessage((hC),LB_INSERTSTRING,(WPARAM)(int)(index),(LPARAM)(LPCTSTR)(lpsz)))
#define	ListBox_ResetContent(hC)	((BOOL)(DWORD)SendMessage((hC),LB_RESETCONTENT,0L,0L))
#define	ListBox_SelectItemData(hC,iS,data)	((int)SendMessage((hC),LB_SELECTSTRING,(WPARAM)(int)(iS),(LPARAM)(data)))
#define	ListBox_SelectString(hC,iS,lpszFind)	((int)SendMessage((hC),LB_SELECTSTRING,(WPARAM)(int)(iS),(LPARAM)(LPCTSTR)(lpszFind)))
#define	ListBox_SelItemRange(hC,fSelect,first,last)	((int)SendMessage((hC),LB_SELITEMRANGE,(WPARAM)(BOOL)(fSelect),MAKELPARAM((first),(last))))
#define	ListBox_SetCaretIndex(hC,index)	((int)SendMessage((hC),LB_SETCARETINDEX,(WPARAM)(int)(index),0L))
#define	ListBox_SetColumnWidth(hC,cxColumn)	((void)SendMessage((hC),LB_SETCOLUMNWIDTH,(WPARAM)(int)(cxColumn),0L))
#define	ListBox_SetCurSel(hC,index)	((int)SendMessage((hC),LB_SETCURSEL,(WPARAM)(int)(index),0L))
#define	ListBox_SetHorizontalExtent(hC,cxExtent)	((void)SendMessage((hC),LB_SETHORIZONTALEXTENT,(WPARAM)(int)(cxExtent),0L))
#define	ListBox_SetItemData(hC,index,data)	((int)SendMessage((hC),LB_SETITEMDATA,(WPARAM)(int)(index),(LPARAM)(data)))
#define	ListBox_SetItemHeight(hC,index,cy)	((int)SendMessage((hC),LB_SETITEMHEIGHT,(WPARAM)(int)(index),MAKELPARAM((cy),0)))
#define	ListBox_SetSel(hC,fSelect,index)	((int)SendMessage((hC),LB_SETSEL,(WPARAM)(BOOL)(fSelect),(LPARAM)(index)))
#define	ListBox_SetTabStops(h,c,T)	((WINBOOL)SendMessage((h),LB_SETTABSTOPS,(WPARAM)(c),(LPARAM)(T)))
#define	ListBox_SetTopIndex(h,i)	((int)SendMessage((h),LB_SETTOPINDEX,(WPARAM)(i),0L))
#define	ScrollBar_Enable(h,f)	EnableScrollBar((h),SB_CTL,(f))
#define	ScrollBar_GetPos(h)	GetScrollPos((h),SB_CTL)
#define	ScrollBar_GetRange(h,pMin,pMax)	GetScrollRange((h),SB_CTL,(pMin),(pMax))
#define	ScrollBar_SetPos(h,p,f)	SetScrollPos((h),SB_CTL,(p),(f))
#define	ScrollBar_SetRange(h,pMin,pMax,f)	SetScrollRange((h),SB_CTL,(pMin),(pMax),(f))
#define	ScrollBar_Show(h,f)	ShowWindow((h),(f)?SW_SHOWNORMAL:SW_HIDE)
#define	Static_Enable(h,f)	EnableWindow((h),(f))
#define	Static_GetIcon(h,hI)	((HICON)SendMessage((h),STM_GETICON,0L,0L))
#define	Static_GetText(h,ch,cM)	GetWindowText((h),(ch),(cM))
#define	Static_GetTextLength(h)	GetWindowTextLength(h)
#define	Static_SetIcon(h,hI)	((HICON)SendMessage((h),STM_SETICON,(WPARAM)(hI),0L))
#define	Static_SetText(h,l)	SetWindowText((h),(l))
#define	WM_CTLCOLOR	0x0019
#define	CheckDefDlgRecursion(R)	if	(*(R)){*(R)=FALSE;return	FALSE;}
#define	CopyRgn(Dst,Src)	CombineRgn(Dst,Src,0,RGN_COPY)
#define	DefDlgProcEx(h,m,wP,lP,R)	(*(R)=TRUE,DefDlgProc(h,m,wP,lP))
#define	DeleteBitmap(h)	DeleteObject((HGDIOBJ)(h))
#define	DeleteBrush(h)	DeleteObject((HGDIOBJ)(h))
#define	DeleteFont(h)	DeleteObject((HGDIOBJ)(hfont))
#define	DeletePalette(pal)	DeleteObject((HGDIOBJ)(pal))
#define	DeletePen(hp)	DeleteObject((HGDIOBJ)(hp))
#define	DeleteRgn(h)	DeleteObject((HGDIOBJ)(h))
#define	GetFirstChild(h)	GetTopWindow(h)
#define	GetFirstSibling(h)	GetWindow(h,GW_HWNDFIRST)
#define	GetInstanceModule(hI)	(HMODULE)(hI)
#define	GetLastSibling(h)	GetWindow(h,GW_HWNDLAST)
#define	GetNextSibling(hwnd)	GetWindow(hwnd,GW_HWNDNEXT)
#define	GetPrevSibling(hwnd)	GetWindow(hwnd,GW_HWNDPREV)
#define	GetStockBrush(i)	((HBRUSH)GetStockObject(i))
#define	GetStockFont(i)	((HFONT)GetStockObject(i))
#define	GetStockPen(i)	((HPEN)GetStockObject(i))
#define	GetWindowExStyle(h)	((DWORD)GetWindowLong(h,GWL_EXSTYLE))
#define	GetWindowID(hwnd)	GetDlgCtrlID(hwnd)
#define	GetWindowInstance(h)	((HMODULE)GetWindowLong(h,GWL_HINSTANCE))
#define	GetWindowOwner(h)	GetWindow(h,GW_OWNER)
#define	GetWindowStyle(h)	((DWORD)GetWindowLong(h,GWL_STYLE))
#define	GlobalAllocPtr(f,c)	(GlobalLock(GlobalAlloc((f),(c))))
#define	GlobalFreePtr(p)	(GlobalUnlockPtr(p),(WINBOOL)GlobalFree(GlobalPtrHandle(p)))
#define	GlobalLockPtr(p)	((WINBOOL)GlobalLock(GlobalPtrHandle(p)))
#define	GlobalPtrHandle(p)	((HGLOBAL)GlobalHandle(p))
#define	GlobalReAllocPtr(p,c,f)	(GlobalUnlockPtr(p),GlobalLock(GlobalReAlloc(GlobalPtrHandle(p),(c),(f))))
#define	GlobalUnlockPtr(p)	GlobalUnlock(GlobalPtrHandle(p))
#define	InsetRect(rc,dx,dy)	InflateRect((rc),-(dx),-(dy))
#define	IntersectRgn(R,hA,hB)	CombineRgn(R,hA,hB,RGN_AND)
#define	SelectBitmap(dc,bm)	((HBITMAP)SelectObject((dc),(HGDIOBJ)(bm)))
#define	SelectBrush(dc,b)	((HBRUSH)SelectObject((dc),(HGDIOBJ)(b)))
#define	SelectFont(h,f)	((HFONT)SelectObject((h),(HGDIOBJ)(f)))
#define	SelectPen(hdc,hpen)	((HPEN)SelectObject((hdc),(HGDIOBJ)(hpen)))
#define	SetDlgMsgResult(hwnd,m,result)	(((m)==WM_CTLCOLORMSGBOX||(m)==WM_CTLCOLOREDIT||\
(m)==WM_CTLCOLORLISTBOX||(m)==WM_CTLCOLORBTN||(m)==WM_CTLCOLORDLG||(m)==WM_CTLCOLORSCROLLBAR||\
(m)==WM_CTLCOLORSTATIC||(m)==WM_COMPAREITEM||(m)==WM_VKEYTOITEM||(m)==WM_CHARTOITEM||(m)==WM_QUERYDRAGICON||\
(m)==WM_INITDIALOG)?(WINBOOL)(result):(SetWindowLong((hwnd),DWL_MSGRESULT,(LPARAM)(result)),TRUE))
#define	SetWindowRedraw(h,f)	((void)SendMessage(h,WM_SETREDRAW,(WPARAM)(f),0))
#define	SubclassDialog(h,f)	((DLGPROC)SetWindowLong(h,DWL_DLGPROC,(LPARAM)(f)))
#define	SubclassWindow(h,f)	((WNDPROC)SetWindowLong((h),GWL_WNDPROC,(LPARAM)(f)))
#define	SubtractRgn(R,hA,hB)	CombineRgn(R,hA,hB,RGN_DIFF)
#define	UnionRgn(R,hA,hB)	CombineRgn(R,hA,hB,RGN_OR)
#define	XorRgn(R,hA,hB)	CombineRgn(R,hA,hB,RGN_XOR)
#endif
