WebViewGetTimeout Function  
 
INT WINAPI WebViewGetTimeout(
  HWND hWndHost  
);

The WebViewGetTimeout function returns the number of seconds the client will wait for the navigation to complete.

Parameters

hWndHost
Handle to the window attached to the browser session.

Return Value

If the function succeeds, the return value is the timeout period in seconds. A value of zero specifies no timeout period has been specified.

Remarks

The WebViewGetTimeout function retrieves the current navigation timeout value, expressed in seconds. This value determines how long the library will wait for a navigation request to complete before it is considered to have failed due to a timeout condition.

If the timeout value is set to zero, the control uses the built-in timeouts defined by the underlying WebView2 browser engine. These internal timeouts are adaptive and depend on network conditions, DNS resolution, and connection establishment. In practice, this allows the browser to determine how long to wait before treating a navigation as unresponsive. For most applications, leaving the timeout set to zero provides behavior consistent with the Microsoft Edge browser.

If a non-zero timeout value has been set, navigation will be canceled if the specified number of seconds elapses without the page load completing. This provides a deterministic limit on how long a navigation attempt is allowed to continue before the operation fails. However, specifying a very long timeout value does not guarantee that navigation will continue for that entire duration, since the WebView2 engine may still enforce its own internal limits and terminate the request earlier.

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