在编写对话框程序时,希望能在按钮控件里显示一个小插图,如图所示
最初使用的方法是使用 BM_SETIMAGE 消息,但却不能达到满意的效果,在网上查了一通资料,最后终于实现了,现在把实现的方法记下来。
首先来到MSDN上,查得如下资料
BM_SETIMAGE message
Associates a new image (icon or bitmap) with the button.
Parameters
-
wParam
-
The type of image to associate with the button. This parameter can be one of the following values:
- IMAGE_BITMAP
- IMAGE_ICON
lParam
-
A handle (HICON or HBITMAP) to the image to assoc