John Mirror
John Mirror

Reputation: 193

how to get a text from a window

This is the window of the application used to view TV Channels on my BT878 TVTunner.

alt text

The number 6 from the middle is the number of the channel. I know the handle of the window. Is there any way (preferably in Delphi programming language) to get that number...?

Thank you for any reply.

Upvotes: 0

Views: 810

Answers (2)

Remy Lebeau
Remy Lebeau

Reputation: 597315

If that channel field has its own HWND, then try sending it a WM_GETTEXT message (use Spy++, Winspector, or other similar tool to see the parent/child relationships of the window's HWNDs). If that does not work, then you may have to resort to capturing an image of the app's window, extracting the pixels used for the channel number, and then parse them to determine which number is being displayed.

Upvotes: 0

David Heffernan
David Heffernan

Reputation: 613382

If it used an interface of normal Windows controls then you could enumerate the child windows and find the one which contained that text.

However, this looks like a custom drawn window and so I suspect that you only chance would be to do a screen scrape to a bitmap and process that.

You could use Spy to inspect the app and see whether or not there are child windows.

Upvotes: 1

Related Questions