Some days, the code just flows. But not when you are calling the Windows API. :-(
I've been working a bit more on Windows GUI automation, specifically on combo boxes.
The problem was with automating the selection of items in the combo. To begin with, I was just sending a CB_SETCURSEL message to the combo, like so:
win32gui.SendMessage(hwnd, win32con.CB_SETCURSEL, item, 0)
This did the selection in the combo box so far as I could see, but it wasn't sticking - the changed selection wasn't having any effect on the rest of the dialog.
Turns out, I need also to send a CBN_SELCHANGE, too. Finding this out, along with working out how to send the bloody thing, has taken all day. Sigh.Posted to Python by Simon Brunning at November 19, 2003 04:56 PM