|
-
Feb 4th, 2001, 06:00 AM
#1
Thread Starter
Junior Member
Hey to everyone,
I'm using CreateWindowEx to create a command button on my app. I did this before but I can't remember how the hell!! -> Can someone please tell me how to set an icon for my button?? It just stays blank after I add "BS_ICON" to dwStyles. I believe it has something to do with the SendMessage API but I can't remember what the damn message was, etc, etc... I want my icon to come from a picture box and not loaded from a file.
Thanks! ANY help is GREATLY appreciated!
-
Feb 4th, 2001, 06:58 AM
#2
Frenzied Member
Send the BM_SETIMAGE messge.
Info about the messaage
Code:
BM_SETIMAGE
An application sends a BM_SETIMAGE message to associate a new image (icon or bitmap) with the button.
BM_SETIMAGE
wParam = (WPARAM) fImageType; // image-type flag
lParam = (LPARAM) (HANDLE) hImage; // handle to 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. Handle to the image to associate with the button.
Return Values
The return value is a handle to the image previously associated with the button, if any; otherwise, it is NULL.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|