?? afxwin.h
字號:
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1998 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#ifndef __AFXWIN_H__
#ifndef RC_INVOKED
#define __AFXWIN_H__
/////////////////////////////////////////////////////////////////////////////
// Make sure 'afx.h' is included first
#ifndef __AFX_H__
#include <afx.h>
#endif
// Note: WINDOWS.H already included from AFXV_W32.H
#ifndef _INC_SHELLAPI
#include <shellapi.h>
#endif
#ifndef __AFXRES_H__
#include <afxres.h> // standard resource IDs
#endif
#ifndef __AFXCOLL_H__
#include <afxcoll.h> // standard collections
#endif
#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, off)
#endif
#ifndef _AFX_FULLTYPEINFO
#pragma component(mintypeinfo, on)
#endif
#ifndef _AFX_NOFORCE_LIBS
#pragma comment(lib, "uuid.lib")
#endif
#ifdef _INC_WINDOWSX
// The following names from WINDOWSX.H collide with names in this header
#undef SubclassWindow
#undef CopyRgn
#endif
#ifdef _AFX_PACKING
#pragma pack(push, _AFX_PACKING)
#endif
/////////////////////////////////////////////////////////////////////////////
// Classes declared in this file
class CSize;
class CPoint;
class CRect;
//CObject
//CException
//CSimpleException
class CResourceException;// Win resource failure exception
class CUserException; // Message Box alert and stop operation
class CGdiObject; // CDC drawing tool
class CPen; // a pen / HPEN wrapper
class CBrush; // a brush / HBRUSH wrapper
class CFont; // a font / HFONT wrapper
class CBitmap; // a bitmap / HBITMAP wrapper
class CPalette; // a palette / HPALLETE wrapper
class CRgn; // a region / HRGN wrapper
class CDC; // a Display Context / HDC wrapper
class CClientDC; // CDC for client of window
class CWindowDC; // CDC for entire window
class CPaintDC; // embeddable BeginPaint struct helper
class CMenu; // a menu / HMENU wrapper
class CCmdTarget; // a target for user commands
class CWnd; // a window / HWND wrapper
class CDialog; // a dialog
// standard windows controls
class CStatic; // Static control
class CButton; // Button control
class CListBox; // ListBox control
class CCheckListBox;// special listbox with checks
class CComboBox; // ComboBox control
class CEdit; // Edit control
class CScrollBar; // ScrollBar control
// frame windows
class CFrameWnd; // standard SDI frame
class CMDIFrameWnd; // standard MDI frame
class CMDIChildWnd; // standard MDI child
class CMiniFrameWnd;// half-height caption frame wnd
// views on a document
class CView; // a view on a document
class CScrollView; // a scrolling view
class CWinThread; // thread base class
class CWinApp; // application base class
class CDocTemplate; // template for document creation
class CSingleDocTemplate;// SDI support
class CMultiDocTemplate; // MDI support
class CDocument; // main document abstraction
// Helper classes
class CCmdUI; // Menu/button enabling
class CDataExchange; // Data exchange and validation context
class CCommandLineInfo; // CommandLine parsing helper
class CDocManager; // CDocTemplate manager object
/////////////////////////////////////////////////////////////////////////////
// Type modifier for message handlers
#ifndef afx_msg
#define afx_msg // intentional placeholder
#endif
#undef AFX_DATA
#define AFX_DATA AFX_CORE_DATA
/////////////////////////////////////////////////////////////////////////////
// CSize - An extent, similar to Windows SIZE structure.
class CSize : public tagSIZE
{
public:
// Constructors
// construct an uninitialized size
CSize();
// create from two integers
CSize(int initCX, int initCY);
// create from another size
CSize(SIZE initSize);
// create from a point
CSize(POINT initPt);
// create from a DWORD: cx = LOWORD(dw) cy = HIWORD(dw)
CSize(DWORD dwSize);
// Operations
BOOL operator==(SIZE size) const;
BOOL operator!=(SIZE size) const;
void operator+=(SIZE size);
void operator-=(SIZE size);
// Operators returning CSize values
CSize operator+(SIZE size) const;
CSize operator-(SIZE size) const;
CSize operator-() const;
// Operators returning CPoint values
CPoint operator+(POINT point) const;
CPoint operator-(POINT point) const;
// Operators returning CRect values
CRect operator+(const RECT* lpRect) const;
CRect operator-(const RECT* lpRect) const;
};
/////////////////////////////////////////////////////////////////////////////
// CPoint - A 2-D point, similar to Windows POINT structure.
class CPoint : public tagPOINT
{
public:
// Constructors
// create an uninitialized point
CPoint();
// create from two integers
CPoint(int initX, int initY);
// create from another point
CPoint(POINT initPt);
// create from a size
CPoint(SIZE initSize);
// create from a dword: x = LOWORD(dw) y = HIWORD(dw)
CPoint(DWORD dwPoint);
// Operations
// translate the point
void Offset(int xOffset, int yOffset);
void Offset(POINT point);
void Offset(SIZE size);
BOOL operator==(POINT point) const;
BOOL operator!=(POINT point) const;
void operator+=(SIZE size);
void operator-=(SIZE size);
void operator+=(POINT point);
void operator-=(POINT point);
// Operators returning CPoint values
CPoint operator+(SIZE size) const;
CPoint operator-(SIZE size) const;
CPoint operator-() const;
CPoint operator+(POINT point) const;
// Operators returning CSize values
CSize operator-(POINT point) const;
// Operators returning CRect values
CRect operator+(const RECT* lpRect) const;
CRect operator-(const RECT* lpRect) const;
};
/////////////////////////////////////////////////////////////////////////////
// CRect - A 2-D rectangle, similar to Windows RECT structure.
typedef const RECT* LPCRECT; // pointer to read/only RECT
class CRect : public tagRECT
{
public:
// Constructors
// uninitialized rectangle
CRect();
// from left, top, right, and bottom
CRect(int l, int t, int r, int b);
// copy constructor
CRect(const RECT& srcRect);
// from a pointer to another rect
CRect(LPCRECT lpSrcRect);
// from a point and size
CRect(POINT point, SIZE size);
// from two points
CRect(POINT topLeft, POINT bottomRight);
// Attributes (in addition to RECT members)
// retrieves the width
int Width() const;
// returns the height
int Height() const;
// returns the size
CSize Size() const;
// reference to the top-left point
CPoint& TopLeft();
// reference to the bottom-right point
CPoint& BottomRight();
// const reference to the top-left point
const CPoint& TopLeft() const;
// const reference to the bottom-right point
const CPoint& BottomRight() const;
// the geometric center point of the rectangle
CPoint CenterPoint() const;
// swap the left and right
void SwapLeftRight();
static void SwapLeftRight(LPRECT lpRect);
// convert between CRect and LPRECT/LPCRECT (no need for &)
operator LPRECT();
operator LPCRECT() const;
// returns TRUE if rectangle has no area
BOOL IsRectEmpty() const;
// returns TRUE if rectangle is at (0,0) and has no area
BOOL IsRectNull() const;
// returns TRUE if point is within rectangle
BOOL PtInRect(POINT point) const;
// Operations
// set rectangle from left, top, right, and bottom
void SetRect(int x1, int y1, int x2, int y2);
void SetRect(POINT topLeft, POINT bottomRight);
// empty the rectangle
void SetRectEmpty();
// copy from another rectangle
void CopyRect(LPCRECT lpSrcRect);
// TRUE if exactly the same as another rectangle
BOOL EqualRect(LPCRECT lpRect) const;
// inflate rectangle's width and height without
// moving its top or left
void InflateRect(int x, int y);
void InflateRect(SIZE size);
void InflateRect(LPCRECT lpRect);
void InflateRect(int l, int t, int r, int b);
// deflate the rectangle's width and height without
// moving its top or left
void DeflateRect(int x, int y);
void DeflateRect(SIZE size);
void DeflateRect(LPCRECT lpRect);
void DeflateRect(int l, int t, int r, int b);
// translate the rectangle by moving its top and left
void OffsetRect(int x, int y);
void OffsetRect(SIZE size);
void OffsetRect(POINT point);
void NormalizeRect();
// set this rectangle to intersection of two others
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2);
// set this rectangle to bounding union of two others
BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2);
// set this rectangle to minimum of two others
BOOL SubtractRect(LPCRECT lpRectSrc1, LPCRECT lpRectSrc2);
// Additional Operations
void operator=(const RECT& srcRect);
BOOL operator==(const RECT& rect) const;
BOOL operator!=(const RECT& rect) const;
void operator+=(POINT point);
void operator+=(SIZE size);
void operator+=(LPCRECT lpRect);
void operator-=(POINT point);
void operator-=(SIZE size);
void operator-=(LPCRECT lpRect);
void operator&=(const RECT& rect);
void operator|=(const RECT& rect);
// Operators returning CRect values
CRect operator+(POINT point) const;
CRect operator-(POINT point) const;
CRect operator+(LPCRECT lpRect) const;
CRect operator+(SIZE size) const;
CRect operator-(SIZE size) const;
CRect operator-(LPCRECT lpRect) const;
CRect operator&(const RECT& rect2) const;
CRect operator|(const RECT& rect2) const;
CRect MulDiv(int nMultiplier, int nDivisor) const;
};
#ifdef _DEBUG
// Diagnostic Output
CDumpContext& AFXAPI operator<<(CDumpContext& dc, SIZE size);
CDumpContext& AFXAPI operator<<(CDumpContext& dc, POINT point);
CDumpContext& AFXAPI operator<<(CDumpContext& dc, const RECT& rect);
#endif //_DEBUG
// Serialization
CArchive& AFXAPI operator<<(CArchive& ar, SIZE size);
CArchive& AFXAPI operator<<(CArchive& ar, POINT point);
CArchive& AFXAPI operator<<(CArchive& ar, const RECT& rect);
CArchive& AFXAPI operator>>(CArchive& ar, SIZE& size);
CArchive& AFXAPI operator>>(CArchive& ar, POINT& point);
CArchive& AFXAPI operator>>(CArchive& ar, RECT& rect);
/////////////////////////////////////////////////////////////////////////////
// Standard exceptions
class CResourceException : public CSimpleException // resource failure
{
DECLARE_DYNAMIC(CResourceException)
public:
CResourceException();
// Implementation
public:
CResourceException(BOOL bAutoDelete);
CResourceException(BOOL bAutoDelete, UINT nResourceID);
virtual ~CResourceException();
};
class CUserException : public CSimpleException // general user visible alert
{
DECLARE_DYNAMIC(CUserException)
public:
CUserException();
// Implementation
public:
CUserException(BOOL bAutoDelete);
CUserException(BOOL bAutoDelete, UINT nResourceID);
virtual ~CUserException();
};
void AFXAPI AfxThrowResourceException();
void AFXAPI AfxThrowUserException();
/////////////////////////////////////////////////////////////////////////////
// CGdiObject abstract class for CDC SelectObject
class CGdiObject : public CObject
{
DECLARE_DYNCREATE(CGdiObject)
public:
// Attributes
HGDIOBJ m_hObject; // must be first data member
operator HGDIOBJ() const;
HGDIOBJ GetSafeHandle() const;
static CGdiObject* PASCAL FromHandle(HGDIOBJ hObject);
static void PASCAL DeleteTempMap();
BOOL Attach(HGDIOBJ hObject);
HGDIOBJ Detach();
// Constructors
CGdiObject(); // must Create a derived class object
BOOL DeleteObject();
// Operations
int GetObject(int nCount, LPVOID lpObject) const;
UINT GetObjectType() const;
BOOL CreateStockObject(int nIndex);
BOOL UnrealizeObject();
BOOL operator==(const CGdiObject& obj) const;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -