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

📄 tipinfodlg.cpp

📁 非比寻常的超级记事本 1.日历控件的使用 2.托盘技术 3.开机后应用程序自动启动 4.非模态对话框的创建和关闭 5.Singleton类的使用 6.文件的读写 7.弹出式菜单的创建
💻 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 + -