Question

An AutoIt script is used to control an WindowsXP app, DVD-lab v1.6, to automate the process of authoring DVDs with similar content. DVD-lab was installed on 8.1 in 'compatibility mode' since it is coded to write some information into C:\program Files This script function normally in WindowsXP, however since moving to Windows 8.1, I have been unable to send any commands to the target application. Are there new security features in 8.1 that prevent AutoIt from sending commands?

I did a work around on this problem (prompt the user to click the icon) only to run into a problem on the next control where I'm attempting to send a filename to a control and press the OK button. So it appears that NONE of the Autoit ControlSend or ControlClick functions are working! I've verified that AutoIt can see the window: WindowExists("DVD-lab") detects if the window exists or not. WinClose("DVD-lab") does nothing. It's behaving like I have read-only access to the window. This worked on WindowsXP!

Suggestions are greatly appreciated.

Here are the commands I've attempted to send a mouse click to the control without success

ControlClick("DVD-lab", "", "[ID:59392]", "left", 1, 41, 9)
ControlClick("DVD-lab", "", "[TEXT:Asset Toolbar]", "left", 1, 41, 9)
ControlClick("DVD-lab", "", "[TEXT:'Asset Toolbar']", "left", 1, 41, 9)
ControlClick("DVD-lab", "", "[CLASSNN:ToolbarWindow328]", "left", 1, 41, 9)

Here is the information from AutoIt Info used to select the control

>>>> Window <<<<
Title:  DVD-lab PRO 
Class:  Afx:400000:0:0:0:2920de7
Position:   -1924, -4
Size:   1928, 1048
Style:  0x15CF0000
ExStyle:    0x00000100
Handle: 0x00000000005406EE

>>>> Control <<<<
Class:  ToolbarWindow32
Instance:   8
ClassnameNN:    ToolbarWindow328
Name:   
Advanced (Class):   [CLASS:ToolbarWindow32; INSTANCE:8]
ID: 59392
Text:   Asset Toolbar
Position:   18, 742
Size:   1466, 23
ControlClick Coords:    38, 13
Style:  0x5600084E
ExStyle:    0x00000000
Handle: 0x00000000007609C0

>>>> Mouse <<<<
Position:   -1864, 778
Cursor ID:  0
Color:  0xA6A64C

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Movie 1
Movie Tools
Connections
Connection Bar
Connection Tools
    Links
    Links
Quick Tools
Ready
status
Menu Bar
Menu Bar
Assets
Preview
Preview Toolbar
Slider1
Assets
Asset Toolbar
Project
Project
Project Toolbar
DVD Topology


>>>> Hidden Text <<<<
DVD Topology
Tab1
Compile
Compile Toolbar
Progress1
Was it helpful?

Solution 2

I downloaded the most recent version of DVD-lab (2.0) and my script worked fine after making the adjustments to the GUI changes in version 2.0. The version 2.0 of the program did NOT need to be installed using compatibility mode. It appears that the app installed in 'compatibility mode' resists automation. I'm guessing that this is a windows 8.1 security 'feature'.

If there is a thread started regarding using autoit on programs installed in compatibility mode, I'd appreciate it if someone would include a link to it in the comments or an alternate answer.

OTHER TIPS

I second Matt's answer. But here's an alternative work-around to try. ControlClick() is just a combination of ControlFocus() and MouseClick().

So something like this:

ControlFocus("DVD-lab", "", [CLASS:ToolbarWindow32; INSTANCE:8])
MouseClick("left", 1, 41, 9)

I would also suggest you don't use "left"/"right" param since I think that can break testing if you switch your Windows mouse button settings. Instead use "primary"/"secondary". For example.

MouseClick("primary", 1, 41, 9)
ControlClick("DVD-lab", "", "[CLASSNN:ToolbarWindow328]", "primary", 1, 41, 9)

You should run the script with administrator. Right click the script properties, in Compatibility tab check the checkbox Run this program as an administrator

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top