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

📄 cdialog.h

📁 可以实现对邮件的加密解密以及签名
💻 H
字号:
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: CDialog.h,v 1.3 2002/08/06 20:10:45 dallen Exp $
____________________________________________________________________________*/

#ifndef Included_CDialog_h	// [
#define Included_CDialog_h

#include "pgpClassesConfig.h"

#include <prsht.h>
#include "CWindow.h"

_PGP_BEGIN

// Class CDialog

class CDialog : public CWindow
{
private:
	enum
	{
		DialogMapSize	= 100, 
		IDDialogError	= 0x4242
	};

public:
	CDialog() { }
	CDialog(HWND hWnd) : CWindow(hWnd) { }
	~CDialog() { }

	virtual PGPUInt16	GetDialogId() const = 0;

	PGPBoolean	MapDialogRect(RECT& rect) const
	{
		return ::MapDialogRect(Handle(), &rect);
	}

	PGPUInt32	VertDLUToPixel(PGPUInt32 dlus) const
	{
		return (dlus * mBaseUnitY) / 8;
	}

	PGPUInt32	HorizDLUToPixel(PGPUInt32 dlus) const
	{
		return (dlus * mBaseUnitX) / 4;
	}

	PGPUInt32	VertPixelToDLU(PGPUInt32 pixels) const
	{
		return (pixels * 8) / mBaseUnitY;
	}

	PGPUInt32	HorizPixelToDLU(PGPUInt32 pixels) const
	{
		return (pixels * 4) / mBaseUnitX;
	}

	void	RectPixelToDLU(RECT& rect) const;
	void	RectDLUToPixel(RECT& rect) const;

	PGPInt32	CreateModal(HWND parent);
	void		CreateNonModal(HWND parent);
	void		DestroyDialog();

protected:
	void	CreateAsPropPage(PROPSHEETPAGE& psp, HPROPSHEETPAGE& pageHandle);

	void	EndModalDialog(PGPInt32 result = IDOK);
	void	EndModalDialog(CComboError error);
	void	EndNonModalDialog();

private:
	PGPBoolean	mIsModal;
	CComboError	mError;

	PGPUInt32	mBaseUnitX;
	PGPUInt32	mBaseUnitY;

	PGPUInt32	mPixelMarginControl;
	PGPUInt32	mPixelMarginDialog;

	// Class utility functions.

	void	CalcBaseUnits();
	void	HandleWindowError(CComboError error);

	// Dialog procedure functions.

	static BOOL CALLBACK	GlobalDialogProc(HWND hWnd, UINT uMsg, 
		WPARAM wParam, LPARAM lParam);

	static BOOL CALLBACK	PropPageStub(HWND hWnd, UINT uMsg, 
		WPARAM wParam, LPARAM lParam);

protected:
	// Dialog message handlers.
	virtual void	OnCancel();
	virtual void	OnOk();

	BOOL			OnCommand(PGPUInt16 notifyCode, PGPUInt16 itemId, 
		HWND ctrl);
	virtual BOOL	OnInitDialog(HWND focusCtrl);
};

_PGP_END

#endif	// ] Included_CDialog_h

⌨️ 快捷键说明

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