Jump to content
Sign in to follow this  
MikeP

WindowsForms

Recommended Posts

MikeP

Hello, I have an application using a GUI with an element of CLASSNN : WindowsForms10.window.8.app.0.378734a2 that I need to access, it's a grid type. I had the same work to do with a ListView so I used _GUICtrlListView_** UDFs and it worked perfectly.. but with this WindowsForms I can't retrieve the datas in the cells since there's no _GUICtrlWindowsForms_*** UDFs.

I tried using ListViews/ListBox data get functions with that with no result.

Anyone had this issue and knows the answer? or maybe someone with .NET's knowledge could help me.. because I guess the answer is to use a dll but I'm neophyte.

Share this post


Link to post
Share on other sites
PsaltyDS

Hello, I have an application using a GUI with an element of CLASSNN : WindowsForms10.window.8.app.0.378734a2 that I need to access, it's a grid type. I had the same work to do with a ListView so I used _GUICtrlListView_** UDFs and it worked perfectly.. but with this WindowsForms I can't retrieve the datas in the cells since there's no _GUICtrlWindowsForms_*** UDFs.

I tried using ListViews/ListBox data get functions with that with no result.

Anyone had this issue and knows the answer? or maybe someone with .NET's knowledge could help me.. because I guess the answer is to use a dll but I'm neophyte.

The WindowsForms10 controls are generated by .NET I believe. There are buttons and combo boxes, etc. in that class that AutoIt can work with just fine. The problem is specifically that it is a Grid control. Grid control questions have come up repeatedly on this forum over the last couple of years, and I don't think there has been a successful outcome yet. Standard APIs for AutoIt to call on a grid control are just not there.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
dis

The WindowsForms10 controls are generated by .NET I believe. There are buttons and combo boxes, etc. in that class that AutoIt can work with just fine. The problem is specifically that it is a Grid control. Grid control questions have come up repeatedly on this forum over the last couple of years, and I don't think there has been a successful outcome yet. Standard APIs for AutoIt to call on a grid control are just not there.

:)

I know this is old, but I can get stuff out of a grid view, and it took me a little bit of time to figure out, so I thought I would share.

I've worked around this by copying the contents of the grid view to the clipboard, and then processing it later. Since I'm doing automated testing from a java environment, I do all of the string processing in that environment, but you should be able to do it in autoit. My basic code is below. I know it's hackish, but it works well enough for me.

Func GetGridViewText($sId, $title = "", $text = "")
    ControlClick($title, $text, $sId);
    Send("{CTRLDOWN}C{CTRLUP}");
    return ClipGet();
EndFunc

Share this post


Link to post
Share on other sites
PsaltyDS

I know this is old, but I can get stuff out of a grid view, and it took me a little bit of time to figure out, so I thought I would share.

I've worked around this by copying the contents of the grid view to the clipboard, and then processing it later. Since I'm doing automated testing from a java environment, I do all of the string processing in that environment, but you should be able to do it in autoit. My basic code is below. I know it's hackish, but it works well enough for me.

Func GetGridViewText($sId, $title = "", $text = "")
    ControlClick($title, $text, $sId);
    Send("{CTRLDOWN}C{CTRLUP}");
    return ClipGet();
EndFunc
Good point. Thanks for the tip, but I think it has been posted before. People have often resorted to blind TABs/Send and MouseClick() on X/Y coordinates to deal with grids in AutoIt. Any other hot key the grid might respond to should work as well (i.e. "+{DEL}" for cut, and "^v" or "+{INS}" for paste). It's a work-around kludge, but that's what's available when dealing with grid controls.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×