mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[CPL][APPWIZ] Make gecko download cancellable by keyboard (#3726)
We shouldn't disable nor hide the control with focus. CORE-17550, CORE-5737
This commit is contained in:
+18
-2
@@ -388,9 +388,17 @@ static DWORD WINAPI download_proc(PVOID arg)
|
||||
|
||||
static INT_PTR CALLBACK installer_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND hwndProgress, hwndInstallButton;
|
||||
switch(msg) {
|
||||
case WM_INITDIALOG:
|
||||
ShowWindow(GetDlgItem(hwnd, ID_DWL_PROGRESS), SW_HIDE);
|
||||
|
||||
hwndProgress = GetDlgItem(hwnd, ID_DWL_PROGRESS);
|
||||
if (hwndProgress == GetFocus()) /* Avoid CORE-5737 */
|
||||
{
|
||||
SendMessageW(hwnd, WM_NEXTDLGCTL, 0, FALSE);
|
||||
}
|
||||
ShowWindow(hwndProgress, SW_HIDE);
|
||||
|
||||
install_dialog = hwnd;
|
||||
return TRUE;
|
||||
|
||||
@@ -410,7 +418,15 @@ static INT_PTR CALLBACK installer_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
|
||||
|
||||
case ID_DWL_INSTALL:
|
||||
ShowWindow(GetDlgItem(hwnd, ID_DWL_PROGRESS), SW_SHOW);
|
||||
EnableWindow(GetDlgItem(hwnd, ID_DWL_INSTALL), 0);
|
||||
|
||||
/* CORE-17550: Never leave focus on a disabled control (Old/New/Thing p.228) */
|
||||
hwndInstallButton = GetDlgItem(hwnd, ID_DWL_INSTALL);
|
||||
if (hwndInstallButton == GetFocus())
|
||||
{
|
||||
SendMessageW(hwnd, WM_NEXTDLGCTL, 0, FALSE);
|
||||
}
|
||||
EnableWindow(hwndInstallButton, FALSE);
|
||||
|
||||
CloseHandle( CreateThread(NULL, 0, download_proc, NULL, 0, NULL));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user