Multiple Owner Drawn buttons

This is a discussion on Multiple Owner Drawn buttons within the Windows Programming forums, part of the Platform Specific Boards category; ok, i'm a C++ noob trying to put owner drawn buttons on a regioned, skinned window. so far i'm trying ...

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    11

    Talking Multiple Owner Drawn buttons

    ok, i'm a C++ noob trying to put owner drawn buttons on a regioned, skinned window. so far i'm trying to accomplish this by following the msdn info here but it says, "You would typically use the wParam parameter of the WM_DRAWITEM message to identify the control; in this example, only one control is assumed."

    only problem is, i have no idea how to use the wParam parameter of the WM_DRAWITEM message.

    any words of wisdom would be much appreciated. thanks

  2. #2
    *this
    Join Date
    Mar 2005
    Posts
    498
    I think HIWORD is the state, like clicked, released, checked, etc..
    And LOWORD is the actual ID of the object like IDOK or IDCANCEL.

    Google HIWORD(wParam) and LOWORD(wParam) and check out some example code.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    11
    thanks JoshR! now i understand a heck of a lot more about HIWORD and LOWORD, and that gets me closer to my goal. many thanks for the input!

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    Just a note that the MSDN example code will create a large GDI memory leak unless you are using a .NET version of MSVC (greater than v6).

    In .NET versions of MSVC GDI objects became temp by default and are auto released. This is not the case in v6.

    If using MSVC v6 ensure you catch the return (the current GDI object) from any SelectObject() call and replace this before deleting/ releasing the DC.

    ie
    HBITMAP hOrigBMP = SelectObject(hDCMem, bmp1);
    //blah blah
    SelectObject(hDCMem,hOrigBMP);//return DC to original state
    //can now delete DC
    "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

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    11

    mostly there...

    ok, so here's where i'm at and what i've got:

    1-i have a skinned, regioned window.

    2-i have a typical close button on that skinned, regioned window which works just fine.

    3-i am trying to get an owner drawn button displaying my bitmap on the skinned, regioned window. so far, following advice given to me and the material about owner drawn buttons on the MSDN site, i have the window for the button i wish to display drawing on the regioned window, but cannot get my bitmap to display.

    i've been working on this for days, trying everything i know, and researching as much as possible, but i've run out of ideas. if someone would be so kind as to look at this code and tell me what i'm missing, i would really appreciate it. i've attached the whole project since with the skinning, regioning, and owner drawn buttons, it may be a bit confusing to look at just the button part of the code.

    zipped project

    novacain, i haven't had a chance to check out your suggestion yet, but i certainly will. many thanks for the heads up!

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    11

    Thumbs up got it

    alright, i guess ignore that last post, i was able to get it running and working fine.

    thanks again everyone for the advice though.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems defining classes
    By esmeco in forum C++ Programming
    Replies: 47
    Last Post: 10-24-2007, 01:13 PM
  2. Owner Drawn (a few questions)
    By Oldman47 in forum Windows Programming
    Replies: 2
    Last Post: 04-17-2007, 08:21 PM
  3. Multiple Owner Drawn buttons
    By budoka in forum C++ Programming
    Replies: 3
    Last Post: 07-12-2005, 02:00 AM
  4. Owner Drawn dynamic menus
    By cpeschke in forum Windows Programming
    Replies: 0
    Last Post: 04-18-2005, 04:55 PM
  5. Owner Drawn Menus
    By Okiesmokie in forum Windows Programming
    Replies: 6
    Last Post: 08-09-2002, 09:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21