message与wparam和lparam之间如何转换?

nck7 2004-02-11 11:21:13
如题。
...全文
111 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
class CNewsWindow { public: CNewsWindow(void); ~CNewsWindow(void); public: HWND m_hWnd; public: // 设置皮肤(位图资源名称,标题栏文本颜色) BOOL SetSkin(LPCTSTR lpSkinBitmapName,COLORREF CaptionColor=0x000000); // 创建窗口 BOOL Create(LPCTSTR lpWindowName,int nWidth=250,int nHeight=180); BOOL Create(LPCTSTR lpClassName,LPCTSTR lpWindowName,int nWidth,int nHeight); // 设置新闻标题、内容、链接 BOOL SetNews(LPCTSTR lpNewsTitle,LPCTSTR lpNewsContent,LPCTSTR lpNewsURL); // 显示窗口 void Show(); // 设置为主窗口,主窗口销毁后会退出消息循环 void SetMainWindow(BOOL bMainWindow=TRUE); // 设置自动关闭,如果为真,点击链接后窗口自动关闭 void SetAutoClose(BOOL bAutoClose=TRUE); public: BOOL IsWindow(); BOOL DestroyWindow(); private: #define NCT_CLOSE 0 #define NCT_VIEW 1 #define NCT_TITLE 2 #define NCT_CONTENT 3 typedef struct tagNEWSCONTROL { CString strText; int nType; int x; int y; int nWidth; int nHeight; RECT Rect; }NEWSCONTROL, *LPNEWSCONTROL; private: LPNEWSCONTROL m_pControls; int m_nControlCount; private: HCURSOR m_hArrowCursor; HCURSOR m_hHandCursor; HCURSOR m_hCurCursor; HICON m_hAppSmallIcon; HDC m_hSkinDC; HDC m_hCacheDC; HBITMAP m_hSkinBitmap; HBITMAP m_hSkinOldBitmap; HBITMAP m_hCacheBitmap; HBITMAP m_hCacheOldBitmap; HFONT m_hFont; HFONT m_hBoldFont; COLORREF m_CaptionColor; int m_nHoverIndex; int m_nDownIndex; BOOL m_bMainWindow; BOOL m_bAutoClose; BOOL m_bTracking; CString m_strURL; private: BOOL DrawWindow(); BOOL DrawWindowEx(); void DrawButton(HDC hDC,LPNEWSCONTROL pControl); void DrawStatic(HDC hDC,LPNEWSCONTROL pControl); void DrawNineRect(HDC hdcDest,RECT DestRect,RECT SrcRect,RECT NineRect,UINT crTransparent=0xFF00FF); RECT CreateRect(LONG left,LONG top,LONG right,LONG bottom); void CreateControl(LPNEWSCONTROL pControl,int nType,int x,int y,int nWidth,int nHeight,CString strText=_T("")); int ControlFromPoint(POINT pt); int ControlFromPoint(LPARAM lParam); void SetCursor(HCURSOR hCursor); public: LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam); LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnEraseBkgnd(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnPaint(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnMouseMove(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnMouseHover(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnMouseLeave(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnLButtonDown(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnLButtonUp(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnControlClick(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnDestroy(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnSetCursor(UINT message, WPARAM wParam, LPARAM lParam); };

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧