windows消息宏(转)

WM_COMMAND 消息控制函数
映射入口 函数原型
ON_COMMAND(<ID>,<FUN> ) afx_msg void FUN();
ON_COMMAND_EX(<ID>,<FUN> ) afx_msg bool FUN(UINT);
子窗口通知消息控制函数
映射入口 函数原型
一般的控制通知代码
ON_CONTROL(<WNotifyCode>,<ID>,<FUN> ) afx_msg void FUN();
ON_NOTIFY(<WNotifyCode>,<ID>,<FUN> ) afx_msg void FUN();
用户按钮通知代码
ON_BN_CLICKED(<ID>,<FUN> ) afx_msg void FUN();
ON_BN_DISABLE(<ID>,<FUN> ) afx_msg void FUN();
ON_BN_DOUBLECLICKED(<ID>,<FUN> ) afx_msg void FUN();
ON_BN_HILITE(<ID>,<FUN> ) afx_msg void FUN();
ON_BN_PAINT(<ID>,<FUN> ) afx_msg void FUN();
ON_BN_ONHILITE(<ID>,<FUN> ) afx_msg void FUN();
组合框通知代码
ON_CBN_CLOSEUP(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_DBLCLK(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_DROPDOWN(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_EDITUPDATE(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_ERRSPACE(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_KILLFOCUS(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_SELCHANGE(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_SELENDCANCEL(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_SELENDOK(<ID>,<FUN> ) afx_msg void FUN();
ON_CBN_SETFOCUS(<ID>,<FUN> ) afx_msg void FUN();
编辑框通知代码
ON_EN_CHANGE(<ID>,<FUN> ) afx_msg void FUN();
ON_EN_ERRSPACE(<ID>,<FUN> ) afx_msg void FUN();
ON_EN_HSCROLL(<ID>,<FUN> ) afx_msg void FUN();
ON_EN_KILLFOCUS(<ID>,<FUN> ) afx_msg void FUN();
ON_EN_MAXTEXT(<ID>,<FUN> ) afx_msg void FUN();
ON_EN_SETFOCUS(<ID>,<FUN> ) afx_msg void FUN();
ON_EN_UPDATE(<ID>,<FUN> ) afx_msg void FUN();
ON_EN_VSCROLL(<ID>,<FUN> ) afx_msg void FUN();
列表框通知代码
ON_LBN_DBLCLK(<ID>,<FUN> ) afx_msg void FUN();
ON_LBN_ERRSPACE(<ID>,<FUN> ) afx_msg void FUN();
ON_LBN_KILLFOCUS(<ID>,<FUN> ) afx_msg void FUN();
ON_LBN_SELCHANGE(<ID>,<FUN> ) afx_msg void FUN();
ON_LBN_SETFOCUS(<ID>,<FUN> ) afx_msg void FUN();
列表视图通知代码
LVN_BEGINDRAG(<ID>,<FUN> ) afx_msg void FUN();
LVN_BEGINLABLEEDIT(<ID>,<FUN> ) afx_msg void FUN();
LVN_BEGINRDRAG(<ID>,<FUN> ) afx_msg void FUN();
LVN_COLUMNCLICK(<ID>,<FUN> ) afx_msg void FUN();
LVN_DELETEALLITEMS(<ID>,<FUN> ) afx_msg void FUN();
LVN_DELETEITEM(<ID>,<FUN> ) afx_msg void FUN();
LVN_ENDLABLEEDIT(<ID>,<FUN> ) afx_msg void FUN();
LVN_GETDISPINFOR(<ID>,<FUN> ) afx_msg void FUN();
LVN_INSERTITEM(<ID>,<FUN> ) afx_msg void FUN();
LVN_ITEMCHANGED(<ID>,<FUN> ) afx_msg void FUN();
LVN_KEYDOWN(<ID>,<FUN> ) afx_msg void FUN();
LVN_PEN(<ID>,<FUN> ) afx_msg void FUN();
LVN_SETDISPINFO(<ID>,<FUN> ) afx_msg void FUN();
树视图通知代码
TVN_BEGINDRAG(<ID>,<FUN> ) afx_msg void FUN();
TVN_BEGINLABLEEDIT(<ID>,<FUN> ) afx_msg void FUN();
TVN_BEGINRDRAG(<ID>,<FUN> ) afx_msg void FUN();
TVN_DELETEITEM(<ID>,<FUN> ) afx_msg void FUN();
TVN_ENDLABLEEDIT(<ID>,<FUN> ) afx_msg void FUN();
TVN_GETDISPINFOR(<ID>,<FUN> ) afx_msg void FUN();
TVN_ITEMEXPENDED(<ID>,<FUN> ) afx_msg void FUN();
TVN_KEYDOWN(<ID>,<FUN> ) afx_msg void FUN();
TVN_SELCHANGED(<ID>,<FUN> ) afx_msg void FUN();
TVN_SELCHANGING(<ID>,<FUN> ) afx_msg void FUN();
列表控制通知代码
TCN_KEYDOWN(<ID>,<FUN> ) afx_msg void FUN();
TCN_SELCHANGED(<ID>,<FUN> ) afx_msg void FUN();
TCN_SELCHANGING(<ID>,<FUN> ) afx_msg void FUN();
WINDOWS通知消息控制函数
映射入口 函数原型
ON_WM_ACTIVATE() afx_msg void OnActivate(UINT,CWnd*,bool);
ON_WM_ACTIVATEAPP() afx_msg void ONActivateApp(bool,HANDLB);
ON_WM_ASKBFORMATNAME() afx_msg void OnAskCbFormatName(UINT,LPSTR);
ON_WM_CANCELMODE() afx_msg void OnCancelmode();
ON_WM_CHANGECBCHAIN() afx_msg void OnChangeCbChain(HWND,HWND);
ON_WM_CHAR() afx_msg void OnChar(UINT,UINT,UINT);
ON_WM_CHARTOITEM() afx_msg int OnCharToItem(UINT,CWnd*,UINT);
ON_WM_CHILDACTIVATE() afx_msg void OnChildActivate();
ON_WM_CLOSE() afx_msg void OnClose();
ON_WM_COMPACTING() afx_msg void OnCompacting(UINT);
ON_WM_COMPAREITEM() afx_msg int OnCompareItem(LPDELETEITEMSTRUCT);
ON_WM_CREATE() afx_msg int OnCreate(LPCREATESTRUCT);
ON_WM_CTLCOLOR() afx_msg HBRUSH OncTLCOLOR(CDC*,CWnd*,UINT);
ON_WM_DEADCHAR() afx_msg void OnDeadChar(UINT,UINT,UINT);
ON_WM_DELETEITEM() afx_msg void OnDeleteItem(LPDELETEITEMSTRUCT);
ON_WM_DESTROY() afx_msg void OnDestroy();
ON_WM_DESTROYCLIPBOARD() afx_msg void OnDestroyClipboard();
ON_WM_DEVMODE_CHANGE() afx_msg void OnDevModeChande(LPSTR);
ON_WM_DRAWCLIPBOARD() afx_msg void OnDrawClipboard();
ON_WM_DRAWITEM() afx_msg void OnDrawItem(LPDRAWITEMSTRUCT);
ON_WM_DROPFILES() afx_msg void OnDropFiles(HANDLE);
ON_WM_ENABLE() afx_msg void OnEnable(bool);
ON_WM_ENDSESSION() afx_msg void OnEndSession(bool);
ON_WM_ENTERIDLE() afx_msg void OnEnterIdle(UINT,CWnd*);
ON_WM_ERASEBKGND() afx_msg bool OnEraseBkgnd(CDC*);
ON_WM_FONTCHANGE() afx_msg void OnFontChange();
ON_WM_GETDLGCODE() afx_msg UINT OnGetDlgCode();
ON_WM_GETMINMAXINFO() afx_msg void OnGetMinMaxInfo(LPPOINT);
ON_WM_HSCROLL() afx_msg void OnHScroll(UINT,UINT,CWnd*);
ON_WM_HSCROLLCLIPBOARD() afx_msg void OnHScrollClipboard(CWnd*,UINT,UINT);
ON_WM_ICONERASEBKGND() afx_msg void OnIconEraseBkgnd(CDC*);
ON_WM_INITMENU() afx_msg void OnInitMenu(CMenu*);
ON_WM_INITMENUPOPUP() afx_msg void OnInitMenuPopup(CMenu*,UINT,UINT);
ON_WM_KEYDOWN() afx_msg void OnKeyDown(UINT,UINT,UINT);
ON_WM_KEYUP() afx_msg void OnKeyUp(UINT,UINT,UINT);
ON_WM_KILLFOCUS() afx_msg void OnKillFocus(CWnd*);
ON_WM_LBOTTONDBLCLK() afx_msg void OnLBottonDBlclk(UINT,CPoit);
ON_WM_LBOTTONDOWN() afx_msg void OnLBottonDown(UINT,CPoit);
ON_WM_LBOTTONUP() afx_msg void OnLBottonUp(UINT,CPoit);
ON_WM_MBOTTONDBLCLK() afx_msg void OnMBottonDBlclk(UINT,CPoit);
ON_WM_MBOTTONDOWN() afx_msg void OnMBottonDown(UINT,CPoit);
ON_WM_MBOTTONUP() afx_msg void OnMBottonUp(UINT,CPoit);
ON_WM_RBOTTONDBLCLK() afx_msg void OnRBottonDBlclk(UINT,CPoit);
ON_WM_RBOTTONDOWN() afx_msg void OnRBottonDown(UINT,CPoit);
ON_WM_RBOTTONUP() afx_msg void OnRBottonUp(UINT,CPoit);
ON_WM_MDIACTIVTE() afx_msg void OnMDIActivate(bool,CWnd*,CWnd*);
ON_WM_MEASUREITEM() afx_msg void OnMeasureItem(LPMEASUREITEMSTRUCT);
ON_WM_MENUCHAR() afx_msg LONG OnMenuChar(UINT,UINT,CMenu*);
ON_WM_MENUSELECT() afx_msg void OnMenuSelect(UINT,UINT,HMENU);
ON_WM_MOUSEACTIVATE() afx_msg void OnMouseActivate(CWnd*,UINT,UINT);
ON_WM_MOUSEMOVE() afx_msg void OnMouseMove(UINT,CPoint);
ON_WM_MOVE() afx_msg void OnMove(int,int);
ON_WM_NCATIVATE() afx_msg bool OnNcAtivate(bool);
ON_WM_NCCALCSIZE() afx_msg void OnNcCalcSize(LPRECT);
ON_WM_NCCREATE() afx_msg void OnNcCreate(LPCREATESTRUCT);
ON_WM_NCDESTROY() afx_msg void OnNcDestroy();
ON_WM_NCHITTEST() afx_msg UINT OnNcHitTest(CPoint);
ON_WM_NCPAINT() afx_msg void OnNcPaint();
ON_WM_NCLBOTTONDBLCLK() afx_msg void OnNcLBottonDBlclk(UINT,CPoit);
ON_WM_NCLBOTTONDOWN() afx_msg void OnNcLBottonDown(UINT,CPoit);
ON_WM_NCLBOTTONUP() afx_msg void OnNcLBottonUp(UINT,CPoit);
ON_WM_NCMBOTTONDBLCLK() afx_msg void OnNcMBottonDBlclk(UINT,CPoit);
ON_WM_NCMBOTTONDOWN() afx_msg void OnNcMBottonDown(UINT,CPoit);
ON_WM_NCMBOTTONUP() afx_msg void OnNcMBottonUp(UINT,CPoit);
ON_WM_NCRBOTTONDBLCLK() afx_msg void OnNcRBottonDBlclk(UINT,CPoit);
ON_WM_NCRBOTTONDOWN() afx_msg void OnNcRBottonDown(UINT,CPoit);
ON_WM_NCRBOTTONUP() afx_msg void OnNcRBottonUp(UINT,CPoit);
ON_WM_PAINT() afx_msg void OnPaint();
ON_WM_PAINTCLIPBOARD() afx_mag void OnPaintClipboard(CWnd*,HANDLE);
ON_WM_PALETTECHANGED() afx_mag void OnPaletteChanged(CWnd*);
ON_WM_PALETTECHANGING() afx_mag void OnPaletteChanging(CWnd*);
ON_WM_PARENTNOTIFY() afx_mag void OnParentNotify(UINT,LONG);
ON_WM_QUERYDRAGICON() afx_msg HCURSOR OnQueryDragIcon();
ON_WM_QUERYDRAGPALETTE() afx_msg bool OnQueryDragPalette();
ON_WM_QUERYENDSESSION() afx_msg bool OnQueryEndSesion();
ON_WM_QUERYOPEN() afx_msg bool OnQueryOpen();
ON_WM_RENDERALLFORMATS() afx_msg void OnRenderAllFormats();
ON_WM_RENDERFORMAT() afx_msg void OnRenderFormat(UINT);
ON_WM_SETFOCUS() afx_msg void OnSetFocus(CWnd*);
ON_WM_SHOWWINDOW() afx_msg void OnShowWindow(bool,UINT);
ON_WM_SIZE() afx_msg void OnSize(UINT,int,int);
ON_WM_SIZECLIPBOARD() afx_msg void OnSizeClipboard(CWnd*,HANDLE);
ON_WM_SPOOLERSTATUS() afx_msg void OnSpoolerStatus(UINT,UINT);
ON_WM_SYSCHAR() afx_msg void OnSysChar(UINT,UINT,UINT);
ON_WM_SYSCOLORCHANGE() afx_msg void OnSysColorChange();
ON_WM_SYSDEADCHAR() afx_msg void OnSysDeadChar(UINT,UINT,UINT);
ON_WM_SYSKEYDOWN() afx_msg void OnSysKeyDown(UINT,UINT,UINT);
ON_WM_SYSKEYUP() afx_msg void OnSysKeyUp(UINT,UINT,UINT);
ON_WM_TIMECHANGE() afx_msg void OnTimeChange();
ON_WM_VKEYTOITEM() afx_msg void OnVKeyToItem(UINT,CWnd*,UINT);
ON_WM_TIMER() afx_msg void OnTimer(UINT);
ON_WM_VSCROLL() afx_msg void OnVScroll(UINT,UINT,CWnd*);
ON_WM_VSCROLLCLIPBOARD() afx_msg void OnVScrollClipboard(CWnd*,UINT,UINT);
ON_WM_WINDOWPOSCHANGED() afx_msg void OnWindowPosChanged(WINDOWPOS FAR *);
ON_WM_WINDOWPOSCHANGING() afx_msg void OnWindowPosChanging(WINDOWPOS FAR *);
ON_WM_WININICHANGE() afx_msg void OnWinIniChange(LPSTR);
用户自定义消息代码
映射入口 函数原型
ON_MESSSAGE(<message>,<FUN> ) afx_msg LONG FUN(UINT,LONG);
ON_REGISTERED_MESSAGE(<nMessageVariable>,<FUN> ) afx_msg LONG FUN(UINT,LONG);
注意:“<>”中的内容为自定义内容。
转自(http://blog.chinaunix.net/uid-9563036-id-352154.html

posted @ 2013-01-16 03:01  _**  阅读(913)  评论(0编辑  收藏  举报