Sign in to follow this  
Followers 0
ivan

Yet Another WinInfo

11 posts in this topic

#1 ·  Posted (edited)

Hi!

There are times when the Autoit Window Info is not sufficient to ensure a control is in fact the control reported. This occured to me particularly while trying to automate wizards (add new software, hardware, update, etc).

I got so sick of wizards that I developed grabber, to help me automate wizards.

requirements:

1) preferably latest autoit beta or new release v3.2.0.1

2) Captdll v2.zip (Thanks to Lazycat)

Instructions:

1) download Grabber.au3

2) place it on the same folder as captdll.dll

3) run Grabber.au3

4) clic the Data button AND THEN click the window you want to grab. The info of active button and active static controls is reported to the main edit on grabber and saved as a text file to a captured folder on the desktop.

5) click the All button AND THEN click on the window you want to grab. This saves both the data and a jpg of the active window.

6) There's also an exit button, except that it's called Chao! Just adding some humour here.

PS: Grabber can be used with any window, not just those stated above

Modifications: clarified the instructions on the main edit

hope you like it

Grabber.au3

Edited by ivan

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Not a single comment, 6 downloads and 50 odd views?

Shame, it probably looks poor, but if you don't believe me, try launching an "Add new hardware wizard"

Run("rundll32.exe shell32.dll,Control_RunDLL hdwwiz.cpl")

and place the mouse over the next button. What does AutoIt Wininfo read?

Answer: The Finish button. That's why I hate wizards!

Grabber will report a list of control handles, control text and control ids from the entire window, as locng as they are active (visible and enabled). I limited the report to button and static controls on purpose, so that I would have sufficient but not excessive data to ensure a window+control match to perform the automation tasks.

IVAN

Edited by ivan

Share this post


Link to post
Share on other sites

Hi Ivan,

Just tried it and it seems to work fine.

Next time I need to automate something, I'll try it out and let you know


----[ SandyD ]---

Share this post


Link to post
Share on other sites

sandyd:

thanks for the comment. I think I've found a minor bug if the window that is being grabbed ceases to exist before all the data is collected in a 2 dim array.

I'll fix this by testing the window variable for type handle. Otherwise, it does what it's supposed to.

Any ideas would be forthcoming.

IVAN

Share this post


Link to post
Share on other sites

I'm getting an error:

>Running:(3.2.0.1):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\rjg2152\Desktop\Grabber.au3" 
C:\Documents and Settings\rjg2152\Desktop\Grabber.au3 (75) : ==> Subscript used with non-Array variable.: 
DllCall("captdll.dll", "int", "CaptureRegion", "str", $lPicFileName, "int", $lWinPos[0], "int", $lWinPos[1], "int", $lWinPos[2], "int", $lWinPos[3], "int", 100) 
DllCall("captdll.dll", "int", "CaptureRegion", "str", $lPicFileName, "int", $lWinPos^ ERROR

was trying to get some window info in internet explorer

Share this post


Link to post
Share on other sites

I get the same if you click on a non-window item, (icon)

:P Add If not isarray($array) then continueloop somewhere so that when you click on something accidentally, the program doesn't terminate


F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]

Share this post


Link to post
Share on other sites

I gotta say though, this is pretty sweet :P

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@eynstyne & @Ryan Grelck:

I am quite aware of this error, as it occurs on the matching procedure.

I am working on a handler for this error, which basically indicates no window or controls to match.

eynstyne I'll set the array test and continue the loop.

The other stuff I'm working on is a friendlier gui and a menu, so you can select the folder where you want to store your text and jpg files.

Above all, thanks for taking a look at it and for providing comments, criticisms or suggestions.

IVAN

Edited by ivan

Share this post


Link to post
Share on other sites

Hi Ivan

Thanks for uploaded your code. I am trying to compile your code and I get the following error.

\autoitscript\grabber\Grabber.au3(24,85) : ERROR: $DS_SETFOREGROUND: undeclared global variable.

$IpSpyGui = GUICreate("Grabber", 400, 300, @DesktopWidth - 400, 0, $DS_SETFOREGROUND,

I have the three files, captdll.dll, capture_demo.au3 and Grabber.au3 in the same folder. I am using version 3.2.12.1 of AutoIt, am I missing something?

Thanks


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Ivan

Thanks for the reply, that won't be necessary. I have manage to solve that problem that required me to have a more in depth Info tool.

Thanks

Edited by bo8ster

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

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  
Followers 0