How do I obtain the background color of a control (that I have already identified) that is a part of another seperate window/application?
Printable View
How do I obtain the background color of a control (that I have already identified) that is a part of another seperate window/application?
You could use the GetBkColor API, but it accepts a device context as an aurgument, so you'll need to convert the hwnd you've got with the GetDC API.
Thank you!! That is what I needed. I am getting some unexpeded results from it. All the background colors are being retuned as white. The app I am testing it on is simply a VB form with several text boxes, some command buttons and a combo box.
I'll keep playing with it to see what it is doing, but if you know of any querks that accompany this call. Thanks again for your help.
Here's a little form I knocked up. Change the picturebox's colour to anything and it should give you consistent answers when you click the button