Last active
June 14, 2023 23:17
-
-
Save loic-sharma/c9f8ce625069e23149967c92a28acdbd to your computer and use it in GitHub Desktop.
Windows runner APIs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Create a view. The view controller takes ownership of the engine. | |
auto controller = FlutterDesktopViewControllerCreate(width, height, engine); | |
auto view = FlutterDesktopViewControllerGetView(controller); | |
HWND hwnd = FlutterDesktopViewGetHWND(view); | |
// Attach the view's HWND to the window... | |
// Run app... | |
// Destroy the view controller. This also destroys the view and the engine. | |
FlutterDesktopViewControllerDestroy(controller); | |
} | |
{ | |
// Create a view controller. This also creates an engine and a view. | |
auto controller = std::make_unique<flutter::FlutterViewController>( | |
width, height, project); | |
HWND hwnd = controller->view()->GetNativeWindow(); | |
// Attach the view's HWND to the window... | |
// Run app... | |
// Destroy the view controller. This also destroys the view and the engine. | |
controller.reset(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment