csecurerichedit.h

来自「可以实现对邮件的加密解密以及签名」· C头文件 代码 · 共 90 行

H
90
字号
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: CSecureRichEdit.h,v 1.8 2002/10/31 23:45:37 wjb Exp $
____________________________________________________________________________*/

#ifndef Included_CSecureRichEdit_h	// [
#define Included_CSecureRichEdit_h

#include "pgpClassesConfig.h"
#include "pgpUtilities.h"

#include "CArray.h"
#include "CSecureString.h"
#include "CEdit.h"

_PGP_BEGIN

// Class CSecureRichEdit

class CSecureRichEdit : public CEdit
{
public:
	enum
	{
		// For private communication with the parent dialog.
		WM_SECUREEDIT_EVENT	= WM_USER + 12, 

		kContentsChangedEvent	= 0, 
		kSawCapsLockKeyEvent	= 1, 
		kSawReturnKeyEvent		= 2
	};

public:
	CSecureRichEdit();
	CSecureRichEdit(HWND hWnd);
	~CSecureRichEdit();

	const CSecureString&	Contents() const;
	PGPUInt32 ContentsLength() const;	// returns curent number is Unicode characters

	PGPBoolean	HidingTyping() const {return mHideTyping;}
	PGPUInt32	MaxSize() const {return mMaxSize;}

	void	ClearContents();
	void	SetContents(const CSecureString& newContents);

	PGPBoolean	SetHideTypingPref(PGPBoolean hideValue);
	PGPUInt32	SetMaxSizeContents(PGPUInt32 maxSize);
	
	void	Subclass(HWND hWnd,PGPContextRef context);

	void	InstallSecurityHooks();
	void	UninstallSecurityHooks();

	HWND REhwnd(){return mREhwnd;}
	PGPUInt32	SendParentEvent(PGPUInt32 event);
	PGPBoolean  mOldCapsWarning;
	PGPBoolean	mUnicodeOS;
	WNDPROC		mOrigProc;
	PGPBoolean	mDestroyed;
	PGPBoolean  mPumping;
	PGPBoolean	mCapsOnInit;
private:
	CSecureString			mContentsUTF8;

	void		*mSEP;
	HWND		mREhwnd;

	PGPBoolean	mHideTyping;
	PGPUInt32	mMaxSize;
	PGPContextRef mContext;

	HHOOK	mHhookCBT;
	HHOOK	mHhookGetMessage;
	HHOOK	mHhookKeyboard;
	HHOOK	mHhookMsgFilter;

	static LRESULT CALLBACK	SecurityHookProc(INT iCode, WPARAM wParam, 
		LPARAM lParam);

	static LRESULT CALLBACK	SecurityGetMessageHookProc(INT iCode, 
		WPARAM wParam, LPARAM lParam);
};

_PGP_END

#endif	// ] Included_CSecureRichEdit_h

⌨️ 快捷键说明

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