https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9789e9c409286fe09b50f2a5f55f3a0d3fc7dba9
commit 9789e9c409286fe09b50f2a5f55f3a0d3fc7dba9 Author: Jose Carlos Jesus <zecarlos1...@hotmail.com> AuthorDate: Fri Sep 16 16:40:01 2022 +0100 Commit: Stanislav Motylkov <x86co...@gmail.com> CommitDate: Wed Oct 12 22:12:19 2022 +0300 [COMCTL32] Read caret width from registry Add caret width value to EDITSTATE structure. To keep the same behavior as Windows Server 2003, we need to update dwCaretWidth when EDIT_WM_SetFocus is called. CORE-18151 --- dll/win32/comctl32/edit.c | 6 ++++++ win32ss/user/user32/controls/edit.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/dll/win32/comctl32/edit.c b/dll/win32/comctl32/edit.c index a6a04fe330a..a568b060fd9 100644 --- a/dll/win32/comctl32/edit.c +++ b/dll/win32/comctl32/edit.c @@ -103,6 +103,9 @@ typedef struct HFONT font; /* NULL means standard system font */ INT x_offset; /* scroll offset for multi lines this is in pixels for single lines it's in characters */ +#ifdef __REACTOS__ + DWORD dwCaretWidth; +#endif INT line_height; /* height of a screen line in pixels */ INT char_width; /* average character width in pixels */ DWORD style; /* sane version of wnd->dwStyle */ @@ -3691,6 +3694,9 @@ static void EDIT_WM_SetFocus(HTHEME theme, EDITSTATE *es) if (!(es->style & ES_NOHIDESEL)) EDIT_InvalidateText(es, es->selection_start, es->selection_end); +#ifdef __REACTOS__ + SystemParametersInfo(SPI_GETCARETWIDTH, 0, &es->dwCaretWidth, 0); +#endif CreateCaret(es->hwndSelf, 0, 1, es->line_height); EDIT_SetCaretPos(es, es->selection_end, es->flags & EF_AFTER_WRAP); ShowCaret(es->hwndSelf); diff --git a/win32ss/user/user32/controls/edit.c b/win32ss/user/user32/controls/edit.c index 9fc7d3f0f0d..bed1ad46fe5 100644 --- a/win32ss/user/user32/controls/edit.c +++ b/win32ss/user/user32/controls/edit.c @@ -102,6 +102,9 @@ typedef struct HFONT font; /* NULL means standard system font */ INT x_offset; /* scroll offset for multi lines this is in pixels for single lines it's in characters */ +#ifdef __REACTOS__ + DWORD dwCaretWidth; +#endif INT line_height; /* height of a screen line in pixels */ INT char_width; /* average character width in pixels */ DWORD style; /* sane version of wnd->dwStyle */ @@ -3905,6 +3908,9 @@ static void EDIT_WM_SetFocus(EDITSTATE *es) ReleaseDC(es->hwndSelf, hdc); } +#ifdef __REACTOS__ + SystemParametersInfo(SPI_GETCARETWIDTH, 0, &es->dwCaretWidth, 0); +#endif CreateCaret(es->hwndSelf, 0, 1, es->line_height); EDIT_SetCaretPos(es, es->selection_end, es->flags & EF_AFTER_WRAP);