Rob Shearman : credui: Ensure that the foreground window doesn' t get changed while the user is typing in their password.

Alexandre Julliard julliard at winehq.org
Mon Nov 19 08:19:40 CST 2007


Module: wine
Branch: master
Commit: 28fb2f01ef23ccaf7ea67698f02fdfd176683a3b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=28fb2f01ef23ccaf7ea67698f02fdfd176683a3b

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sat Nov 17 17:31:43 2007 +0000

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 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dlls/credui/credui_main.c b/dlls/credui/credui_main.c
index e7960d4..33292f5 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:




More information about the wine-cvs mailing list