[SHValidateUNC is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]
Validates a Universal Naming Convention (UNC) path by calling WNetAddConnection3. The function makes it possible for the user to type a remote network access (RNA) UNC application or document name from the Run dialog box on the Start menu.
BOOL SHValidateUNC( HWND hwndOwner, PWSTR pszFile, UINT fConnect );
Handle of the parent window, used to display UI. If this is not needed, this value can be set to NULL.
A pointer to a null-terminated Unicode string that specifies the UNC path to validate. Note: This string must not be a constant string.
One or more of the following values.
Connect a drive letter. When this flag is set, the value in pszFile is changed to the local drive to which the UNC is mapped on the local machine.
On either failure or success, display no UI.
Validate as a print share rather than disk share.
Windows Vista and later. The connection should be made persistent.
Mask value used to verify that the flags passed to SHValidateUNC are valid.
Returns TRUE if the UNC path exists; FALSE if the UNC path does not exist or if some other failure occurred.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|Header||shlobj_core.h (include Shlobj.h)|
|DLL||Shell32.dll (version 5.00 or later)|