News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ButtonEx and bitmaps

Started by msmith, January 15, 2006, 07:15:37 AM

Previous topic - Next topic

msmith

I've been playing with the ButtonEx control that I dounloaded from the custom contols section.

It is a very nice control, but my program blows up when I try to set a bitmap to the button.

I believe that is because I'm sending a bitmap handle while the control expects a resource ID.

I am using thBitmapFromMemory routine from Ernie Murphy to create the handle. Is there any way to
use ButtonEx with bitmaps without actually having a resource section?

gabor

Hello!


Do I understand you right?
You want to create a bitmap button.
You load a bitmap from a bmp file, not from resource section (not via the LoadBitmap function).
You want to assign this bitmap to the button.

Well, I searched the API help, but could not find any handle-resource ID conversion  :'(.
Is it not possible to use the bitmap handle directly with that ButtonEx? I mean isn't there a message that sets the bitmap of the button and accepts bitmap handles? I saw in the ButtonEx topic that there are specific messages for the button, so if there is no such message, it could be created...

Greets, Gábor

msmith

All of the normal uses of bitmaps that I know of such as static and button controls, etc. require the handle to a bitmap which has been created from either a resource, a file, or from memory.

The ButtonEx control appears to require a "raw" resource.

msmith

My suspicion was correct.

If I put the bitmap in the resource section and give the resource ID as args to ButtonEx, it works.

zcoder

The ButtonEx function should have been written
with an extra flag Param send to it to denote
resource or handle of bitmap, the control would then
be more flexible.


Zcoder....
Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names