TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Craig Morrison
date: 1995-01-08 06:51:58
subject: Bitmaps and buttons...

Craig writes Hello! to All:

  First a code snippet...later a question:

    if (ReadBitmap(habMain, pbd[j].btnBMPFile, &hbm))
    {
        memset(&btc, 0, sizeof(BTNCDATA));
        btc.cb = sizeof(BTNCDATA);
        btc.hImage = hbm;

        if (WinCreateWindow(hwnd, WC_BUTTON, "", BUTTON_STYLE,
                            0, 0, BUTTON_X, BUTTON_Y,
                            hwnd, HWND_TOP,
                            pbd[j].btnID+ID_FIRSTBUTTON,
                            &btc, NULL))
            btns[i++] = pbd[j].btnID;
    }

  As you can see I am creating a button with a bitmap attached to it by
using a BTNCDATA structure instead of passing the ordinal value of a bitmap
that is stored as a resource. It works quite well. :-)

  The question is this... Since the bitmap is attached to the button
itself, do I have to explicitly call GpiDeleteBitmap(..) to destroy the
bitmap that is attached to the button or is PM intelligent enough destroy
the bitmap for me?

  The toolkit references aren't clear on this, hell, they don't even tell
you how to do the above..

    See ya,

Craig
cam{at}wpc.cioe.com

--- timEd/2 1.00
* Origin: Workplace Connection * (317) 742-2680 (1:201/60)
SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430
SEEN-BY: 711/807 808 809 934 942 949 712/353 515 713/888 800/1 7877/2809
@PATH: 201/60 1 3615/50 229/2 12/2442 711/409 808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.