Input for WinForms | ComponentOne
C1.Util.Win Namespace / Win32 Class / AssocQueryString Method
Use Win32.ASSOCF constants.
Use Win32.ASSOCSTR constants.

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