?
Solved

WM_SETICON

Posted on 2003-03-04
10
Medium Priority
?
1,480 Views
Last Modified: 2008-01-09
Hi,
I have this call in my app :


SendMessage(hwnd, WM_SETICON,WPARAM (ICON_SMALL), (LPARAM)LoadImage(0, "c:\\myfile.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE));

But my compiler says
Fehler:  WM_seticon.cpp(16,52):Undefined symbol 'ICON_SMALL'

I have included windows.h so wheres the problem?
0
Comment
Question by:Scotchman
[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
  • 4
  • 4
10 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 8070174
You possibly don't have latest SDK headers. Use these values:

#define ICON_SMALL          0
#define ICON_BIG            1

0
 

Author Comment

by:Scotchman
ID: 8070204
you were right, but nothing happens???
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 8070221
LPARAM should be HICON. I think you need IMAGE_ICON parameter of LoadImage.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Scotchman
ID: 8070286
wht do you mean with IMAGE ICON Parameter of LoadImage?
Can you give me an example please?
0
 

Author Comment

by:Scotchman
ID: 8070301
oh,sorry now I know what you meen...
I tried it with the IMAGE_ICON parameter, but still nothing happens.....
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 80 total points
ID: 8070306
First create valid icon handle:

HICON hIcon = LoadImage(...);

Be sure that icon is loaded. After this send WM_SETICON message.
0
 

Author Comment

by:Scotchman
ID: 8070307
Its changing now, but as soon as I minimize it or change the focus away and back to the window the icon is the old one again!?
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 8070410
Maybe to do it persistent you need to set this icon when window created (see RegisterClass, WNDCLASS).
0
 
LVL 11

Expert Comment

by:bcladd
ID: 9888162
No comment has been added lately, so it's time to clean up this TA. I will
leave a recommendation in the Cleanup topic area that this question is:

Answered: Points to AlexFM: Grade A

Please leave any comments here within the next seven days.

Experts: Silence means you don't care. Grading recommendations are made in light
of the posted grading guidlines (http://www.experts-exchange.com/help.jsp#hi73).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

-bcl (bcladd)
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: 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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

801 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