News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Bitmap button example with reusable code.

Started by hutch--, November 18, 2019, 09:56:20 PM

Previous topic - Next topic

hutch--

I went through some of my pre 2000 heirlooms and found this one which was not that hard to modernise, the virtue of using pure API code. It is a working example of a control that takes 2 bitmaps, an UP and a DOWN image. To reuse the code you need to copy 2 procedures, "BmpButton" and "ButnProc".

You create the control(s) with the following code as per the example.

        BmpButton hInstance,hWin,30,30,250,251,500
        BmpButton hInstance,hWin,30,100,252,253,501

You create two bitmaps of the same size for the UP and DOWN positions, tested on 16 colour and RGBA colour . Each button is located by its top  X & Y and the button size is determined by the bitmap size. The trailing argument is the button ID for WM_COMMAND processing.