Thread: Displaying a seperate bitmap for each menu button

  1. #1
    Registered User
    Join Date
    Feb 2002

    Question Displaying a seperate bitmap for each menu button

    Ok, I have a menu and when the menu button is pressed I want a bitmap to appear for each bitmap. here is what i have s far:
    PHP Code:
    switch(LOWORD(wparam)) // The LOWORD(wparam) will equal the "identifier" of
    {                       // of whatever was selected -- These are #defined in 
                                       // resource.h
                                       // **Note:  If using VC++6.0 these are given to you when you "make a resource script"
                                       // So I didn't come up with these names (I could change 'em) but I'm using the defaults

    case ID_QUIT// If they select "Quit" -- quit the program
    // The user selected "Mars Alpha" under the "Maps" menu
    # Here is where i want the bitmap to be displayed

  2. #2
    train spotter
    Join Date
    Aug 2001
    near a computer
    Roughly you need

    Check to see if the button has been pressed
    Load the bmp with LoadImage() or similar
    GetDC() on the button
    GetClientRect() on button
    Select BPM into HDC
    Colour with fillrect() to avoid edges being diff colour.
    BitBlt() or StretchBlt() BMP to HDC

    Then all you need is to be able to repaint in response to WM_PAINT msg's

    Try a search for more detailed responses.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. Need help with Bitmap Display
    By The Brain in forum Windows Programming
    Replies: 7
    Last Post: 03-23-2009, 05:33 AM
  3. displaying a bitmap on a button
    By korbitz in forum Windows Programming
    Replies: 13
    Last Post: 04-01-2004, 04:35 PM
  4. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 11:14 AM
Website Security Test