Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

docs.flutter.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.

Learn more

Flutter 3.41 is live! Check out theFlutter 3.41 blog post!

Introduction of FlutterEngine::ProcessExternalWindowMessage

External windows should call ProcessExternalWindowMessage to be considered for application lifecycle events.

Important

Summary

#

When you add any external windows to your Flutter app, you need to include them in the Window's app lifecycle logic. To include the window, itsWndProc function should invokeFlutterEngine::ProcessExternalWindowMessage.

Who is affected

#

Windows applications built against Flutter 3.13 or newer that open non-Flutter windows.

Description of change

#

Implementing application lifecycle on Windows involves listening for Window messages in order to update the lifecycle state. In order for additional non-Flutter windows to affect the lifecycle state, they must forward their window messages toFlutterEngine::ProcessExternalWindowMessage from theirWndProc functions. This function returns anstd::optional<LRESULT>, which isstd::nullopt when the message is received, but not consumed. When the returned result has a value, the message has been consumed, and further processing inWndProc should cease.

Migration guide

#

The following exampleWndProc procedure invokesFlutterEngine::ProcessExternalWindowMessage:

cpp
LRESULTWindow::Messagehandler(HWNDhwnd,UINTmsg,WPARAMwparam,LPARAMlparam){std::optional<LRESULT>result=flutter_controller_->engine()->ProcessExternalWindowMessage(hwnd,msg,wparam,lparam);if(result.has_value()){return*result;}// Original contents of WndProc...}

Timeline

#

Landed in version: 3.14.0-3.0.pre
In stable release: 3.16

References

#

Relevant PRs:

Was this page's content helpful?

Unless stated otherwise, the documentation on this site reflects Flutter 3.38.6. Page last updated on 2025-10-28.View source orreport an issue.


[8]ページ先頭

©2009-2026 Movatter.jp