Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Exile 1.8 - The Password Manager

, 6 Mar 2005
Yet another password manager.
exile_18_setup.zip
exile_exe.zip
exile_exe_staticmfc.zip
exile_src.zip
exile
Exile
Exile.exe.manifest
exile.dep
exile.dsp
exile.dsw
res
aboveimportant.ico
advanced.bmp
belowcritical.ico
belowinsignificant.ico
belownormal.ico
changeicon.bmp
cold.ico
collapsed.ico
critical.ico
editcategory.bmp
editelement.bmp
enterpassword.bmp
error.ico
exile.ico
expanded.ico
exporttoxml.bmp
find.ico
found.ico
important.ico
insertcategory.bmp
insertelement.bmp
insignificant.ico
md5hashgenerator.bmp
new.bmp
normal.ico
options.bmp
passwordgenerator.bmp
rsasecurity.bmp
rsasecurity.ico
search.cur
storageproperties.bmp
switch.bmp
unimportant.ico
veryimportant.ico
vssver.scc
Icons
res
icon1.ico
icon10.ico
icon11.ico
icon12.ico
icon13.ico
icon14.ico
icon15.ico
icon16.ico
icon17.ico
icon18.ico
icon19.ico
icon2.ico
icon20.ico
icon21.ico
icon22.ico
icon23.ico
icon24.ico
icon25.ico
icon26.ico
icon27.ico
icon28.ico
icon3.ico
icon4.ico
icon5.ico
icon6.ico
icon7.ico
icon8.ico
icon9.ico
md5
md5.dep
md5.dsp
mdx
pwsinfo
passwordstorageshellext.rgs
pwsinfo.def
pwsinfo.dep
pwsinfo.dsp
pwsinfo.dsw
PwsInfo.tlb
pwsinfops.def
pwsinfops.mk
rc5
rc5.dep
rc5.dsp
xml
exile_src_vs2003.zip
Exile.dep
Exile.dsp
Exile.dsw
Exile.suo
msxml3.tlh
msxml3.tli
res
AboveImportant.ico
Advanced.bmp
BelowCritical.ico
BelowInsignificant.ico
BelowNormal.ico
ChangeIcon.bmp
Cold.ico
Critical.ico
EditCategory.bmp
EditElement.bmp
EnterPassword.bmp
Error.ico
Exile.ico
ExportToXML.bmp
Find.ico
Found.ico
Icon1.ico
Icon10.ico
Icon11.ico
Icon12.ico
Icon13.ico
Icon14.ico
icon15.ico
Icon16.ico
Icon17.ico
Icon18.ico
Icon19.ico
Icon2.ico
Icon20.ico
Icon21.ico
Icon22.ico
Icon23.ico
Icon24.ico
Icon25.ico
Icon26.ico
Icon27.ico
Icon28.ico
Icon3.ico
Icon4.ico
Icon5.ico
Icon6.ico
Icon7.ico
Icon8.ico
Icon9.ico
Important.ico
InsertCategory.bmp
InsertElement.bmp
Insignificant.ico
MD5HashGenerator.bmp
New.bmp
Normal.ico
Options.bmp
PasswordGenerator.bmp
RSASecurity.bmp
rsasecurity.ico
Search.cur
StorageProperties.bmp
Switch.bmp
Unimportant.ico
VeryImportant.ico
vssver.scc
MD5
MD5.dep
MD5.dsp
PwsInfo
PasswordStorageShellExt.rgs
PwsInfo.def
PwsInfo.dep
PwsInfo.dsp
PwsInfo.dsw
PwsInfo.tlb
PwsInfops.def
PwsInfops.mk
RC5
RC5.dep
RC5.dsp
#if !defined(AFX_PROPERTYGRID_H__6072C617_4253_4B1E_8492_96177CB31D64__INCLUDED_)
#define AFX_PROPERTYGRID_H__6072C617_4253_4B1E_8492_96177CB31D64__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "items.h"
#include "notifications.h"

#import <msxml3.dll>

// PropertyGrid.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CPropertyGrid window

// In-place controls ID
const UINT IDC_PROPERTYGRID_EDIT = 1;
const UINT IDC_PROPERTYGRID_DATETIME = 2;
const UINT IDC_PROPERTYGRID_COMBOBOX = 3;
const UINT IDC_PROPERTYGRID_HOTKEY = 4;

// UI stuff
const UINT BORDER_WIDTH = 16;

const UINT CATEGORY_FOCUS_RECT_LEFT_INDENT = 3;
const UINT CATEGORY_FOCUS_RECT_RIGHT_INDENT = 3;
const UINT CATEGORY_FOCUS_RECT_TOP_SPACING = 2;
const UINT CATEGORY_FOCUS_RECT_BOTTOM_SPACING = 2;

const UINT CATEGORY_TEXT_LEFT_INDENT = 20;
const UINT CATEGORY_TEXT_TOP_INDENT = 2;

const UINT ELEMENT_TEXT_LEFT_INDENT = 20;
const UINT ELEMENT_TEXT_TOP_INDENT = 2;

const UINT VALUE_TEXT_LEFT_INDENT = 5;
const UINT VALUE_TEXT_TOP_INDENT = 2;

const UINT COMBOBOX_DROPDOWN = 80;

class CPropertyGrid : public CListCtrl
{
// Construction
public:
	CPropertyGrid();
	BOOL LoadPropertyGridContents(MSXML2::IXMLDOMElementPtr pXML); // Must have propertyGrid as a root element
	BOOL LoadPropertyGridTheme(MSXML2::IXMLDOMElementPtr pXML); // Must have propertyGridTheme as a root element
	BOOL AcceptEdit();
	BOOL CancelEdit();

	void SetNotificationReciever(IPropertyGridNotification *pNotificationReciever) { m_pNotificationReciever = pNotificationReciever; }

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPropertyGrid)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);

// Implementation
public:
	BOOL SetEditBoxLong(long lID, long lValue);
	long GetEditBoxLong(long lID);
	BOOL SetHotKey(long lID, WORD wHotKey);
	WORD GetHotKey(long lID);
	BOOL SetElementValue(long lID, const CString& strValue);
	CString GetElementValue(long lID);
	BOOL SetComboBoxValue(long lID, long lValue);
	long GetComboBoxItemData(long lID);
	virtual ~CPropertyGrid();

	// Generated message map functions
protected:
	//{{AFX_MSG(CPropertyGrid)	
	afx_msg void OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnGetinfotip(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnReturn(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);	
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
private:
	CString FindComboBoxString(PropertyGrid::ELEMENT &elm, long lValue);
	void UninitializeGdiObjects();
	void InitializeGdiObjects();
	void LoadThemeElement(MSXML2::IXMLDOMNodePtr pNode);
	COLORREF LoadThemeColor(MSXML2::IXMLDOMNodePtr pNode);
	BYTE LoadThemeColorComponent(MSXML2::IXMLDOMNamedNodeMapPtr pMap, LPCTSTR pszAttribute);
	void DrawFocusRect(HDC hDC, const CRect &rcRect, const CString &strText);
	void InitComboBox(PropertyGrid::ELEMENT &elm);
	BOOL LoadComboBoxString(MSXML2::IXMLDOMNodePtr pNode, PropertyGrid::ELEMENT &elm);
	BOOL LoadComboBoxEntries(MSXML2::IXMLDOMNodeListPtr pNodes, PropertyGrid::ELEMENT &elm);
	BOOL LoadElement(MSXML2::IXMLDOMNodePtr pNode, PropertyGrid::ELEMENT &elm);
	void LoadElements(MSXML2::IXMLDOMNodeListPtr pNodes, PropertyGrid::CATEGORY &ctg);
	void LoadCategory(MSXML2::IXMLDOMNamedNodeMapPtr pMap, PropertyGrid::CATEGORY &ctg);
	void LoadCategory(MSXML2::IXMLDOMNodePtr pNode);
	void DrawElementGrid(HDC hDC, const CRect& rcRect);
	void DrawElementSection(HDC hDC, const CRect &rcRect, const CString& strText, const CString& strValue, BOOL bSelected, BOOL bChanged, BOOL bReadOnly);
	void DrawCategorySection(HDC hDC, const CRect& rcRect, const CString& strText, BOOL bSelected, BOOL bExpanded);
	CString CompactString(HDC hDC, const CString& rString, int cx);
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
	BOOL BeginEdit(PropertyGrid::LELEMENT::iterator lei, int nItem);		
	BOOL m_bSizing;
	BOOL m_bSize;
	BOOL Between(int nValue, int nSample, int nDelta);
	int GetItem(int nItem, PropertyGrid::VCATEGORY::iterator& vci, PropertyGrid::LELEMENT::iterator& lei); // returns 1 if lei valid, otherwise 0
	int GetExpandedCount();	

	CImageList m_imgList;	
	COLORREF m_crCategory;
    COLORREF m_crCategoryFont;
	COLORREF m_crCategoryTopBorder;
    COLORREF m_crSubcategory;
    COLORREF m_crSubcategoryFont;
    COLORREF m_crElement;
    COLORREF m_crElementFont;
	COLORREF m_crElementSelected;
	COLORREF m_crElementSelectedFont;	

	HBRUSH m_brCategory;
    HBRUSH m_brSubcategory;
    HBRUSH m_brElement;

	HPEN m_pnDot;
	HPEN m_pnLines;

	HFONT m_hNormal;
	HFONT m_hBold;

	HCURSOR m_hSize;
	HCURSOR m_hArrow;

	CEdit m_ctrlEdit;
	CDateTimeCtrl m_ctrlDateTime;
	CComboBox m_ctrlCombo;
	CHotKeyCtrl m_ctrlHotKey;

	PropertyGrid::VCATEGORY m_vCategories;
	PropertyGrid::EDITEDITEM m_eiItem;

	CRect m_rcClient;
	int m_nNameColumn, m_nValueColumn;

	IPropertyGridNotification *m_pNotificationReciever;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PROPERTYGRID_H__6072C617_4253_4B1E_8492_96177CB31D64__INCLUDED_)

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

AntonGogolev
Web Developer
Russian Federation Russian Federation
I'll think about it later on...

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 7 Mar 2005
Article Copyright 2004 by AntonGogolev
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid