Archived

This topic is now archived and is closed to further replies.

Confusion over the BS_OWNERDRAW flag.

This topic is 5669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all . I''m trying to make a button which has both an icon and a textlabel on it. Unfortunately, it appears that the Windows API only allows one or the other. If I specify an icon, I get no text. So I thought, "Hey, why don''t I just make myself an owner drawn window??". It seemed like the perfect solution, except that I can''t figure out how to process the WM_OWNERDRAW message. I know when it needs to be drawn, sure, but how is the question. Is it depressed? Is it highlighted? Is it just a normal redraw? I don''t see any flags in the MSDN to address any of these, except selection!! Could somebody please tell me how to tell how a window needs to be redrawn? Or even better yet, how to put both an icon and a text label on the same button? Thanks.

Share this post


Link to post
Share on other sites
Thanks guys . Kippesoep, that funtion is pretty near the top of my "Things I never knew existed but will never be able live without again" list. Thank you so much. Now I think I''m just going to call DrawFrameControl, and then use DrawText for the text and DrawIcon for the icon. Voila! A button with an icon AND text. And thank you too InDirectX, I looked at the drawdata member, but I''m afraid that the it only specifies things like selection and keyboard focus. I think I''m just going to have to monitor the mouse messages and keep track of it.

Share this post


Link to post
Share on other sites
Okay, I guess I'm still stuck. I still haven't managed to figure out how to tell if one of the buttons is being depressed. The API mouse messages (WM_LBUTTONDOWN, etc.) don't apply to controls, and I can't seem to get the button notification messages (such as BN_PUSHED, BN_HILITE, etc.). I tried all of the flags in the itemState member of DRAWITEMSTRUCT, and none of those were triggered by mouse clicks either. Could somebody please show me exactly how I can do this?

[edited by - Oranda on June 6, 2002 11:00:17 AM]

Share this post


Link to post
Share on other sites