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/modules/rostests/winetests/comctl32/testlist.c b/modules/rostests/winetests/comctl32/testlist.c index e05eb6af53a..4ec747c5c15 100644 --- a/modules/rostests/winetests/comctl32/testlist.c +++ b/modules/rostests/winetests/comctl32/testlist.c @@ -1,5 +1,14 @@ /* Automatically generated file; DO NOT EDIT!! */ +int o_main( int argc, char **argv ); +int __stdcall SetEnvironmentVariableA(const char* var, const char* val); +int main( int argc, char **argv ) +{ + SetEnvironmentVariableA("WINETEST_REPORT_SUCCESS", "1"); + return o_main(argc, argv); +} +#define main o_main + #define STANDALONE #include 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))