Jump to content

Launch an advanced association dialog box


Danyfirex
 Share

Recommended Posts

Well a Simple way to launch an advanced association dialog box to easy edit aplication association.

Local Const $sCLSID_LaunchAdvancedAssociationUI = "{1968106d-f3b5-44cf-890e-116fcb9ecef1}"
Local Const $sIID_ILaunchAdvancedAssociationUI = "{1f76a169-f994-40ac-8fc8-0959e8874710}"
Local Const $sTagILaunchAdvancedAssociationUI = "LaunchAdvancedAssociationUI hresult(wstr)"
; Create the object.




Local $aRegApp = _GetRegisteredApplications()

If IsArray($aRegApp) Then
    LaunchAdvancedAssociationUI($aRegApp[0])
EndIf

Func LaunchAdvancedAssociationUI($AppRegName)
    Local $oLaunchAdvancedAssociationUI = ObjCreateInterface($sCLSID_LaunchAdvancedAssociationUI, $sIID_ILaunchAdvancedAssociationUI, $sTagILaunchAdvancedAssociationUI)
    If Not IsObj($oLaunchAdvancedAssociationUI) Then Return False
    Return SUCCEEDED($oLaunchAdvancedAssociationUI.LaunchAdvancedAssociationUI($AppRegName))
EndFunc   ;==>LaunchAdvancedAssociationUI



Func _GetRegisteredApplications()
    Local $sWow64 = ""
    Local $sString = ""
    Local $aRegApp[0]
    Local $i = 1
    If @AutoItX64 Then $sWow64 = "\Wow6432Node"

    Do
        $sString = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE" & $sWow64 & "\RegisteredApplications", $i)
        If Not @error Then
            ReDim $aRegApp[$i]
            $aRegApp[$i - 1] = $sString
            $i += 1
        EndIf
    Until @error <> 0

    If $i = 1 Then Return 0
    Return $aRegApp


EndFunc   ;==>_GetRegisteredApplications

Func SUCCEEDED($hr)
    Return ($hr >= 0)
EndFunc   ;==>SUCCEEDED

Saludos

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...