📄 puptext.h
字号:
//
#pragma once
//////////////////
// Get NONCLIENTMETRICS info: ctor calls SystemParametersInfo.
//
class CNonClientMetrics : public NONCLIENTMETRICS {
public:
CNonClientMetrics() {
cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,0,this,0);
}
};
//////////////////
// Popup text window, like tooltip.
// Can be right or left justified relative to creation point.
//
class CPopupText : public CWnd {
public:
CSize m_szMargins; // extra space around text: change if you like
CPopupText();
virtual ~CPopupText();
BOOL Create(CPoint pt, CWnd* pParentWnd, UINT nStyle=0, UINT nID=0);
void ShowDelayed(UINT msec);
void Cancel();
protected:
UINT m_nStyle; // style (see below)
virtual void PostNcDestroy();
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
void DrawText(CDC& dc, LPCTSTR lpText, CRect& rc, UINT flags);
afx_msg UINT OnNcHitTest(CPoint pt);
afx_msg void OnPaint();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg LRESULT OnSetText(WPARAM wp, LPARAM lp);
DECLARE_DYNAMIC(CPopupText);
DECLARE_MESSAGE_MAP();
};
#define PTS_JUSTIFYLEFT 0x0000
#define PTS_JUSTIFYRIGHT 0x0001
#define PTS_TRANSPARENT 0x0002
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -