WebViewEnableWindow Function  
 
BOOL WINAPI WebViewEnableWindow(
  HWND hWndHost,  
  BOOL bEnable  
);

The WebViewEnableWindow function enables or disables user input for the browser window.

Parameters

hWndHost
Handle to the window attached to the browser session.
bEnable
An integer value which specifies if the browser window should be enabled. If this value is non-zero, the window is enabled. If the value is zero, the window is disabled.

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

Disabling the browser window prevents it from receiving keyboard and mouse input. The host window itself remains enabled and can continue to process messages and receive user input. Disabling the browser window prevents it from receiving keyboard and mouse input, but does not hide the browser or prevent its content from being updated. The enabled state is independent of the browser's visibility, which can be controlled using the WebViewShowWindow function. To determine the current state of the browser window, use the WebViewIsEnabled function.

If the browser window has the keyboard focus when it is disabled, the focus is transferred to the host window. Enabling or disabling a browser window that is already in the requested state has no effect and is considered successful.

Applications should use this function to enable or disable the browser window rather than calling the Windows API EnableWindow function directly. Although the handle to the underlying browser window can be obtained using WebViewGetChildWindow, this window is managed internally by the Edge WebView2 control. Directly modifying its state or other window properties may interfere with the normal operation of the control and should be avoided unless required for advanced interoperability with other components.

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

See Also