How to send a message to a button on a tab control
I can get the window handle of the Communications Port (COM1) Properties window using the window caption in FindWindow:
windowTitle = serialPorts(index).name & " Properties" 'from WMI
parentHwnd = FindWindow(vbNullString, windowTitle)
I can even send messages to the OK and Cancel buttons using the class and button caption with FindWindowEX and SendMessage:
buttonHwnd = FindWindowEx(parentHwnd, 0&, "Button", "OK")
SendMessage buttonHwnd, BM_CLICK, 0&, 0&
I tried getting the window handle for the Port Settings tab and then the Advanced button but that doesn't work:
windowTitle = "Communications Port (" & serialPorts(index).deviceID & ") Properties"
parentHwnd = FindWindow(vbNullString, windowTitle)
childHwnd = FindWindowEx(parentHwnd, 0&, "#32770", "Port Settings")
buttonHwnd = FindWindowEx(childHwnd, 0&, "Button", "&Advanced...")
How do I do this?
Thanks,
quantum1976

