CWebView::EnableWindow Method  
 
BOOL EnableWindow(
  BOOL bEnable  
);

The EnableWindow method enables or disables user input for the browser window.

Parameters

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 method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

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 Show method. To determine the current state of the browser window, use the IsEnabled method.

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 method 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 GetChildWindow, 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