fix: dialog is show when silent is true (#29)

`ShowWindow(hwdn, SW_HIDE)` does not work for the dialog (DialogBoxParamW); to achieve silence, it can only be implemented through `EndDialog`.

Since VSCode is relatively small in size, the dialog disappears quickly (around 200ms) during the upgrade process, so if you don't pay close attention, it goes unnoticed.

Signed-off-by: Kevin Cui <bh@bugs.cc>
This commit is contained in:
Kevin Cui 2024-11-18 22:13:51 +08:00 коммит произвёл GitHub
Родитель 7dea5043d3
Коммит 67d015baaf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -25,8 +25,8 @@ unsafe extern "system" fn dlgproc(hwnd: HWND, msg: u32, _: WPARAM, l: LPARAM) ->
use windows_sys::Win32::Foundation::RECT;
use windows_sys::Win32::System::Threading::GetCurrentThreadId;
use windows_sys::Win32::UI::WindowsAndMessaging::{
GetDesktopWindow, GetWindowRect, SendDlgItemMessageW, SetDlgItemTextW, SetWindowPos,
ShowWindow, HWND_TOPMOST, SW_HIDE, WM_DESTROY, WM_INITDIALOG, WM_USER,
EndDialog, GetDesktopWindow, GetWindowRect, SendDlgItemMessageW, SetDlgItemTextW,
SetWindowPos, HWND_TOPMOST, SW_HIDE, WM_DESTROY, WM_INITDIALOG, WM_USER,
};
match msg {
@ -62,7 +62,7 @@ unsafe extern "system" fn dlgproc(hwnd: HWND, msg: u32, _: WPARAM, l: LPARAM) ->
0,
);
} else {
ShowWindow(hwnd, SW_HIDE);
EndDialog(hwnd, 0);
}
data.tx