ComponentOne SuperTooltip for WinForms
C1.Win.4.8 Assembly / C1.Util.Win Namespace / Win32 Class / AssocQueryString Method
Use Win32.ASSOCF constants.
Use Win32.ASSOCSTR constants.

In This Topic
    AssocQueryString Method (Win32)
    In This Topic
    Gets file-association string from the registry.
    Syntax
    'Declaration
     
    Public Shared Function AssocQueryString( _
       ByVal flags As System.Integer, _
       ByVal str As System.Integer, _
       ByVal pszAssoc As System.String, _
       ByVal pszExtra As System.String, _
       ByVal pszOut As System.Text.StringBuilder, _
       ByRef pcchOut As System.UInteger _
    ) As System.UInteger
    public static System.uint AssocQueryString( 
       System.int flags,
       System.int str,
       System.string pszAssoc,
       System.string pszExtra,
       System.Text.StringBuilder pszOut,
       ref System.uint pcchOut
    )

    Parameters

    flags
    Use Win32.ASSOCF constants.
    str
    Use Win32.ASSOCSTR constants.
    pszAssoc
    pszExtra
    pszOut
    pcchOut

    Return Value

    An Win32.OLE success/error code.
    Remarks
    To get associated exe's length/exe: uint assocLen = 0; AssocQueryString(ASSOCF.ASSOCF_INIT_DEFAULTTOSTAR,ASSOCSTR.ASSOCSTR_EXECUTABLE,Path.GetExtension(OutputFileName),"open",null,ref assocLen); For existing files, another option is FindExecutable.
    See Also