RobertBedrosian Posted February 15, 2011 Share Posted February 15, 2011 I have a really awful way of getting the name of a selected file in a directory. Surely, there's a better way, but I can't find it in Help. Help, please. Func GetFileName() Send("{APPSKEY}") Sleep(200) Send("m") Sleep(200) Send("^{c}") Send("{ESC}") $filename = ClipGet() ; MsgBox(0, "", $filename) EndFunc ;==>GetFileName Link to comment Share on other sites More sharing options...
saywell Posted February 15, 2011 Share Posted February 15, 2011 You haven't explained the circumstances, but would FileOpenDialog help? William Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 15, 2011 Moderators Share Posted February 15, 2011 If you're using Win XP ( unsure about Vista ), your explorer and desktop are SysListview32's. Which means you can access them via the _GUICtrlListView_* functions. And ultimately find which were highlighted and get the text from that. On Win 7 ( the machine I have access to now ), my desktop is SysListview32, however, explorer is DirectUIHWND. I'm unsure off hand how to automate that, maybe if you did some research into it, you could find a cleaner method than what you're using now along the lines of what I said about the _GUICtrlListview* functions. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Ascend4nt Posted February 15, 2011 Share Posted February 15, 2011 Check out the combined function KaFu made called '_WindowsExplorer_ExtractSelectedDirAndFiles' in My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
Alphacharly Posted February 15, 2011 Share Posted February 15, 2011 Hi I made a gui for registering ocx/dll files. The File Open dialogue box opens up giving only extension names *.ocx or *.dll Is this of any help/idea? rgdstest Registering file .au3 Link to comment Share on other sites More sharing options...
RobertBedrosian Posted February 15, 2011 Author Share Posted February 15, 2011 Check out the combined function KaFu made called '_WindowsExplorer_ExtractSelectedDirAndFiles' in Thanks Ascend4nt for your kindness. That was JUST what I was looking for. 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