[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

The button with icon

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
shvetsov
Asked:
shvetsov
1 Solution
 
md041797Commented:
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now