Jump to content

Find SysTreeView32 in Window


Recommended Posts

Hello, I am sure for the 1000's time asked, How do I find and identafy a SysTreeView32 in a window? I've been playing around with "_GUICtrlTreeViewGetTree" useing "Treeview Item Get Tree Example" and can not seem to get it. Also, I've been useing WinBatch for 10 years and just found AutoIT for the first time and REALY like what I see!!!!!!

Thanks Again,

Robert

Link to comment
Share on other sites

Look at ControlGetHandle()

Also look at Au3Info.exe tool

Thanks for your responce!!!

I've been working with both of those and still can not seem to figure it out. This is the code that I am working with:

$treeview = ControlGetHandle ( "TreeView Item Get Tree", "", "" )

;x = ControlGetHandle ( "", "", $treeview)

$x = _GUICtrlTreeViewGetTree($treeview, "\")

MsgBox(0, $treeview, $x, 20)

Thanks Again!

Robert

Link to comment
Share on other sites

Reread my first post - RTFM!!

$treeview = ControlGetHandle ( "TreeView Item Get Tree", "", "SysTreeView321" )
THANK YOU for your help, I am a hack by nature, meaning I will always try and figure something out for my self before reading a book or ASKING for someones help and it appears that AutoIT is not the most intuitive program. However. I do like AutoIT and will continue to learn it.

BTW: RTFM (Read The F??????? Message)?

Thanks Again

Robert

Link to comment
Share on other sites

Hi,

I would also be interested in a simple example of how to interact with the systreeview of an explorer .

Something like this. I cannot get it to work.

Opt("WinTitleMatchMode", 4)

$Debug_TV = False

HotKeySet("{ESC}", "_Quit")
; Get an explorer window open to C:\
If WinExists('[CLASS:ExploreWClass;Title:C:\]') Then
    $hWin = WinGetHandle('[CLASS:ExploreWClass;Title:C:\]')
Else
    If Not WinExists('[CLASS:CabinetWClass;Title:C:\]') Then
        Run("Explorer.exe C:\")
        WinWait('[CLASS:CabinetWClass;Title:C:\]')
    EndIf
    $hWin = WinGetHandle('[CLASS:CabinetWClass;Title:C:\]')
EndIf
WinActivate($hWin)
WinWaitActive($hWin)

; Create folder view (SysTreeView321) if required
$hSTV1 = ControlGetHandle($hWin, "", "[CLASS:SysTreeView32;INSTANCE:1]") ; Folder explorer control
If $hSTV1 = "" Then
    ControlSend($hWin, "", "", "!x") ; View
    ControlSend($hWin, "", "", "o") ; Explorer
    ControlSend($hWin, "", "", "^{TAB}") ; Folder
    Sleep(100)
    $hSTV1 = ControlGetHandle($hWin, "", "[CLASS:SysTreeView32;INSTANCE:1]") ; Folder explorer control

    ;$sText = _GUICtrlTreeView_GetText($hSTV1, _GUICtrlTreeView_GetFirstItem($hSTV1))
    ;ConsoleWrite("Debug: $sText = " & $sText & @LF)
    ConsoleWrite('1: ' & ControlTreeView ('', '', 30120, 'GetText', 2) & @CRLF)
    ConsoleWrite('1: ' & ControlTreeView ('', '', 30120, 'Select', 2) & @CRLF)
    ConsoleWrite(@error & @CRLF)

EndIf

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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