troubleshooting Question

CComboBox::GetDroppedControlRect gives incorrect rectangle!

Avatar of mrwad99
mrwad99Flag for United Kingdom of Great Britain and Northern Ireland asked on
System Programming
11 Comments1 Solution973 ViewsLast Modified:
Ah hello.

Firstly, happy new year to one and all :)

I am looking at the function CComboBox::GetDroppedControlRect(), in order to retrieve the dimensions of the listbox part of my combo box.

I derived my own class from CComboBox, and added a handler for CBN_DROPDOWN.  As the screenshot below shows, I have retrieved the window rectangle of the listbox via GetWindowRect.  It is giving me incorrect results though, stating that the height of the rectangle is 86 pixels.  I have measured it and have determined it is 54: even including the edit control part it is only 74.  The width of the listbox at 161 pixels is correct however.

So, in a nutshell, how do I get the true size of the listbox part?

TIA
Combo.JPG
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros