IApplicationAssociationRegistration::QueryCurrentDefault method (shobjidl_core.h)
Determines the default application for a given association type. This is the default application launched by ShellExecute for that type.
HRESULT QueryCurrentDefault( LPCWSTR pszQuery, ASSOCIATIONTYPE atQueryType, ASSOCIATIONLEVEL alQueryLevel, LPWSTR *ppszAssociation );
A pointer to a null-terminated, Unicode string that contains the file name extension or protocol, such as .mp3 or http.
One of the ASSOCIATIONTYPE enumeration values that specifies the type of association, such as extension or MIME type.
When this method returns, contains the address of a pointer to the ProgID that identifies the current default association.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
The string produced is typically a ProgID matching one of the ProgIDs associated with a registered application, but there are a few exceptions: If the string returned is a machine default protocol, it is a legacy string indicating a command line to a .exe handler instead of a ProgID. Similarly, if returning a machine default MIME type, it returns a legacy class identifier (CLSID) string instead of a ProgID.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|
|Header||shobjidl_core.h (include Shobjidl.h)|