WebViewUnmapVirtualHost Function  
 
BOOL WINAPI WebViewUnmapVirtualHost(
  HWND hWndHost,  
  LPCTSTR lpszHostName  
);

The WebViewUnmapVirtualHost function removes the mapping of a virtual host name to a folder path.

Parameters

hWndHost
Handle to the window attached to the browser session.
lpszHostName
A null-terminated string which specifies the virtual host name whose mapping should be removed. This parameter cannot be NULL or an empty string.

Return Value

If the function succeeds, the return value is non-zero. If the function fails, the return value is zero. To get extended error information, call WebViewGetLastError.

Remarks

The WebViewUnmapVirtualHost function removes a virtual host mapping previously established using WebViewMapVirtualHost. After the mapping is removed, the browser can no longer use the virtual host name to load resources from the associated local directory. This does not delete or modify any files in the directory, nor does it affect other virtual host mappings.

Removing a mapping only affects the browser instance specified by the hWndHost parameter. Other instances that have independently established a mapping for the same host name are not affected, even if they share the same browser environment or user data folder.

Removing a mapping does not automatically unload documents or resources that have already been loaded from the virtual host. However, subsequent requests for resources using that host name will no longer be resolved to the local directory. Applications should navigate to another document or reload the current document as appropriate after removing a mapping.

Virtual host mappings are automatically discarded when the browser instance is destroyed, so it is not necessary to explicitly remove them before closing the browser.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cshtmv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also