📄 tipinfodlg.cpp
字号:
// TipInfoDlg.cpp : implementation file
//
#include "stdafx.h"
#include "SuperNotepad.h"
#include "TipInfoDlg.h"
#include "MySingletonClass.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTipInfoDlg dialog
CTipInfoDlg::CTipInfoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTipInfoDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTipInfoDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTipInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTipInfoDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTipInfoDlg, CDialog)
//{{AFX_MSG_MAP(CTipInfoDlg)
ON_BN_CLICKED(IDC_BUTTON_CLOSE, OnButtonClose)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTipInfoDlg message handlers
// 初始化对话框
BOOL CTipInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// 设置提示信息
CMySingletonClass *pMyInstance = CMySingletonClass::GetInstance();
CString csTipInfo = pMyInstance->m_csTipContent;
GetDlgItem(IDC_STATIC_TIP_INFO)->SetWindowText(csTipInfo);
// 窗口总是处于最上面
HWND hWnd = GetSafeHwnd();
BOOL bAlwaysOnTop = TRUE;
::SetWindowPos( hWnd, (bAlwaysOnTop) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// 按下鼠标左键,移动没有标题栏的对话框
void CTipInfoDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
PostMessage( WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM( point.x, point.y));
CDialog::OnLButtonDown(nFlags, point);
}
// 关闭
void CTipInfoDlg::OnButtonClose()
{
// TODO: Add your control notification handler code here
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -