[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
This commit is contained in:
Jose Carlos Jesus 2022-09-16 16:40:01 +01:00 committed by Stanislav Motylkov
parent d794996217
commit 9789e9c409
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92
2 changed files with 12 additions and 0 deletions

View file

@ -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);

View file

@ -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);