trancexx Posted October 21, 2013 Share Posted October 21, 2013 (edited) Newer systems have nicer looking "Browse for folder" UI than older does. AutoIt internally calls older version. Since some time AutoIt can natively access, by definition early bound objects, using special technique of late binding. Function that does this is ObjCreateInterface(). Considering most of the Windows is COM based the advantages are big, you just have to learn how to take them. This small example (attached FileSelectFolder.au3) shows how to create object of IFileDialog interface and by calling its methods customize and invoke "select folder" dialog. In case of older systems where IFileDialog isn't available the function will call internal AutoIt's FileSelectFolder(), so it should be safe to use in any environment. Example of usage is from the help file for normal dialog: #include "FileSelectFolder.au3" Local Const $sMessage = "Select a folder" ; Display an open dialog to select a folder. Local $sFileSelectFolder = FileSelectFolder2($sMessage, "") If @error Then MsgBox(4096, "", "No folder was selected.") Else MsgBox(4096, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder) EndIf ...And the UDF: FileSelectFolder.au3 Edited November 3, 2013 by trancexx mesale0077, jvanegmond and Terenz 3 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
wakillon Posted October 21, 2013 Share Posted October 21, 2013 Tested your example successfully with actual release, but with the latest beta a window appear on the top left of the screen and a second ( or may be the same, it's too fast for me!) is set at the midle of the screen... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
mLipok Posted October 21, 2013 Share Posted October 21, 2013 Where I can read about possible value for this parameter: "$iFlag" ? Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
trancexx Posted October 21, 2013 Author Share Posted October 21, 2013 wakillon position is remembered per app in case of default parent window (0) - I believe. Beta AutoIt is new application, try moving the UI to new position. Normally you would "attach" it to your GUI by passing parent window handle. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
trancexx Posted October 21, 2013 Author Share Posted October 21, 2013 Where I can read about possible value for this parameter: "$iFlag" ? That's for built-in function. It's ignored here if everything is ok. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
wakillon Posted October 21, 2013 Share Posted October 21, 2013 wakillon position is remembered per app in case of default parent window (0) - I believe. Beta AutoIt is new application, try moving the UI to new position. Normally you would "attach" it to your GUI by passing parent window handle. Ok thanks. AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
mLipok Posted October 21, 2013 Share Posted October 21, 2013 (edited) Is there any way you display a list of files in such a way as to display a list of files in the "Detail view" ? Edited October 21, 2013 by mlipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Kilmatead Posted October 22, 2013 Share Posted October 22, 2013 (Thanks for this; considering what an evil thing the default folder-select is, I'm surprised there aren't more responses here.) A little bit of experimentation using BitOR($FOS_PICKFOLDERS, $FOS_ALLOWMULTISELECT, $FOS_CREATEPROMPT) for the options is not exactly having the effect I was after. While multiple folders can be selected (and will even display as a quoted/space-separated list in the edit control), that multi-string is not returned as expected - would extra calisthenics be required for this? And, manually entered folders (to replicate the missing "Create Folder" button) will actually invoke the prompt ("Does not exist - Create it?") as expected, except it's always followed by an "invalid folder" error, even if the path is manually supplied. Or is this just asking too much of the poor IFileDialog? Link to comment Share on other sites More sharing options...
DatMCEyeBall Posted October 22, 2013 Share Posted October 22, 2013 (edited) This seems... Awesome! But would it break on lower systems with windows XP? Could I use it in a release app where the environment is unsupervised? Edited October 22, 2013 by DatMCEyeBall "Just be fred, all we gotta do, just be fred." -Vocaliod "That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha @tabhooked Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation Link to comment Share on other sites More sharing options...
trancexx Posted October 22, 2013 Author Share Posted October 22, 2013 (Thanks for this; considering what an evil thing the default folder-select is, I'm surprised there aren't more responses here.) A little bit of experimentation using BitOR($FOS_PICKFOLDERS, $FOS_ALLOWMULTISELECT, $FOS_CREATEPROMPT) for the options is not exactly having the effect I was after. While multiple folders can be selected (and will even display as a quoted/space-separated list in the edit control), that multi-string is not returned as expected - would extra calisthenics be required for this? And, manually entered folders (to replicate the missing "Create Folder" button) will actually invoke the prompt ("Does not exist - Create it?") as expected, except it's always followed by an "invalid folder" error, even if the path is manually supplied. Or is this just asking too much of the poor IFileDialog? Aha multiple folders, yes I can do that. ...Will update the OP. Why poor? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Kilmatead Posted October 22, 2013 Share Posted October 22, 2013 Thanks again. Why poor? I hate COM (with a passion), so always imagine these objects as sad little entities being poked and prodded by a bunch of kooks with sticks until they do what we want them to. So, even though I hate them, anthropomorphically they deserve some semblance of sympathy: hence, "poor". Link to comment Share on other sites More sharing options...
trancexx Posted October 23, 2013 Author Share Posted October 23, 2013 Thanks again. I hate COM (with a passion), so always imagine these objects as sad little entities being poked and prodded by a bunch of kooks with sticks until they do what we want them to. So, even though I hate them, anthropomorphically they deserve some semblance of sympathy: hence, "poor". Then unfortunately you can't understand Windows systems. AutoIt was never object-friendly, the worst internal AutoIt code was objects related one. It was implemented on very basic level and even that was poorly done. With latest development, even though "latest" in AutoIt means shit, plenty of things have been changed, improved, rewritten. it's worth using now, really. ...But like almost everything with AutoIt, ignorance wins at the end and somehow finds way to pull it back into the little black box. Luckily, some good things manage to survive the process. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Kilmatead Posted October 23, 2013 Share Posted October 23, 2013 Then unfortunately you can't understand Windows systems. There's a lot to be said for humour. I never said I couldn't use it, it's just that I hate it; like Liver and Onions - sure, I can eat it if I have to, but I'd have to have a gun to my head. At least I can grasp the context of it better in AutoIt than in VBS where I was forced to learn some of it in the first place (with that gun to my head). There's a reason God gives us nice juicy DLL calls with pointers we can sink our teeth into. I dislike the "let me hold your hand" approach because it always seems to jump right off the cliff just when you feel you're getting the hang of it - but then again, I suppose that's the moral of scripting in a nutshell... anything worth doing is worth doing the hard way. (That, and the documentation [in Windows itself, not AutoIt] is atrocious.) Maybe it's just me. (Thanks for the update - works great. I suppose the "create folder" option is not possible...) Link to comment Share on other sites More sharing options...
trancexx Posted October 23, 2013 Author Share Posted October 23, 2013 ...For example, right click on the UI and choose New->Folder. MSDN documents flags' behavior. You can make event handler and likely deal with it programmatically too. I haven't tried. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Kilmatead Posted October 23, 2013 Share Posted October 23, 2013 ...For example, right click on the UI and choose New->Folder. There's that proverbial gun again, pointed at my head. Sorry, forest for the trees... I thought of an event handler first, but never having done that outside of a GUI I created myself, I probably imagine it to be worse than it is. Link to comment Share on other sites More sharing options...
BrewManNH Posted December 11, 2013 Share Posted December 11, 2013 I started playing with this, and I have a question. How do you make the FileSelectFolder2 window resizable? I get the double ended arrow when I hover over the lower right corner, and the bottom of the window, but clicking and dragging doesn't affect the size, it's frozen at max. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
LarsJ Posted December 11, 2013 Share Posted December 11, 2013 trancexx does not do anything to make the window resizable. The window is created with IFileDialog.Show (inherited from IModalWindow). This method creates a modal dialogbox which is resizable by default. When I run the example in the first post the window is resizable. I'm on Win 7 64 bit. Isn't the window resizable when you run this example? Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Valuater Posted December 11, 2013 Share Posted December 11, 2013 Nice Work!!! 8) Link to comment Share on other sites More sharing options...
BrewManNH Posted December 11, 2013 Share Posted December 11, 2013 I get the double ended arrow when I hover over the lower right corner, and the bottom of the window, but clicking and dragging doesn't affect the size, it's frozen at max. trancexx does not do anything to make the window resizable. The window is created with IFileDialog.Show (inherited from IModalWindow). This method creates a modal dialogbox which is resizable by default. When I run the example in the first post the window is resizable. I'm on Win 7 64 bit. Isn't the window resizable when you run this example? On the computer I tested this on, it wasn't resizable. I just tested it on another computer and it can be resized. Weird. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
DigitalFacade82 Posted December 20, 2013 Share Posted December 20, 2013 This is awesome. Thanks so much trancexx Now one could almost be totally unaware that they are using a AutoIT built application. I like how "polished" things are becoming, no thanks to people like your self. Maybe someday in the not so distant future AutoIT can be remembered as not just a hacker/virus building tool and as something that great applications are be built from. 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