The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: starzboy on May 14, 2009, 12:20:19 PM

Title: Subclass button, icon + text in button
Post by: starzboy on May 14, 2009, 12:20:19 PM
I wish to subclass buttons such that they show an icon and text.
Is there an example available ?
Title: Re: Subclass button, icon + text in button
Post by: ToutEnMasm on May 14, 2009, 01:33:27 PM

A button with BS_OWNERDRAW style will be enough.
Samples here http://asmedit.massmind.org/
Title: Re: Subclass button, icon + text in button
Post by: BATSoftware on May 21, 2009, 03:19:00 PM
BS_OWNERDRAW will partially work - it has ONE significant drawback - no BS_DEFPUSHBUTTON. If 100% push-button support is required the alternative is: BS_BITMAP.
Create a memory bitmap, draw icon/bitmap image then draw text to memory bitmap. Use BM_SETIMAGE to place bitmap on button. Though the amount of coding is significantly more (approx 200 lines of code), the result is quite effective. This method will allow the programmer to draw anything on the button, UNICODE text, shapes, multiple colors - basically, if one can draw it to a bitmap, you can place it on the button.
Title: Re: Subclass button, icon + text in button
Post by: PBrennick on May 28, 2009, 04:37:20 AM
Years ago, Ewayne Wagner wrote the attached utility that will generate code to create buttons using almost anything you can think of. It is a pretty kewl utility and I have never seen anything like it.

Paul


[attachment deleted by admin]
Title: Re: Subclass button, icon + text in button
Post by: UtillMasm on May 28, 2009, 04:50:07 AM
oh my fo! Masm32v1:
include  L:\MASM32V1\PROGRAMS\AsmEdit\include\Windows.inc
include  L:\MASM32V1\PROGRAMS\AsmEdit\include\DSPMACRO.asm

:red
Title: Re: Subclass button, icon + text in button
Post by: PBrennick on May 28, 2009, 06:07:13 AM
Is it too hard for you to change that to masm32 or GeneSys? Come on. He always carried all versions of masm32 and so that was his solution.

Paul