mirror of
https://github.com/reactos/reactos.git
synced 2026-06-05 03:02:59 +08:00
[WINLOGON] Let the dialog manager manage the default focus (#8337)
- The single default button in the "Shutdown Computer" and "GINA failed to load" dialogs will be automatically focused by the dialog manager, so there is no need to invoke `SetFocus()` in their `WM_INITDIALOG` handler -- which also erroneously returned `TRUE`, thus ignoring any focus set by the caller :D - Use `DeleteMenu()` instead of `RemoveMenu()` so that it'll free any memory resources.
This commit is contained in:
@@ -1122,8 +1122,8 @@ ShutdownComputerWindowProc(
|
||||
}
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
RemoveMenu(GetSystemMenu(hwndDlg, FALSE), SC_CLOSE, MF_BYCOMMAND);
|
||||
SetFocus(GetDlgItem(hwndDlg, IDC_BTNSHTDOWNCOMPUTER));
|
||||
/* Remove the Close menu item */
|
||||
DeleteMenu(GetSystemMenu(hwndDlg, FALSE), SC_CLOSE, MF_BYCOMMAND);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,8 +431,6 @@ GinaLoadFailedWindowProc(
|
||||
wsprintfW(text, templateText, (LPWSTR)lParam);
|
||||
SetDlgItemTextW(hwndDlg, IDC_GINALOADFAILED, text);
|
||||
}
|
||||
|
||||
SetFocus(GetDlgItem(hwndDlg, IDOK));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user