Skip to content

Commit fc69815

Browse files
committed
[windows] Implement close method #56
1 parent 35313b5 commit fc69815

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

windows/window_manager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

133134
void WindowManager::WaitUntilReadyToShow() {}
134135

136+
void WindowManager::Close() {
137+
HWND hWnd = GetMainWindow();
138+
CloseWindow(hWnd);
139+
}
140+
135141
void WindowManager::Focus() {
136142
HWND hWnd = GetMainWindow();
137143
if (IsMinimized()) {

windows/window_manager_plugin.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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));

0 commit comments

Comments
 (0)