Zebediah Figura : user32: Query CursorBlinkRate from the registry.
Alexandre Julliard
julliard at winehq.org
Tue Apr 26 16:25:26 CDT 2022
Module: wine
Branch: master
Commit: 535682cd79251c921121b0c87857a1f77cc27607
URL: https://source.winehq.org/git/wine.git/?a=commit;h=535682cd79251c921121b0c87857a1f77cc27607
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Tue Apr 26 16:06:03 2022 +0100
user32: Query CursorBlinkRate from the registry.
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/caret.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/caret.c b/dlls/user32/caret.c
index bdc7780bf8f..7b21e03c764 100644
--- a/dlls/user32/caret.c
+++ b/dlls/user32/caret.c
@@ -96,6 +96,24 @@ void CDECL toggle_caret( HWND hwnd )
}
+static unsigned int get_caret_registry_timeout(void)
+{
+ unsigned int ret = 500;
+ WCHAR value[11];
+ DWORD size;
+ HKEY key;
+
+ if (RegOpenKeyExW( HKEY_CURRENT_USER, L"Control Panel\\Desktop", 0, KEY_READ, &key ))
+ return ret;
+
+ size = sizeof(value);
+ if (!RegQueryValueExW( key, L"CursorBlinkRate", NULL, NULL, (BYTE *)value, &size ))
+ ret = wcstoul( value, NULL, 10 );
+ RegCloseKey( key );
+ return ret;
+}
+
+
/*****************************************************************
* CreateCaret (USER32.@)
*/
@@ -185,7 +203,8 @@ BOOL WINAPI CreateCaret( HWND hwnd, HBITMAP bitmap, INT width, INT height )
if (Caret.hBmp) DeleteObject( Caret.hBmp );
Caret.hBmp = hBmp;
- Caret.timeout = GetProfileIntA( "windows", "CursorBlinkRate", 500 );
+
+ Caret.timeout = get_caret_registry_timeout();
return TRUE;
}
More information about the wine-cvs
mailing list