Jump to content

Browse for Folder - Automation


 Share

Recommended Posts

Hi All

I'm trying to automate a program that displays a "Browse for Folder" to select a folder.

The program has no text selection box so I can't use a SEND command.

So automating this dialogue is the only option.

The "Browse for Folder" uses a "SysTreeView32" for the folder selection.

Has anyone automated a "Browse for Folder" dialogue?

Thanks in advace for any help!

John Morrison

Link to comment
Share on other sites

Hi All

I'm trying to automate a program that displays a "Browse for Folder" to select a folder.

The program has no text selection box so I can't use a SEND command.

So automating this dialogue is the only option.

The "Browse for Folder" uses a "SysTreeView32" for the folder selection.

Has anyone automated a "Browse for Folder" dialogue?

Thanks in advace for any help!

John Morrison

I have done something similar using the _GuiCtrlListView_* functions. All mine did though was change the view and make the first column auto fit to see everything. You should be able to move through it with _GuiCtrlListView_Clickitem.

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Link to comment
Share on other sites

I have done something similar using the _GuiCtrlListView_* functions. All mine did though was change the view and make the first column auto fit to see everything. You should be able to move through it with _GuiCtrlListView_Clickitem.

Yeah that is what I'm looking at but I'm hoping that someone has already done it and I dotn' have to reinvent the wheel. :mellow:

BUT if no one has done it I'll have to jump in and see what I can create.

What I'd have to do though is

Read each item _GUICtrlListView_GetItem

When I find the one Click it _GuiCtrlListView_Clickitem

(this is where I get stuck)

HOW do I read the child items ONLY that appeared below the clicked item?

Thanks for the advice!

John

Link to comment
Share on other sites

This is a quick a dirty example of how to get the children items:

#Include <GuiTreeView.au3>

$HWND = ControlGetHandle ("My Computer", "", "[CLASS:SysTreeView32; INSTANCE:1]")

$hFirst = _GUICtrlTreeView_GetFirstItem($HWND)

$hFirstChild = _GUICtrlTreeView_GetFirstChild($hWnd, $hFirst)
$sText = _GUICtrlTreeView_GetText($hWnd, $hFirstChild)
ConsoleWrite($sText & @CRLF)

$hNextChild = _GUICtrlTreeView_GetNextChild($hWnd, $hFirstChild)
$sText = _GUICtrlTreeView_GetText($hWnd, $hNextChild)
ConsoleWrite($sText & @CRLF)

I don't have a moment right now to give a full example, but you could use this in a loop of some sort and loop through it until you find the text you are looking for.

Be sure to open my computer or change the Window Title to see this test work.

Edited by LurchMan

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Link to comment
Share on other sites

This is a quick a dirty example of how to get the children items:

I tried it but didn't get it to work. :mellow:

I kept getting repeats of the saem item.

Must be tired (2:30 AM here).

I'll have another try in the morning.

Thanks for the help!

John

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