Jump to content

Auto-it Resistant Program


JPeters
 Share

Recommended Posts

I'm trying to write some AutoIt scripts to automate moving and reading sliders in a program that I believe was written in Visual Basic. I've not been provided the source code for the program. The sliders are Slider20WndClass and the window is ThunderRT6FormDC (which seems to be a VB class.) I've blacked out the window name just in case it's proprietary information.

Info for the sliders (there's no status bar, visible text, or hidden text so I cropped that part out):

Posted Image

I haven't been able to get a handle for any of the sliders using ControlGetHandle, though I can get a handle for the window itself.

One road I've tried to go down is reading the tooltips off of the sliders:

Posted Image

I tried listing all the titles of windows of class "msvb_lib_tooltips" using the WinList function - I showed 8 windows of that class, but all had nulls strings as titles, not the numeric titles the WindowInfo tool shows for these tooltips.

Next I tried using the _ToolTip_ToolExists function from Auto3Lib, with the following code (again, edited to remove the actual window title). Couldn't get that to recognize the tooltip either.

#include <File.au3>
#include <Array.au3>
#include <A3LToolTip.au3>

Opt("WinTitleMatchMode", 2);set partial match mode for window titles
$SliderPos=-1
$DataFilePath="C:\data.txt"
If WinExists("data.txt") Then
    WinClose(WinGetHandle("data.txt"))
EndIf


$h_Window=WinGetHandle(<WINDOW TITLE>)
$h_Slider=ControlGetHandle($h_Window,"","[CLASS:Slider20WndClass]")
$Exists=0
$GatherData=0

;initialize data file
$h_DataFile=FileOpen($DataFilePath,2)
$TimeStamp=@MON&"/"&@MDAY&"/"&@YEAR&" "&@HOUR&":"&@MIN&":"&@SEC
FileWriteLine($h_DataFile,$TimeStamp)
FileWriteLine($h_DataFile,"Window handle: " & $h_Window)
FileWriteLine($h_DataFile,"Slider handle: " & $h_Slider)

$GUI=GUICreate("Data Gathering", 200, 100)
GUICtrlCreateLabel("Choose an option.", 30, 20, 150, 30, $SS_LEFT)
$ExitButton = GUICtrlCreateButton("Exit", 30, 50, 70)
$DataButton = GUICtrlCreateButton("Gather Data", 110, 50, 70)
GUISetState(@SW_SHOW)


While 1;poll the gui until a button is pressed
    $msg = GUIGetMsg();polls GUI for a message
    Select
    Case $msg=$ExitButton
        FileClose($h_DataFile)
        Exit
        ExitLoop
    Case $msg=$DataButton
        If $GatherData=1 Then
            $GatherData=0
        Else
            $GatherData=1
        EndIf
    EndSelect
    If $GatherData Then
        Sleep(100)
        $Exists=_ToolTip_ToolExists($h_Window)
        FileWriteLine($h_DataFile,$Exists)
    EndIf
WEnd;close the gui loop

I'm pretty much at a loss of what to try now. I realize there's only so much anyone can do to help without being able to test code against the program I'm trying to automate, but I'm hoping that someone might have run into a similar problem program in the past and have some other methods I could try. Thanks!

Link to comment
Share on other sites

ControlClick(WINDOW_NAME,"" , "[CLASSNN:CLASS:Slider20WndClass1]","left",1,$x,$y)

$x=x position in the control

$y=y position in the control

.... if you can't find anything better than try this

Edited by alexmadman

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

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...