mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
[windows] hideWindowOnClose partial solution
This commit is contained in:
parent
a2d95e1b99
commit
7f841ab85b
1 changed files with 11 additions and 1 deletions
|
|
@ -139,8 +139,16 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
|||
|
||||
switch(msg) {
|
||||
|
||||
case WM_CLOSE: {
|
||||
DestroyWindow( app->window );
|
||||
break;
|
||||
}
|
||||
case WM_DESTROY: {
|
||||
PostQuitMessage(0);
|
||||
if( app->hideWindowOnClose ) {
|
||||
Hide(app);
|
||||
} else {
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_SIZE: {
|
||||
|
|
@ -711,6 +719,8 @@ void SetPosition(struct Application* app, int x, int y) {
|
|||
}
|
||||
|
||||
void Quit(struct Application* app) {
|
||||
// Override the hide window on close flag
|
||||
app->hideWindowOnClose = 0;
|
||||
ON_MAIN_THREAD(
|
||||
DestroyWindow(app->window);
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue