as i needed to get the name of the executable from the association name, i did that little snippet
If someone could find it useful
Code: Select all
Enumeration
#ASSOCSTR_COMMAND = 1
#ASSOCSTR_EXECUTABLE
#ASSOCSTR_FRIENDLYDOCNAME
#ASSOCSTR_FRIENDLYAPPNAME
#ASSOCSTR_NOOPEN
#ASSOCSTR_SHELLNEWVALUE
#ASSOCSTR_DDECOMMAND
#ASSOCSTR_DDEIFEXEC
#ASSOCSTR_DDEAPPLICATION
#ASSOCSTR_DDETOPIC
#ASSOCSTR_INFOTIP
#ASSOCSTR_QUICKTIP
#ASSOCSTR_TILEINFO
#ASSOCSTR_CONTENTTYPE
#ASSOCSTR_DEFAULTICON
#ASSOCSTR_SHELLEXTENSION
#ASSOCSTR_DROPTARGET
#ASSOCSTR_DELEGATEEXECUTE
#ASSOCSTR_MAX
EndEnumeration
Enumeration
#ASSOCF_INIT_NOREMAPCLSID = $00000001
#ASSOCF_INIT_BYEXENAME = $00000002
#ASSOCF_OPEN_BYEXENAME = $00000002
#ASSOCF_INIT_DEFAULTTOSTAR = $00000004
#ASSOCF_INIT_DEFAULTTOFOLDER = $00000008
#ASSOCF_NOUSERSETTINGS = $00000010
#ASSOCF_NOTRUNCATE = $00000020
#ASSOCF_VERIFY = $00000040
#ASSOCF_REMAPRUNDLL = $00000080
#ASSOCF_NOFIXUPS = $00000100
#ASSOCF_IGNOREBASECLASS = $00000200
#ASSOCF_INIT_IGNOREUNKNOWN = $00000400
EndEnumeration
pcchOut.l = #MAX_PATH
pszOut.s = Space(pcchOut)
flags = #ASSOCF_NOTRUNCATE | #ASSOCF_REMAPRUNDLL
pszAssoc.s = ".htm"
pszExtra.s = "open"
If OpenLibrary(0, "Shlwapi.dll")
*AssocQueryString = GetFunction(0, "AssocQueryStringA")
If *AssocQueryString
hresult = CallFunctionFast(*AssocQueryString, flags, #ASSOCSTR_EXECUTABLE, @pszAssoc, @pszExtra, @pszOut, @pcchOut)
Select hresult
Case #S_OK
Debug "Executable name for '"+pszAssoc+"' : "+pszOut
Case #S_FALSE
Debug "pszOut is NULL. pcchOut contains the required buffer size"
Case #E_POINTER
Debug "The pszOut buffer is too small to hold the entire string"
Default
Debug "No association defined for extension '"+pszAssoc+"'"
EndSelect
EndIf
EndIf
