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

📄 modelessdlg.h

📁 实时监控
💻 H
字号:
#ifndef _MODELESS_DLG_H
#define _MODELESS_DLG_H

// T: 一般是CDialog
// U: 派生类
template<class T, class U>
class modelessdlg: public T
{
public:
	typedef modelessdlg<T,U> baseclass;

	modelessdlg(UINT idd, CWnd* parent = NULL): T(idd, parent){}
	void init(CWnd* parent=NULL)
	{
		Create(U::IDD, parent) ;
	}
	virtual void show(CWnd* parent = NULL)
	{
		if (!IsWindow(m_hWnd))
			init(parent) ;
	
		if (::IsWindowVisible(m_hWnd))
			return ;
	
		CenterWindow() ;
		ShowWindow(SW_SHOW) ;
		UpdateWindow() ;
	}
	virtual void hide()
	{
		DestroyWindow() ;
	}
protected:
	virtual int DoModal(){return -1;}
	virtual void OnOK(){}
	virtual void OnCancel(){}
};

#endif	// _MODELESS_DLG_H

⌨️ 快捷键说明

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