Jump to content

How to work with this control?


Recommended Posts

Hi,

I am trying to automate the restore of an image (with a product called ShadowProtect) by working with its Restore Wizard.

Using the AutoIt Window Info utility I have been able to identify the controls and perform the necessary steps to complete the steps in the Restore Wizard until I reach a screen where I have to select the Destination for the image being restored.

On this screen of the Restore Wizard, the AutoIt Window Info utility only seems to report information on the entire VolumeList (this will make more sense if you look at the attached screenshot).

I would appreciate suggestions on how I might go about being able to "read" information on the individual volumes so that I can write some logic so that the script can select the appropriate volume with certainity.

Referring to the screenshot, if I can identify and select the rows for the Drive Letter C:\ and D:\ then I will be OK, but at the moment I can't see how to identify any info about the various rows in the Restore Destination box.

Hope this makes sense.

VW

Restore_Wizard.bmp

Link to comment
Share on other sites

Have done a bit of reading and tried a few things.

I have worked out that I can select different items within the control just by sending a few keystrokes, which if this is all I can do, will be adequate to select the restore destination.

However while this is OK in terms of selecting a destination (as sending a few keystrokes is something I can manage) ... it means that my logic will have to make assumptions about the order of the destination volumes. I would prefer to be able to identify the rows explicitly, so if the order of the volumes is not as I expect then the script can take the appropriate action.

To work with this control, I need to get the handle to the control. For some reason which I am hoping someone might be able to shed some light on I am unable to get a handle to this control.

Using this example and this information from AU3 Window Info

>>>> Window <<<<
Title:  Restore Wizard
Class:  #32770

>>>> Control <<<<
Class:  XTPReport
Instance:   1
ID: 102
Text:   VolumeList

I believe this code should give me the handle to the control

$WindowTitle="Restore Wizard"
$ControlID="XTPReport"
$ControlHandle=ControlGetHandle ( $WindowTitle, "", $ControlID )
If $ControlHandle = "" Then
    MsgBox(0,"Error","Can't get handle")
Else    
    msgbox(0,"HWnd",String($ControlHandle))
EndIf

Yet it does not, so therefore at the moment I am stuck.

Suggestions on things to try or search for would be handy.

Thanks

VW

Link to comment
Share on other sites

An update to my own private thread :)

Still this info might be useful to someone trying to work with "listbox" type controls in the future.

I have been able to get a handle to the control using the following

$WindowTitle = "Restore Wizard"
$Text = "VolumeList"
$ControlID=102
$ControlHandle=ControlGetHandle($WindowTitle, $Text, $ControlID)

If $ControlHandle = "" Then
        MsgBox(0,"Error","Can't get handle")
Else    
    msgbox(0,"HWnd",String($ControlHandle))
EndIf

Unfortunately having obtained a handle to the control, the listbox and listview functions in Auto3Lib don't seem to work with the control which is disappointing.

Have also tried using ControlListView and ControlCommand, so it may be that while I will be able to send keystrokes to select items I will have to make some assumptions about the contents of the control.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...