abberration Posted December 24, 2017 Share Posted December 24, 2017 I wrote an application a few years ago and now I am trying to update it. One part of the script is to select a folder. In the older (compiled) version, I get a this interface: However, when I run the script now, it shows a more modern folder selection function that has a sidebar and more options. I have played with the flags listed in the help file and I cannot get the simple look as the screenshot I posted above. Does anyone know how I can get that dialog back? Thanks! Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Danyfirex Posted December 24, 2017 Share Posted December 24, 2017 Hello. try this. Local $sFolder = _FileSelectFolder("Choose Folder") ConsoleWrite($sFolder & @CRLF) Func _FileSelectFolder($title, $root = 0, $flags = 0, $hwnd = 0) Local $ret, $pidl, $res = '' Local $ubi = DllStructCreate("hwnd;ptr;ptr;ptr;int;ptr;ptr;int") Local $utl = DllStructCreate("char[512]") Local $urs = DllStructCreate("char[260]") Local $ulf = BitOR(BitShift(BitAND($flags, 1), -9), _ BitShift(BitAND($flags, 2), -5), _ BitShift(BitAND($flags, 4), -2)) DllStructSetData($utl, 1, $title) DllStructSetData($ubi, 1, $hwnd) DllStructSetData($ubi, 3, DllStructGetPtr($urs)) DllStructSetData($ubi, 4, DllStructGetPtr($utl)) DllStructSetData($ubi, 5, $ulf) $ret = DllCall("shell32.dll", "ptr", "SHGetSpecialFolderLocation", _ "int", 0, _ "int", $root, _ "ptr", DllStructGetPtr($ubi, 2)) If $ret[0] Then Return $res $pidl = DllCall("shell32.dll", "ptr", "SHBrowseForFolder", "ptr", DllStructGetPtr($ubi)) If $pidl[0] Then $ret = DllCall("shell32.dll", "int", "SHGetPathFromIDList", _ "ptr", $pidl[0], _ "ptr", DllStructGetPtr($urs)) If $ret[0] Then $res = DllStructGetData($urs, 1) DllCall("ole32.dll", "int", "CoTaskMemFree", "ptr", $pidl[0]) EndIf DllCall("ole32.dll", "int", "CoTaskMemFree", "ptr", DllStructGetData($ubi, 2)) Return $res EndFunc ;==>_FileSelectFolder Saludos abberration 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
abberration Posted December 24, 2017 Author Share Posted December 24, 2017 @Danyfirex, you are awesome! Your code worked perfectly the first time I tried it. I'm so happy you responded. I couldn't have come up with that. When code gets into bitshifts and pointers, I get lost. I'll be looking over the code nonetheless. Thanks again, you are a lifesaver! Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Danyfirex Posted December 24, 2017 Share Posted December 24, 2017 You're welcome. the funny part is that you saw the thread some years ago Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
abberration Posted December 24, 2017 Author Share Posted December 24, 2017 You researched the topic better than me. I don't even remember that conversation. Thanks again for your help! Easy MP3 | Software Installer | Password Manager 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