Click here to Skip to main content
15,885,278 members
Articles / Desktop Programming / MFC

CIconDialog - Icon Selection Dialog

Rate me:
Please Sign up or sign in to vote.
4.68/5 (5 votes)
3 Mar 2000 95K   1.3K   23  
A Freeware MFC dialog class to select an icon
Welcome to CIconDialog, A freeware MFC dialog class to select an icon. This is
based on the dialog that appears when you choose to change the icon for a 
shortcut in the Windows 95 / NT 4 shell. The actual appearance of the dialog is 
based on the new look dialog in IE4 PP2 which uses a larger list box to display
the icons. Have a look on my web site or run the supplied sample to see what it 
looks like.

Included is a simple dialog based application which shows how to use it. The 
class would be used in your application as follows:

  CIconDialog dlg(this);
  dlg.SetIcon(m_sFilename, m_nIconIndex);
  if (dlg.DoModal() == IDOK)
    dlg.GetIcon(m_sFilename, m_nIconIndex);

The variables m_sFilename and m_nIconIndex would be managed by your application.							   


To use CIconDialog in your project simply include icondlg.cpp, the 5 string 
resources and the dialog resource IDD_CHOOSE_ICON from the test application in 
your application. Then just #include "icondlg.h" in which ever class needs to 
use it.


Happy coding.



CONTACTING THE AUTHOR

PJ Naughter
Email: pjn@indigo.ie
Web: http://indigo.ie/~pjn
25th July 1997


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.


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions