OPENASINFO structure (shlobj_core.h)
Stores information for the SHOpenWithDialog function.
typedef struct _openasinfo {
LPCWSTR pcszFile;
LPCWSTR pcszClass;
OPEN_AS_INFO_FLAGS oaifInFlags;
} OPENASINFO, *POPENASINFO;
pcszFile
Type: LPCWSTR
A pointer to the file name.
pcszClass
Type: LPCWSTR
A pointer to the file type description. Set this parameter to NULL to use the file name extension of pcszFile.
oaifInFlags
Type: OPEN_AS_INFO_FLAGS
The characteristics of the SHOpenWithDialog dialog box. One or more of the following values.
Enable the "always use this program" checkbox. If not passed, it will be disabled.
Do the registration after the user hits the OK button.
Execute file after registering.
Force the Always use this program checkbox to be checked. Typically, you won't use the OAIF_ALLOW_REGISTRATION flag when you pass this value.
Introduced in Windows Vista. Hide the Always use this program checkbox. If this flag is specified, the OAIF_ALLOW_REGISTRATION and OAIF_FORCE_REGISTRATION flags will be ignored.
Introduced in Windows Vista. The value for the extension that is passed is actually a protocol, so the Open With dialog box should show applications that are registered as capable of handling that protocol.
Introduced in Windows 8. The location pointed to by the pcszFile parameter is given as a URI.
Starting in Windows 10, the OAIF_ALLOW_REGISTRATION, OAIF_FORCE_REGISTRATION, and OAIF_HIDE_REGISTRATION flags will be ignored by SHOpenWithDialog. The Open With dialog box can no longer be used to change the default program used to open a file extension. You can only use SHOpenWithDialog to open a single file.
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Header | shlobj_core.h (include Shlobj.h) |