#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    32
    Rep Power
    12

    Unhappy Manually repainting owner draw buttons?


    Hello,
    I was wondering how I could get my owner draw buttons to repaint. For example, I want them to repaint when a user clicks the mouse...I tried sending a WM_DRAWITEM message, but that doesn't seem to work. Any suggestions would be great. (win32 and c)

    Thanks
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    Are you sure that your owner-drawn buttons have the BS_OWNERDRAW style set?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    32
    Rep Power
    12
    Hey,
    I'm positive that I am...I am manually drawing my button. Maybe I'm just getting the lParam and wParam wrong when sending the WM_DRAWITEM message. THe format that I am using is, lParam = NULL, and wParam = ID of control sending the message.
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    lParam should be a pointer to a DRAWITEMSTRUCT structure. See http://msdn.microsoft.com/library/de...m_drawitem.asp for details.

    Also, here's an example using a button control (using MFC though, but you should be able to adapt it to your needs), http://msdn.microsoft.com/library/de...a.drawitem.asp

IMN logo majestic logo threadwatch logo seochat tools logo