Click here to Skip to main content
14,032,937 members
Click here to Skip to main content

Stats

1.1M views
31.2K downloads
844 bookmarked
Posted 20 Nov 2003
Licenced GPL3

KeePass Password Safe

, 2 Jan 2019
KeePass is a free, open source, light-weight and easy-to-use password manager.
Build
Docs
Ext
Icons_04_CB
Finals
Finals2
plock-blu.ico
plock-dis.ico
plock.ico
plockb.ico
key-blu.png
key-bw.png
key-grn.ico
key-grn.png
plock-blu.ico
plock-blu.png
plock-bw.png
plock-dis.ico
plock-grn.ico
plock-grn.png
plock.ico
plock.png
plockb.png
plockbw-r.png
plockbw.png
Untitled.ico
key-org.ico
keyhole-grn.ico
lockblue.ico
lockgreen.ico
lockred.ico
lockyellow.ico
plockb.ico
plockb2.ico
plockbw.ico
plockg.ico
plocko.ico
plockr.ico
plocky.ico
Icons_15_VA
KeePass_Round
KeePass_Round_1024.png
KeePass_Round_128.png
KeePass_Round_16.png
KeePass_Round_20.png
KeePass_Round_24.png
KeePass_Round_256.png
KeePass_Round_32.png
KeePass_Round_48.png
KeePass_Round_512.png
KeePass_Round_64.png
KeePass_Round_Keyhole
KeePass_Round_Keyhole_128.png
KeePass_Round_Keyhole_16.png
KeePass_Round_Keyhole_256.png
KeePass_Round_Keyhole_32.png
KeePass_Round_Keyhole_48.png
KeePass_Round_Keyhole_64.png
KeePass_Round_Locked
KeePass_Round_Locked_128.png
KeePass_Round_Locked_16.png
KeePass_Round_Locked_256.png
KeePass_Round_Locked_32.png
KeePass_Round_Locked_48.png
KeePass_Round_Locked_64.png
KeePass_Square_Blue
KeePass_Square_Blue_128.png
KeePass_Square_Blue_16.png
KeePass_Square_Blue_24.png
KeePass_Square_Blue_256.png
KeePass_Square_Blue_32.png
KeePass_Square_Blue_48.png
KeePass_Square_Blue_64.png
KeePass_Square_Blue_Locked
KeePass_Square_Blue_Locked_128.png
KeePass_Square_Blue_Locked_16.png
KeePass_Square_Blue_Locked_24.png
KeePass_Square_Blue_Locked_256.png
KeePass_Square_Blue_Locked_32.png
KeePass_Square_Blue_Locked_48.png
KeePass_Square_Blue_Locked_64.png
KeePass_Square_Yellow
KeePass_Square_Yellow_128.png
KeePass_Square_Yellow_16.png
KeePass_Square_Yellow_256.png
KeePass_Square_Yellow_32.png
KeePass_Square_Yellow_48.png
KeePass_Square_Yellow_64.png
Icons_Nuvola
KeePassMsi
KeePassMsi.vdproj
RegKDB.reg
RegUnRegKDB.reg
KeePassLibC
KeePassLibCpp
Crypto
SHA2
DataExchange
Details
IO
PasswordGenerator
SDK
Details
SysSpec_Windows
Util
KeePassAPI
KeePassLib.def
KeePassLib.vcproj
res
WinGUI
NewGUI
TaskbarListEx
TaskDialog
VistaMenu
Plugins
PwSafe.vcproj
res
autotype.bmp
cancel.bmp
clienticex.bmp
clock.bmp
disk.bmp
document.bmp
entry_ed.ico
file.bmp
help_sma.bmp
help_smp.bmp
iconpic.ico
infoicon.bmp
infoiconex.bmp
KeePass.png
key.ico
keyhole.ico
key_smal.bmp
language.bmp
locked.ico
lock_ovr.ico
MostPopularPasswords.bin
mouse_sm.bmp
ok.bmp
optionicex.bmp
options.ico
plugins.ico
PwSafe.ico
randomke.bmp
random_b.bmp
search.ico
tb_about.bmp
tb_adden.bmp
tb_copyp.bmp
tb_copyu.bmp
tb_defau.bmp
tb_delet.bmp
tb_edite.bmp
tb_find.bmp
tb_lock.bmp
tb_new.bmp
tb_open.bmp
tb_save.bmp
tb_save1.bmp
tb_saved.bmp
toolssma.bmp
unlocked.ico
winprops.bmp
world.ico
Util
CmdLine
SprEngine
KeePass.chm
KeePass.exe
Languages
Plugins
/*
  KeePass Password Safe - The Open-Source Password Manager
  Copyright (C) 2003-2019 Dominik Reichl <dominik.reichl@t-online.de>

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef ___PW_GENERATOR_EX_DLG_H___
#define ___PW_GENERATOR_EX_DLG_H___

#pragma once

#include <afxwin.h>
#include <afxcmn.h>

#include "../KeePassLibCpp/SysDefEx.h"
#include "../KeePassLibCpp/PasswordGenerator/PasswordGenerator.h"

#include "NewGUI/XPStyleButtonST.h"
#include "NewGUI/KCSideBannerWnd.h"
#include "NewGUI/SecureEditEx.h"
#include "NewGUI/QualityProgressCtrl.h"

#define STR_CUSTOM_PROFILE TRL("(Custom)")
#define STR_AUTO_PROFILE TRL("(Automatically generated passwords for new entries)")

#define PWGD_MAX_PASSWORD_LENGTH 30000

#define PWGD_MPL (((SI_REGSIZE * 3) / 4) - 4)
#define PWGD_MPVL (PWGD_MPL - 16)

#define PWGD_MAX_PROFILE_NAME_LENGTH ((PWGD_MPVL / 4) / 2)
#define PWGD_MAX_PROFILE_CHARSET_LENGTH ((PWGD_MPVL / 2) / 2)
#define PWGD_MAX_PROFILE_PATTERN_LENGTH ((PWGD_MPVL / 4) / 2)

class CPwGeneratorExDlg : public CDialog
{
	DECLARE_DYNAMIC(CPwGeneratorExDlg)

private:
	void CleanUp();

	void UpdateDialogDataEx(BOOL bDialogToInternal, PW_GEN_SETTINGS_EX* pSettings);
	void EnableControlsEx(BOOL bSelectCustom);
	void ShowGenProfile(CString strProfileName);

	void RecreateProfilesList();

	void LoadGenProfiles();
	void SaveGenProfiles();
	PW_GEN_SETTINGS_EX* FindGenProfile(CString strProfileName);

	CString GetCurrentGenProfile();

	CKCSideBannerWnd m_banner;

	// CFont m_fStyle;
	// CFont m_fSymbol;
	// CFont m_fBold;
	COLORREF m_clrControlText;
	CToolTipCtrl m_tipSecClear;
	HWND m_hPrevParent;

	DWORD m_dwRequestedPasswords;

	std::vector<PW_GEN_SETTINGS_EX> m_vProfiles;
	PW_GEN_SETTINGS_EX m_pgsLast;

	LPTSTR m_lpPassword;

	BOOL m_bBlockUIUpdate;
	BOOL m_bShowInTaskbar;

	PW_GEN_SETTINGS_EX m_pgsAdvanced;

public:
	CPwGeneratorExDlg(CWnd* pParent = NULL);
	virtual ~CPwGeneratorExDlg();

	void InitEx(DWORD dwRequestedPasswords, BOOL bInitialHidePw,
		BOOL bForceInTaskbar);

	LPTSTR GetGeneratedPassword() const;

	enum { IDD = IDD_PW_GENERATOR_EX_DLG };

	virtual BOOL PreTranslateMessage(MSG* pMsg);

protected:
	virtual void DoDataExchange(CDataExchange* pDX);
	virtual BOOL OnInitDialog();

	DECLARE_MESSAGE_MAP()

public:
	afx_msg void OnCancel();
	afx_msg void OnOK();
	CComboBox m_cmbProfile;
	CXPStyleButtonST m_btnProfileCreate;
	CXPStyleButtonST m_btnProfileDelete;
	DWORD m_dwPasswordLength;
	BOOL m_bCollectEntropy;
	BOOL m_bCsUpperCase;
	BOOL m_bCsLowerCase;
	BOOL m_bCsNumeric;
	BOOL m_bCsMinus;
	BOOL m_bCsUnderline;
	BOOL m_bCsSpace;
	BOOL m_bCsSpecial;
	BOOL m_bCsBrackets;
	BOOL m_bCsHighAnsi;
	CButton m_cbUpperCase;
	CButton m_cbLowerCase;
	CButton m_cbNumeric;
	CButton m_cbMinus;
	CButton m_cbUnderline;
	CButton m_cbSpace;
	CButton m_cbSpecial;
	CButton m_cbBrackets;
	CButton m_cbHighAnsi;
	CString m_strCustomCharSet;
	CString m_strPattern;
	CXPStyleButtonST m_btnOK;
	CXPStyleButtonST m_btnCancel;
	CStatic m_stcCustomCharSet;
	CEdit m_tbCustomCharSet;
	CEdit m_tbPattern;
	afx_msg void OnRadioCharsetBased();
	afx_msg void OnRadioPatternBased();
	afx_msg void OnBnClickedBtnHelp();
	CXPStyleButtonST m_btnHelp;
	afx_msg void OnCbnSelChangeComboProfiles();
	afx_msg void OnBnClickedBtnProfileCreate();
	afx_msg void OnBnClickedBtnProfileDelete();
	CButton m_rbCharSetBased;
	CButton m_rbPatternBased;
	CButton m_cbCollectEntropy;
	afx_msg void OnBnClickedGenerateBtn();
	CSecureEditEx m_cEditPw;
	CXPStyleButtonST m_btnHidePw;
	CSpinButtonCtrl m_spinNumChars;
	afx_msg void OnCheckHidePw();
	CXPStyleButtonST m_btnGenerate;
	CQualityProgressCtrl m_cPassQuality;
	afx_msg void OnDeltaPosSpinLength(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnEnChangeEditPw();
	BOOL m_bHidePw;
	CStatic m_stcLength;
	CEdit m_tbLength;
	afx_msg void OnEnChangeEditLength();
	afx_msg void OnEnChangeEditCustomCharSet();
	afx_msg void OnEnChangeEditPattern();
	afx_msg void OnBnClickedCheckCsUppercase();
	afx_msg void OnBnClickedCheckCsLowercase();
	afx_msg void OnBnClickedCheckCsNumeric();
	afx_msg void OnBnClickedCheckCsMinus();
	afx_msg void OnBnClickedCheckCsUnderline();
	afx_msg void OnBnClickedCheckCsSpace();
	afx_msg void OnBnClickedCheckCsSpecial();
	afx_msg void OnBnClickedCheckCsBrackets();
	afx_msg void OnBnClickedCheckCsHighansi();
	afx_msg void OnBnClickedCheckCollectEntropy();
	CButton m_cbPatternPermute;
	BOOL m_bPatternPermute;
	afx_msg void OnBnClickedAdvanced();
	CXPStyleButtonST m_btnAdvanced;
	afx_msg void OnBnClickedPatternPermute();
};

#endif // ___PW_GENERATOR_EX_DLG_H___

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Dominik Reichl
Software Developer
Unknown
Dominik started programming in Omikron Basic, a programming language for the good old Atari ST. After this, there was some short period of QBasic programming on the PC, but soon he began learning C++, which is his favorite language up to now.

Today, his programming experience includes C / C++ / [Visual] C++ [MFC], C#/.NET, Java, JavaScript, PHP and HTML and the basics of pure assembler.

He is interested in almost everything that has to do with computing; his special interests are security, cryptography and data compression.

You can find his latest freeware, open source projects and articles on his website: https://www.dominik-reichl.de/.

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01 | 2.8.190423.1 | Last Updated 2 Jan 2019
Article Copyright 2003 by Dominik Reichl
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid