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

📄 uihandle.h

📁 蓝牙设备搜索与连接 RDSTerminal
💻 H
字号:
#pragma once
#include "global.h"

DLL_INTERNAL void DrawCurveByDataBuffer ( CDC *pDC, CRect &rcClient, COLORREF clr, BYTE *data, int size, int nCellSize=1, int nStepX=0 );
DLL_INTERNAL void DeleteInstance ( CWnd **ppWnd );
DLL_INTERNAL CSize GetWorkAreaSize ();
DLL_INTERNAL void HandleSpanClick(
		CWnd *pOwnerWnd,
		UINT nEditCtrlID,
		NMHDR* pNMHDR,
		LRESULT* pResult,
		int nMaxValue,
		int nMinValue,
		int nInterval=1);
DLL_INTERNAL BOOL LoadBitmapFromFile(CBitmap &bmp, LPCTSTR lpszBmpPath);
DLL_INTERNAL void DrawBitmap ( CBitmap &bmp, CDC *pDC, CRect &rc, BOOL bStretch );
DLL_INTERNAL void SetWaitCursor ();
DLL_INTERNAL void ResotreCursor ();

// 创建对话框实例模板函数
template<class T>
T* TGetInstance (
		T **pptDlg,						// 保存对话框指针的指针
		UINT nIDTemplate,				// 对话框资源 ID
		CWnd *pParentWnd=NULL,			// 父窗口句柄
		BOOL bRecreateWhenExist=FALSE,	// 对话框存在时是否重新创建,删除已经存在的
		BOOL bNotCreateWindow=FALSE,	// 不创建窗口,仅仅 New 一个对象
		BYTE nShowImmediately=1			// 是否立即显示对话框。0 - 不显示;1 - 显示并激活获取焦点;2 - 仅仅显示,不获取焦点
)
{
	if ( !pptDlg ) return NULL;
	if ( *pptDlg )
	{
		if ( bRecreateWhenExist )
		{
			::DeleteInstance ( (CWnd**)pptDlg );
		}
		else if ( ::IsWindow ( (*pptDlg)->m_hWnd ) )
		{
			ActiveWindowAndHoldFocus ( (*pptDlg)->m_hWnd );
			return (*pptDlg);
		}
	}
	
	if ( !(*pptDlg) )
	{
		*pptDlg = new T ( pParentWnd );
	}

	if ( !(*pptDlg) ) return NULL;
	if ( bNotCreateWindow ) return (*pptDlg);

	if ( !::IsWindow ( (*pptDlg)->GetSafeHwnd() ) )
	{
		if ( !(*pptDlg)->Create ( nIDTemplate, pParentWnd ) )
		{
			::DeleteInstance ( (CWnd**)pptDlg );
			return NULL;
		}
	}

	if ( nShowImmediately != 0 )
	{
		(*pptDlg)->ShowWindow ( SW_SHOW );
//		(*pptDlg)->SetForegroundWindow ();
		if ( nShowImmediately == 1 )
			ActiveWindowAndHoldFocus ( (*pptDlg)->m_hWnd );
	}

	ASSERT ( (*pptDlg) && ::IsWindow ( (*pptDlg)->GetSafeHwnd() ) );
	return (*pptDlg);
}

⌨️ 快捷键说明

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