storme Posted August 11, 2011 Share Posted August 11, 2011 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 Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
LurchMan Posted August 11, 2011 Share Posted August 11, 2011 Hi AllI'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 MorrisonI 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 More sharing options...
storme Posted August 11, 2011 Author Share Posted August 11, 2011 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. 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 Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
LurchMan Posted August 11, 2011 Share Posted August 11, 2011 (edited) 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 August 11, 2011 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 More sharing options...
storme Posted August 11, 2011 Author Share Posted August 11, 2011 This is a quick a dirty example of how to get the children items:I tried it but didn't get it to work. 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 Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
storme Posted August 12, 2011 Author Share Posted August 12, 2011 Well I persisted and made my own navigator for the dialog.Enjoy!John Morrison Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now