?
Solved

Assigning custom size icons to CStatic controls

Posted on 1997-08-14
5
Medium Priority
?
334 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 150 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

800 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