?? myprojectdlg.h
字號(hào):
/****************************************************************************************
author: tuwei
ecnu.cs.03.1
2006.3
e-mail:B03213157@student.ecnu.edu.cn
copyright:
this is free!!!
You can use it everywhere without my name!
reference:
this is a unbelievable progress!
Put the Dialog box template base class into DLL!
The first question is if there is no Dialog resource I can
pass the compiler.It will tell me that the IDD is not useable.
I discover the IDD is just a value which is passed to its
parent class and is given by classwizard.So I delete
it,but the compiler give me a error,because CDialog class's
construction function need this value.
I read the construction function carefully,I think I can build a
class as the CDialog,I ask the child class to give me the IDD and I
pass it to CDialg.So the way to solve the first question is made a
new construction function and add a UINT type value.
this is the new function.
e.g
"CMyProjectDlg(UINT IDD,CWnd* pParent = NULL);"
and pass the IDD to CDialog class's construction function!
e.g
"
CMyProjectDlg::CMyProjectDlg(UINT IDD,CWnd* pParent)
: CDialog(IDD, pParent)
{}
"
The second question is the HICON ,in the OnPaint function the system
draw it to the frame,I needn't is so I delete.
A piece of cake!!!
How to use:
1:Derive a Dialog class from CDialog .In fact,you needn't do that,
because the AppWizard will help you!So Your work is replace all
the "CDialog" into "CMyProjectDlg" .
at first,You have not too many parts need to replace,such as
"onPaint" and construction function!
2:go to classwizard!change the Dialog to a Window,then you will
have more message to choose!
3:choose WM_NCMOUSEMOVE an WM_NCLBUTTONDOWN
and edit them.
4:replace the two function,s "CDiaog" to "CMyProjectDlg".
5:enjoy!!!!!!!!!!!!!
*************************************************************************************/
#if !defined(AFX_MYPROJECTDLG_H__37976C45_C233_4BAB_9996_CE732397BF19__INCLUDED_)
#define AFX_MYPROJECTDLG_H__37976C45_C233_4BAB_9996_CE732397BF19__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "AdvanceFrameMenu.h"
class AFX_EXT_CLASS CMyProjectDlg : public CDialog
{
public:
CMyProjectDlg(UINT IDD,CWnd* pParent = NULL,bool flog=false);
public:
protected:
void DrawTitle(CDC *pDC,int nFlags=0);
void DrawCaptionBar(CDC *pDC,LPRECT rc,int nFlags=0);
void DrawCaptionEdge(CDC *pDC,LPRECT rc,int nFlags);
void SetButtonBoxRect(CRect *pMinSizeRect,CRect *pCloseBoxRect);
protected:
HICON m_hIcon;
CFont m_nTitleFont;
bool isChildDerive;
CAdvanceFrameMenu m_nMenu;
const int MINISIZEBOX_HEIGHT_OFFSET;
const int MINISIZEBOX_WIDTH_OFFSET;
const int MINISIZEBOX_HEIGHT;
const int MINISIZEBOX_WIDTH;
const int CLOSEBOX_HEIGHT_OFFSET;
const int CLOSEBOX_WIDTH_OFFSET;
const int CLOSEBOX_HEIGHT;
const int CLOSEBOX_WIDTH;
CRect m_rcGlobleRect;
public:
void DrawEdgeCorner(CDC *pDC,LPRECT rc);
//{{AFX_DATA(CMyProjectDlg)
//enum { IDD = IDD_MYPROJECT_DIALOG };
//}}AFX_DATA
//{{AFX_VIRTUAL(CMyProjectDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
protected:
void DrawMenuSides(CDC *pDC,LPRECT rc);
//{{AFX_MSG(CMyProjectDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
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 void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
#endif // !defined(AFX_MYPROJECTDLG_H__37976C45_C233_4BAB_9996_CE732397BF19__INCLUDED_)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -