File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class WindowManager {
4646 HWND GetMainWindow ();
4747 void WindowManager::SetAsFrameless ();
4848 void WindowManager::WaitUntilReadyToShow ();
49+ void WindowManager::Close ();
4950 void WindowManager::Focus ();
5051 void WindowManager::Blur ();
5152 void WindowManager::Show ();
@@ -132,6 +133,11 @@ void WindowManager::SetAsFrameless() {
132133
133134void WindowManager::WaitUntilReadyToShow () {}
134135
136+ void WindowManager::Close () {
137+ HWND hWnd = GetMainWindow ();
138+ CloseWindow (hWnd);
139+ }
140+
135141void WindowManager::Focus () {
136142 HWND hWnd = GetMainWindow ();
137143 if (IsMinimized ()) {
Original file line number Diff line number Diff line change @@ -221,6 +221,9 @@ void WindowManagerPlugin::HandleMethodCall(
221221 } else if (method_name.compare (" setAsFrameless" ) == 0 ) {
222222 window_manager->SetAsFrameless ();
223223 result->Success (flutter::EncodableValue (true ));
224+ } else if (method_name.compare (" close" ) == 0 ) {
225+ window_manager->Close ();
226+ result->Success (flutter::EncodableValue (true ));
224227 } else if (method_name.compare (" focus" ) == 0 ) {
225228 window_manager->Focus ();
226229 result->Success (flutter::EncodableValue (true ));
You can’t perform that action at this time.
0 commit comments