From 7b7e54bd7fabbfa8134363f83c983d94de075f0c Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Fri, 2 Nov 2007 10:42:07 -0700 Subject: [PATCH] Get cursor blink rate from registry, not win.ini --- dlls/user32/caret.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/dlls/user32/caret.c b/dlls/user32/caret.c index 8487f0c..476fcde 100644 --- a/dlls/user32/caret.c +++ b/dlls/user32/caret.c @@ -29,6 +29,7 @@ #include #include "windef.h" #include "winbase.h" #include "wingdi.h" +#include "winreg.h" #include "winuser.h" #include "wine/server.h" #include "wine/debug.h" @@ -110,12 +111,17 @@ static void CALLBACK CARET_Callback( HWN */ BOOL WINAPI CreateCaret( HWND hwnd, HBITMAP bitmap, INT width, INT height ) { + static const WCHAR Desktop[] = { 'C','o','n','t','r','o','l',' ','P','a', + 'n','e','l','\\','D','e','s','k','t','o','p',0 }; + static const WCHAR CursorBlinkRate[] = { 'C','u','r','s','o','r','B','l', + 'i','n','k','R','a','t','e',0 }; BOOL ret; RECT r; int old_state = 0; int hidden = 0; HBITMAP hBmp = 0; HWND prev = 0; + HKEY key; TRACE("hwnd=%p\n", hwnd); @@ -194,7 +200,16 @@ BOOL WINAPI CreateCaret( HWND hwnd, HBIT if (Caret.hBmp) DeleteObject( Caret.hBmp ); Caret.hBmp = hBmp; - Caret.timeout = GetProfileIntA( "windows", "CursorBlinkRate", 500 ); + Caret.timeout = 500; + if (!RegCreateKeyExW(HKEY_CURRENT_USER, Desktop, 0, NULL, 0, KEY_READ, + NULL, &key, NULL)) + { + DWORD size = sizeof(Caret.timeout); + + RegQueryValueExW(key, CursorBlinkRate, NULL, NULL, + (BYTE *)&Caret.timeout, &size); + RegCloseKey(key); + } return TRUE; } -- 1.4.1