Moderators Melba23 Posted February 14, 2009 Moderators Posted February 14, 2009 Overkill, The properties and their index numbers are different depending on the OS. The attached file is what I have gleaned from t'interweb. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Overkill Posted February 14, 2009 Posted February 14, 2009 Overkill,The properties and their index numbers are different depending on the OS. The attached file is what I have gleaned from t'interweb.M23I'm on XP...the list can be modified on the machine to include other values (for instance, the +4 attribs on my PC). That's what I was talking about.
TheSaint Posted August 13, 2010 Posted August 13, 2010 Apologies for reviving an oldish post, but many like me are still probably using the UDF - though it does seem to have issues between versions of Windows, etc. @Simulcal - I note that you use the following code $sProperty = $oDir.GetDetailsOf ($oFile, $iProp) If $sProperty = "" Then Return 0 Else Return $sProperty EndIf which I believe should just be $sProperty = $oDir.GetDetailsOf ($oFile, $iProp) Return $sProperty Reason being, that it is not necessarily a failure when their is nothing to be returned (i.e. ID3 tags), so '0' is not right. It should be up to the caller, to deal with what is returned (i.e. nothing = 0 in specific cases). You also have in your remarked section On Failure - 0, @Error - 1 (If file does not exist) yet you use the following in your code (which doesn't match) $iExist = FileExists($sPath) If $iExist = 0 Then SetError(1) Return 0 So maybe the Return should be -1 to do so. If I haven't said so before, thanks for the UDF! It has been very handy in a few of my programs - though I've only used it with Win XP. Just recently I was caught out when I discovered that the UDF was returning '0' for the ID3 comment tag, which I definitely didn't want displaying in my Viewer field. I've of course adjusted your UDF for my program, but I thought it best to advise about it also. I realize I could have just adjusted my program to convert '0' into '', but I thought it much proper for your UDF to be returning the true value as is. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)
jWalker Posted October 14, 2011 Posted October 14, 2011 (edited) Attempting to get resolution of a pic Always returning 0 Win7 What's the problem? :EDIT: $sProperty = $oDir.GetDetailsOf ($oFile, $iProp) If $sProperty = "" Then Return "ajshdkasjdh" Else Return $sProperty EndIf> Changed "0" to "ajshdkasjdh" There is the Problem... So $sProperty doesnt give me anything back... Edited October 14, 2011 by jWalker
KaFu Posted October 14, 2011 Posted October 14, 2011 So what's $iProp? As mentioned somewhere above, the index number depends on the OS and also on the OS language! OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
gcue Posted May 19, 2015 Posted May 19, 2015 (edited) removing post and posting to help section instead of here (since issue can be related to other scripts as well not just the one on this thread) Edited May 19, 2015 by gcue
Valandric Posted July 1, 2016 Posted July 1, 2016 I know this topic is pretty old but I am having trouble getting the _GetExtProperty and _GetFileProperty to work. This is not recognized at all for me with the latest version 3.6.6 and I have tried downloading beta. Has this been changed or am I still missing something?
gcue Posted November 8 Posted November 8 (edited) happy to contribute my finding. this addition shows the property name in addition to the property value for to ensure you are looking at the right property value :) Func _GetExtProperty($sPath, $iProp) Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty $iExist = FileExists($sPath) If $iExist = 0 Then SetError(1) Return 0 Else $sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1)) $sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1))) $oShellApp = ObjCreate ("shell.application") $oDir = $oShellApp.NameSpace ($sDir) $oFile = $oDir.Parsename ($sFile) If $iProp = -1 Then Local $aProperty[35][2] For $i = 0 To 34 $aProperty[$i][0] = $oDir.GetDetailsOf (Null, $i) $aProperty[$i][1] = $oDir.GetDetailsOf ($oFile, $i) Next Return $aProperty Else $sProperty = $oDir.GetDetailsOf ($oFile, $iProp) If $sProperty = "" Then Return 0 Else Return $sProperty EndIf EndIf EndIf EndFunc ;==>_GetExtProperty Edited November 8 by gcue
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