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

📄 stpasswordmanager.h

📁 WinCE开发技巧与实例的配套源码(chapter2)
💻 H
字号:
/////////////////////////////////////////////////////////////////////////////
// File name:      STPasswordManager.h
// Author:         Vassili Philippov (vasja@spbteam.com)
// Created:        30 August 2001
// Last changed:   30 August 2001
// Version:        1.0
// Description:    Manager class for working with Pocket PC password settings.

#if !defined(AFX_PASSWORDMANAGER_H__932531AA_6D81_485C_A1C8_3B729EA17F75__INCLUDED_)
#define AFX_PASSWORDMANAGER_H__932531AA_6D81_485C_A1C8_3B729EA17F75__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


/////////////////////////////////////////////////////////////////////////////
// Signature of password related functions from code coredll.dll

typedef BOOL SetPasswordProc(LPWSTR lpszOldpassword, LPWSTR lspzNewPassword);
typedef BOOL SetPasswordActiveProc(BOOL bActive, LPWSTR lpszPassword);


/////////////////////////////////////////////////////////////////////////////
// CSTPasswordManager - manager for working with Pocket PC password settings

class CSTPasswordManager  
{
public:
	// Creates password manager. This constructor loads coredll.dll 
	// library and gets password related procedures.
	CSTPasswordManager();

	// Frees coredll.dll library.
	virtual ~CSTPasswordManager();

	// Checks if the given password is a correct system password. Returns
	// TRUE is the given password is correct otherwise returns FALSE
	BOOL CheckPassword(const CString &strPassword);

	// Changes system password. strOldPassword should be a valid current
	// password. Returns TRUE if the password was changed otherwise 
	// returns FALSE.
	BOOL SetPassword(const CString &strOldPassword, const CString &strNewPassword);

	// Changes current password "active flag". This flag shows whether the 
	// password should be asked during start up. strCurrentPassword should 
	// be a valid current password. Returns TRUE if the "active flag" was set
	// otherwise returns FALSE.
  	BOOL SetPasswordActive(const CString &strCurrentPassword, BOOL bActive);

	// Changes system password and password "active flag". strOldPassword 
	// should be a valid current password. Returns TRUE if the password 
	// and "active flag" were changed otherwise returns FALSE.
	BOOL SetPasswordAndActive(const CString &strOldPassword, const CString &strNewPassword, BOOL bActive);

	// Returns if the "active flag". Returns TRUE is current system 
	// password is active
	BOOL GetPasswordActive();

protected:
	HMODULE m_hModule;
	SetPasswordProc *m_procSetPassword;
	SetPasswordActiveProc *m_procSetPasswordActive;
};

#endif // !defined(AFX_PASSWORDMANAGER_H__932531AA_6D81_485C_A1C8_3B729EA17F75__INCLUDED_)

⌨️ 快捷键说明

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