⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 visualkb.h

📁 MFC Widnows程序设计Codepart1 书挺好的
💻 H
字号:
#define MAX_STRINGS 12

class CMyApp : public CWinApp
{
public:
    virtual BOOL InitInstance ();
};

class CMainWindow : public CWnd
{
protected:
    int m_cxChar;			// Average character width
    int m_cyChar;			// Character height
    int m_cyLine;			// Vertical line spacing in message box
    int m_nTextPos;			// Index of current character in text box
    int m_nTabStops[7];			// Tab stop locations for tabbed output
    int m_nTextLimit;			// Maximum width of text in text box
    int m_nMsgPos;			// Current position in m_strMessages array
    
    HCURSOR m_hCursorArrow;		// Handle of arrow cursor
    HCURSOR m_hCursorIBeam;		// Handle of I-beam cursor

    CPoint m_ptTextOrigin;              // Origin for drawing input text
    CPoint m_ptHeaderOrigin;            // Origin for drawing header text
    CPoint m_ptUpperMsgOrigin;	        // Origin of first line in message box
    CPoint m_ptLowerMsgOrigin;	        // Origin of last line in message box
    CPoint m_ptCaretPos;		// Current caret position

    CRect m_rcTextBox;			// Coordinates of text box
    CRect m_rcTextBoxBorder;	        // Coordinates of text box border
    CRect m_rcMsgBoxBorder;		// Coordinates of message box border
    CRect m_rcScroll;			// Coordinates of scroll rectangle

    CString m_strInputText;             // Input text
    CString m_strMessages[MAX_STRINGS];	// Array of message strings

public:
    CMainWindow ();

protected:
    int GetNearestPos (CPoint point);
    void PositionCaret (CDC* pDC = NULL);
    void DrawInputText (CDC* pDC);
    void ShowMessage (LPCTSTR pszMessage, UINT nChar, UINT nRepCnt,
        UINT nFlags);
    void DrawMessageHeader (CDC* pDC);
    void DrawMessages (CDC* pDC);

protected:
    virtual void PostNcDestroy ();

    afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnPaint ();
    afx_msg void OnSetFocus (CWnd* pWnd);
    afx_msg void OnKillFocus (CWnd* pWnd);
    afx_msg BOOL OnSetCursor (CWnd* pWnd, UINT nHitTest, UINT message);
    afx_msg void OnLButtonDown (UINT nFlags, CPoint point);
    afx_msg void OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnSysKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnSysKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnChar (UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnSysChar (UINT nChar, UINT nRepCnt, UINT nFlags);

    DECLARE_MESSAGE_MAP ()
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -