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.
This commit is contained in:
Rob Shearman 2007-11-17 17:31:43 +00:00 committed by Alexandre Julliard
parent 4002964259
commit 28fb2f01ef
1 changed files with 10 additions and 0 deletions

View File

@ -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: