Solved

The button with icon

Posted on 1997-06-30
1
348 Views
Last Modified: 2013-12-03
MS Visual C++ 4.0 help:
 Button Types and Styles:
. . . .
BS_BITMAP      Windows 95 only: Specifies that the button displays a bitmap.
. . . .
BS_ICON              Windows 95 only: Specifies that the button displays an icon.
. . . .

But I couldn't find any information how to assign the bitmap (or icon)
to the button - that is the question. Please, don't use words like 'MFC'
or 'Owner-drawing' in your answer.
0
Comment
Question by:shvetsov
1 Comment
 
LVL 4

Accepted Solution

by:
md041797 earned 50 total points
ID: 1399632
Use BM_SETIMAGE:

                 BM_SETIMAGE
                 wParam = (WPARAM) fImageType; // image-type flag
                 lParam = (LPARAM) (HANDLE) hImage; // handle of the image
                   

                 Parameters

                 fImageType

                 Value of wParam. Specifies the type of image to associate with the button. This
                 parameter can be one of the following values:
                 IMAGE_BITMAP IMAGE_ICON

                   

                 hImage

                 Value of lParam. Identifies the image to associate with the button.

                   

                 Return Values

                 The return value is the handle of the image previously associated with the button,
                 if any; otherwise, it is NULL.


Load the bitmap and get a HBITMAP to send with this message.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now