【VC界面设计】漂亮对话框自绘
2011-11-03 11:38
423 查看
图片效果地址: http://links.imgup.cn/201111/3/12/81494_1320295494b4g9.jpeg
// 对话框非客户区自绘Dlg.h : header file // #if !defined(AFX_DLG_H__29895C86_9D01_4C17_B374_289E36621F88__INCLUDED_) #define AFX_DLG_H__29895C86_9D01_4C17_B374_289E36621F88__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 ///////////////////////////////////////////////////////////////////////////// // CMyDlg dialog class CMyDlg : public CDialog { // Construction public: void GetAreasOfRect(); CRect NCClientToScreen(CRect* lpRtSrc); void DrawNCButtons(CDC *pDC); BOOL InitInfo(); BOOL DrawBitmapInRect(CRect rt, CBitmap *cbmp, CDC *pDC); void DrawNC(CDC* pDC); LONG GetBitmapWidth(CString strBmpName); LONG GetBitmapHeight(CString strBmpName); BOOL LoadBitmapFromFile(CString strBmpName, CBitmap* cbmp); CMyDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CMyDlg) enum { IDD = IDD_MY_DIALOG }; // NOTE: the ClassWizard will add data members here //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMyDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual void PreSubclassWindow(); virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); //}}AFX_VIRTUAL // Implementation protected: int m_nCaptionHeight; //标题栏高度. CString m_strCaptionText; //标题栏 BOOL m_bNCActive; //窗口活动状态 BOOL m_bButtonMinOver; //最小化按钮,鼠标在上面 BOOL m_bButtonMaxOver; //最大化按钮,鼠标在上面 BOOL m_bButtonExitOver; //关闭按钮,鼠标在上面 CRect m_rtWnd; //整个窗体Rect. CRect m_rtTitleBar; //Title bar CRect m_rtClient; //客户区 CRect m_rtIcon; //图标. CRect m_rtCaption; //标题栏 CRect m_rtButtons; //最大,最小,关闭按钮. CRect m_rtButtonMin; //最小. CRect m_rtButtonMax; //最大. CRect m_rtButtonExit; //关闭. CRect m_rtBorderLeft; //边框左边. CRect m_rtBorderRight; //边框右边. CRect m_rtBorderBottom; //边框底边. CRect m_rtBorderBottom2; //边框底边. CBitmap m_bmpCaption; //标题栏 CBitmap m_bmpButtonMin; //最小. CBitmap m_bmpButtonMax; //最大. CBitmap m_bmpButtonExit; //关闭. CBitmap m_bmpButtons; //系统按钮. CBitmap m_bmpBorderLeft; //边框左边. CBitmap m_bmpBorderRight; //边框右边. CBitmap m_bmpBorderBottom; //边框底边. CBitmap m_bmpBorderBottom2; //边框底边. CBitmap m_bmpCaptionOver; //标题栏,鼠标在上边 CBitmap m_bmpButtonMinOver; //最小.鼠标在上边 CBitmap m_bmpButtonMaxOver; //最大.鼠标在上边 CBitmap m_bmpButtonMaxZoomed;//最大.最大化了 CBitmap m_bmpButtonExitOver;//关闭.鼠标在上边 COLORREF m_rgbBackGround; //背景颜色 COLORREF m_rgbFrontGroun; //前景颜色 CBrush m_brBackGround; //背景画刷 HICON m_hIcon; //系统图标 // Generated message map functions //{{AFX_MSG(CMyDlg) virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); afx_msg void OnNcPaint(); afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point); afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point); afx_msg BOOL OnNcActivate(BOOL bActive); afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); afx_msg void OnMove(int x, int y); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); afx_msg void OnDestroy(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DLG_H__29895C86_9D01_4C17_B374_289E36621F88__INCLUDED_)
相关文章推荐
- VC++开发垃圾文件清理软件之三:程序的界面设计与实现----对话框界面
- VC/Wince 实现仿Win8 Metro风格界面1——设计概述和自绘Button(附效果图)
- 【界面设计】对话框非客户区窗口自绘
- vc--基于mfc对话框的手柄遥控机器人界面设计(二)
- 自绘对话框-界面设计
- 界面设计-中英繁多国语言实现(VC++)
- VC学习笔记1对话框应用程序设计
- 34个漂亮的应用程序后台管理界面设计(系列三)
- 27个漂亮的移动端注册/登录界面设计作品
- 【远控编写01】客户端界面的设计和编写--对话框,列表控件的伸缩
- VC++ 当我在界面上使用classwizard时,会弹出 Parsing error对话框,提示:Parsing error:Expected ")" input lin
- VC界面编程,添加控件后可编译但不执行(即,不弹出对话框)
- VC++中对话框界面重绘1-概述
- 34个漂亮的应用程序后台管理界面设计(系列三)
- [开发日记]图片抽奖软件的原型设想及界面设计-打算用PowerPoint结合Vc++完美实现 (进展一)
- 【VC界面】CButton按钮类和GroupBox分组框的自绘
- 34个漂亮的应用程序后台管理界面设计(系列三)
- 【VC编程技巧】动态链接库☞1.6设计应用程序界面换肤
- VC关于对话框界面上按回车和ESC键退出问题的处理
- 用Hook解决在VC++与C++Builder方面界面设计的一些问题