From 28fb2f01ef23ccaf7ea67698f02fdfd176683a3b Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sat, 17 Nov 2007 17:31:43 +0000 Subject: [PATCH] credui: Ensure that the foreground window doesn't get changed while the user is typing in their password. This doesn't currently work on Wine as LockSetForegroundWindow isn't implemented, but when it does it should work nicely. --- dlls/credui/credui_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/credui/credui_main.c b/dlls/credui/credui_main.c index e7960d480d8..33292f55ca5 100644 --- a/dlls/credui/credui_main.c +++ b/dlls/credui/credui_main.c @@ -288,6 +288,16 @@ static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case MAKELONG(IDCANCEL, BN_CLICKED): EndDialog(hwndDlg, IDCANCEL); return TRUE; + case MAKELONG(IDC_PASSWORD, EN_SETFOCUS): + /* don't allow another window to steal focus while the + * user is typing their password */ + LockSetForegroundWindow(LSFW_LOCK); + return TRUE; + case MAKELONG(IDC_PASSWORD, EN_KILLFOCUS): + /* the user is no longer typing their password, so allow + * other windows to become foreground ones */ + LockSetForegroundWindow(LSFW_UNLOCK); + return TRUE; } /* fall through */ default: