Jump to content
Sign in to follow this  

Help with ControlGetText from MSFlexGridWndClass

Recommended Posts

I am having a problem trying to get ControlGetText to return text from Grids.

Here is Control Information of the Grid:

>>>> Control <<<<

Class: MSFlexGridWndClass

Instance: 1

ClassnameNN: MSFlexGridWndClass1



Position: 285, 366

Size: 480, 80

ControlClick Coords: 189, 46

Style: 0x54000000

ExStyle: 0x00000000

Handle: 0x00010184


Example Code:


$HEX = "0x00010184"

$text = ControlGetText ( "", "", HWnd($HEX) )

MsgBox(0, "Text read from Control Handle:" & HWnd($HEX) & " was:", $text)


In my real code I pass $HEX in as a parameter instead of hard coding it. When I use this approach it has worked for other controls I interact with, but no luck so far for this.

Any feedback wold be great.



Share this post

Link to post
Share on other sites

Hello STSRob,

MSFlexGridWndClass controls are somewhat notorious for not giving up the ghost when it comes to reading text.

Assuming you don't have the developer around to register custom messages, you may want to try to:

1 - Determine if you can activate a cell and copy its contents to the clipboard

2 - Determine if you can activate a cell and spy on it. Some grid controls ( like FarPoint Spread controls ) will expose the active cell

3 - Use OCR there are some OCR scripts floating around the forum. Then there's the MODI object ( included with MS Office 2003 ) or pay out $40 for SnagIt8.

One last trick: An application I was working with had a grid object that did not appear to respond to clipboard commands. So I wrote a quick script that placed the contents of the clipboard in the SciTe output console whenever it changed. With that script running in the background, I brought the application up and proceeded to try different combinations of keys. I eventually discovered a key sequence that placed a row of text in the clipboard ( in this case, Ctrl-F9 ). If you don't want to write a script, you can use the Office Clipboard.

Hope this helps,


Edited by zfisherdrums

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...