Solved

Assigning custom size icons to CStatic controls

Posted on 1997-08-14
5
332 Views
Last Modified: 2013-11-19
I want to have the custom size icons I've created assigned to a CStatic control, but for some reason the only thing it wants to display is the 32x32 icon image rather than my 40x45 icon image.  Is there a way to set the CStatic control so it displays the one I want.  Source examples, please.

Thanks in advance,
    Dave
0
Comment
Question by:David Gray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:David Gray
ID: 1303801
Another icon size I want to use is 550x30.  How can I set this?

Dave
0
 

Accepted Solution

by:
syjwg earned 50 total points
ID: 1303802
The problem is that LoadIcon() etc. always returns a HICON to
a standard 32x32 icon. But...
Go to www.microsoft.com and use the search engine. Look for
"ReadIconFromICOFile" (there will be 3 records found). In the
file ICONS.C you will find the complete answer how to get a
real HICON from any icon file. When this is done you just have
to override CStatus::OnPaint (if you want a CStatic to
to the job?!) and draw it your self with DrawIcon().
0
 

Expert Comment

by:syjwg
ID: 1303803
continuing...
Because I don't believe SetIcon() works, but you can always try.
0
 

Author Comment

by:David Gray
ID: 1303804
I have tried for the past four days to get onto the MSDN site, and I haven't been able to get the files you're suggesting I look at.  I'm not a registered member the MSDN site, but I have tried countless times to register but the server is always to busy to allow me to register.  I would really appreciate it if you could e-mail these three files to me, as I can't seem to get them.

I really appreciate it,
    Dave
    jedimstr@esus.cs.montana.edu
0
 

Author Comment

by:David Gray
ID: 1303805
I got the articles from another site.  Thanks for the help.

Dave
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 121
countEvens challenge 2 117
Trying to run powershell  in a batch file. How do I do this? 8 123
Problem to App 4 145
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question