Jump to content

How To Access A Window With No Name?


Lakes
 Share

Recommended Posts

Still trying to automate some things withe DigitalPeers Camtrack Program....

See my other post here http://www.autoitscript.com/forum/index.php?showtopic=24080

How do I get access to the main control panel if it has no title?

;Main Panel Check Boxes

;Title:           <---------- Its Blank! -----------
;Class: #32770
;Size: W: 302   H: 321

;Box1
;Control ID:    1054
;ClassNameNN:   Button11

;Box2
;Control ID:    1055
;ClassNameNN:   Button12

;Box3
Control ID: 1056
ClassNameNN:    Button13

;Box4
;Control ID:    1057
;ClassNameNN:   Button14

;Box5
;Control ID:    1058
;ClassNameNN:   Button15

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

You have window class, so try to access window via classname with WinTitleMatchMode option set to 4 (advanced mode).

Opt("WinTitleMatchMode", 4)
Win****("classname=#32770", "", ...
Thanks, but that does`nt work either :)

Test Code..

;For use with DigitalPeers Camtrack Program

;Main Panel Check Boxes
;Title: 
;Class: #32770
;Size: W: 302   H: 321

;Box1
;Control ID:    1054
;ClassNameNN:   Button11

;Box2
;Control ID:    1055
;ClassNameNN:   Button12

;Box3
;Control ID:    1056
;ClassNameNN:   Button13

;Box4
;Control ID:    1057
;ClassNameNN:   Button14

;Box5
;Control ID:    1058
;ClassNameNN:   Button15

Opt("WinTitleMatchMode", 4)
#include <Date.au3>
#include <GUIConstants.au3>

$Main = WinGetHandle("classname=#32770", "")
If WinExists($Main) = 0 then
    $Err= MsgBox(16+5,"ERROR!","Please enable the Camtrack Control Panel")
EndIf

$Box = 1054

While 1
        ControlFocus($Main,"",$Box)
        ControlCommand ( $Main, "", $Box, "Check", "" )
        MsgBox(64,"Box?","Box Number " &$Box)
        ControlFocus($Main,"",$Box)
        ControlCommand ( $Main, "", $Box, "UnCheck", "" )
        MsgBox(64,"Box?","Control Panel =" &$Main &" Box Number " &$Box &" has been Unchecked")
WEnd
Exit

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

  • Moderators

What's the EXE name?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Strange... Try another way: because your window have some controls with unique ID you can exactly identify it.

$hwList = WinList()

For $i=1 To $hwList[0][0]
    If ControlGetHandle($hwList[$i][1], "", 1054) <> 0 Then 
        MsgBox (0, "Found", "Found window with handle = " & $hwList[$i][1])
    Endif
Next

This should get you handle of window that have certain control. For more safe identity you can check more then one control.

Link to comment
Share on other sites

Strange... Try another way: because your window have some controls with unique ID you can exactly identify it.

$hwList = WinList()

For $i=1 To $hwList[0][0]
    If ControlGetHandle($hwList[$i][1], "", 1054) <> 0 Then 
        MsgBox (0, "Found", "Found window with handle = " & $hwList[$i][1])
    Endif
Next

This should get you handle of window that have certain control. For more safe identity you can check more then one control.

Wooo Hooo! It works!! :)

$hwList = WinList()
For $i=1 To $hwList[0][0]
    If ControlGetHandle($hwList[$i][1], "", 1054) <> 0 Then
        MsgBox (0, "Found", "Found window " &$i &" with handle = " &$hwList[$i][1])
    $Main = $hwList[$i][1]
    Endif
Next

While 1
        ControlFocus($Main,"",$Box)
        ControlCommand ( $Main, "", $Box, "Check", "" )
        MsgBox(64,"Box?","Box Number " &$Box)
        ControlFocus($Main,"",$Box)
        ControlCommand ( $Main, "", $Box, "UnCheck", "" )
        MsgBox(64,"Box?","Control Panel =" &$Main &" Box Number " &$Box &" has been Unchecked")
WEnd
Exit

Many thanks! :mellow:

2015 - Still no flying cars, instead blankets with sleeves.

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