MCPcopy Create free account
hub / github.com/MicrosoftEdge/WebView2Samples / ComponentBase

Class ComponentBase

SampleApps/WebView2APISample/ComponentBase.h:21–35  ·  view source on GitHub ↗

A component is meant to encapsulate all details required for a specific capability of the AppWindow, typically demonstrating usage of a WebView2 API. Component instances are owned by an AppWindow, which will give each of its components a chance to handle any messages it gets. AppWindow deletes all its components when WebView is closed. Components are meant to be created and registered by AppWind

Source from the content-addressed store, hash-verified

19// user. Components typically take and keep a pointer to their owning AppWindow
20// so they can control the WebView.
21class ComponentBase
22{
23public:
24 // *result defaults to 0
25 virtual bool HandleWindowMessage(
26 HWND hWnd,
27 UINT message,
28 WPARAM wParam,
29 LPARAM lParam,
30 LRESULT* result)
31 {
32 return false;
33 }
34 virtual ~ComponentBase() { }
35};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected