#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    8
    Rep Power
    0

    Simple Button Question


    Hey Guys,
    I am using c++ win32 api and i need your help again. I would like my buttons in the window to look more pretty. How can I load a bitmap in it?
    My win32 programmer's reference told me to send a "BM_SETIMAGE" message, though I wasn't smart enough to figure it out. I have a HBITMAP handle and a Button handle. Can you help me with that?
    thanks in advance
    yours Woltan
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,615
    Rep Power
    4247
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    8
    Rep Power
    0
    Thank you for the link but it didn't help me much, i already googled and checked several pages. Could someone just post a quick example on how the SendMessage must look like?
    I tried:
    SendMessage(hButton, SETIMAGE, 0, (lParam) (HANDLE) hBitmap);
    with hButton as the Button handle and hBitmap as a HBITMAP handle.
    or is it a wrong aproach?
    thanx again in advance!
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,615
    Rep Power
    4247
    IIRC, it's more like:
    SendMessage(hButton, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap);

    [edit]Just verified this by going into MSDN ( http://msdn.microsoft.com/ ) and searching for BM_SETIMAGE. The documentation is pretty clear on what the params should contain. http://msdn.microsoft.com/library/de...m_setimage.asp [/edit]
    Last edited by Scorpions4ever; July 31st, 2003 at 05:07 PM.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    8
    Rep Power
    0
    Cool it worked,
    the problem was that I was displaying the bitmap I wanted in my button also somewhere else in my window. it seems a handle cannot be uned twice. thanx for the help
    problem solved
    :D

IMN logo majestic logo threadwatch logo seochat tools logo