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

CIconDialog - Icon Selection Dialog

, 3 Mar 2000
A Freeware MFC dialog class to select an icon.
/*
Module : ICONDLG.H
Purpose: Interface for an MFC class for an Icon Picker dialog similar to 
         the version found in Internet Explorer 4 PP2
Created: PJN / ICONDLG/1 / 25-07-1997
History: None

Copyright (c) 1997 by PJ Naughter.  
All rights reserved.

*/


////////////////////////////////// Macros ///////////////////////////
#ifndef __ICONDLG_H__
#define __ICONDLG_H__


/////////////////////////////////  Includes  //////////////////////////////////
#include "resource.h"



/////////////////////////////////  Classes ////////////////////////////////////
class CIconDialog : public CDialog
{
public:
	CIconDialog(CWnd* pParent = NULL);

  BOOL SetIcon(const CString& sFilename, int nIndex);
  void GetIcon(CString& sFilename, int& nIconIndex);

protected:
	//{{AFX_VIRTUAL(CIconDialog)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

	//{{AFX_DATA(CIconDialog)
	enum { IDD = IDD_CHOOSE_ICON };
	CListBox m_ctrlIconList;
	CString	m_sFilename;
	int		m_nIconIndex;
	//}}AFX_DATA

	//{{AFX_MSG(CIconDialog)
	afx_msg void OnBrowse();
	afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
	afx_msg void OnDestroy();
	virtual void OnOK();
	afx_msg void OnDblclkIconlist();
	virtual BOOL OnInitDialog();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

  void UpdateIconList();
};



#endif //__ICONDLG_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 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

Share

About the Author

PJ Naughter

United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 4 Mar 2000
Article Copyright 2000 by PJ Naughter
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid