View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK[_3_] NickHK[_3_] is offline
external usenet poster
 
Posts: 415
Default Finding window handle of data validation listbox

Mike,
AFAIK these objects and worksheets controls do not expose a handle. Excel
draws them onto the parent worksheet when required. As such you're not going
to achieve your aim that way.
may be you could fake the drop down with one of your own combobox that sits
over the cell in question but has its .ListWidth set to some suitably large
number.

NickHK

"PastorMike" ...
To widen the display of the data validation drop down, I could
SendMessage(lExcelDataValidationComboboxWindowHand le, CB_SETDROPPEDWIDTH,
cWidth, 0), but to do so I need the handle of the dropdown.
I can get as far as the handle of the Excel workbook window with the
technique described by Bullen, Bovey and Green, but I don't know what
classname to iterate with lExcelDataValidationComboboxWindowHandle =
FindWindowEx(hWorkbookWindowHandle, 0, "classname", vbNullString) on that
window to find the drop down. Is it a combobox? Or something else?
Thanks,
Mike Gardner