I wish to subclass buttons such that they show an icon and text.
Is there an example available ?
A button with BS_OWNERDRAW style will be enough.
Samples here http://asmedit.massmind.org/
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.
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]
oh my fo! Masm32v1:
include L:\MASM32V1\PROGRAMS\AsmEdit\include\Windows.inc
include L:\MASM32V1\PROGRAMS\AsmEdit\include\DSPMACRO.asm
:red
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