diff --git a/dll/win32/comctl32/edit.c b/dll/win32/comctl32/edit.c index 5185605eb72..fc6b53755ef 100644 --- a/dll/win32/comctl32/edit.c +++ b/dll/win32/comctl32/edit.c @@ -1752,6 +1752,11 @@ static void EDIT_SetCaretPos(EDITSTATE *es, INT pos, #ifdef __REACTOS__ HKL hKL = GetKeyboardLayout(0); POINT pt = { (short)LOWORD(res), (short)HIWORD(res) }; + + /* Don't set caret if not focused */ + if ((es->flags & EF_FOCUSED) == 0) + return; + SetCaretPos(pt.x, pt.y); if (!ImmIsIME(hKL)) diff --git a/win32ss/user/user32/controls/edit.c b/win32ss/user/user32/controls/edit.c index d48e8e3b034..9b0eac86988 100644 --- a/win32ss/user/user32/controls/edit.c +++ b/win32ss/user/user32/controls/edit.c @@ -1907,6 +1907,11 @@ static void EDIT_SetCaretPos(EDITSTATE *es, INT pos, #ifdef __REACTOS__ HKL hKL = GetKeyboardLayout(0); POINT pt = { (short)LOWORD(res), (short)HIWORD(res) }; + + /* Don't set caret if not focused */ + if ((es->flags & EF_FOCUSED) == 0) + return; + SetCaretPos(pt.x, pt.y); if (!ImmIsIME(hKL))