mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:45:50 +00:00
Add code that applies the currently selected cursor scheme.
svn path=/trunk/; revision=26540
This commit is contained in:
parent
aa12c0e3e3
commit
d7d69d0175
1 changed files with 63 additions and 2 deletions
|
@ -122,7 +122,7 @@ typedef struct _CURSOR_DATA
|
||||||
{
|
{
|
||||||
UINT uStringId;
|
UINT uStringId;
|
||||||
UINT uDefaultCursorId;
|
UINT uDefaultCursorId;
|
||||||
LPWSTR lpValueName;
|
LPTSTR lpValueName;
|
||||||
HCURSOR hCursor;
|
HCURSOR hCursor;
|
||||||
TCHAR szCursorName[MAX_PATH];
|
TCHAR szCursorName[MAX_PATH];
|
||||||
TCHAR szCursorPath[MAX_PATH];
|
TCHAR szCursorPath[MAX_PATH];
|
||||||
|
@ -1030,7 +1030,68 @@ LoadNewCursorScheme(HWND hwndDlg, BOOL bInit)
|
||||||
static BOOL
|
static BOOL
|
||||||
ApplyCursorScheme(HWND hwndDlg)
|
ApplyCursorScheme(HWND hwndDlg)
|
||||||
{
|
{
|
||||||
/* FIXME: Apply the cursor scheme */
|
TCHAR szSchemeName[MAX_PATH];
|
||||||
|
TCHAR szSystemScheme[MAX_PATH];
|
||||||
|
LPTSTR lpSchemeData;
|
||||||
|
DWORD dwNameLength;
|
||||||
|
DWORD dwSchemeSource;
|
||||||
|
UINT index, i;
|
||||||
|
HKEY hCursorKey;
|
||||||
|
INT nSel;
|
||||||
|
|
||||||
|
nSel = SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETCURSEL, 0, 0);
|
||||||
|
if (nSel == CB_ERR)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
lpSchemeData = (LPTSTR)SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETITEMDATA, nSel, 0);
|
||||||
|
if (lpSchemeData == NULL)
|
||||||
|
{
|
||||||
|
/* "None" cursor scheme */
|
||||||
|
dwSchemeSource = 0;
|
||||||
|
szSchemeName[0] = 0;
|
||||||
|
dwNameLength = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETLBTEXT, nSel, (LPARAM)szSchemeName);
|
||||||
|
LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH);
|
||||||
|
|
||||||
|
if (_tcsstr(szSchemeName, szSystemScheme))
|
||||||
|
{
|
||||||
|
/* System scheme */
|
||||||
|
dwSchemeSource = 2;
|
||||||
|
szSchemeName[_tcslen(szSchemeName) - _tcslen(szSystemScheme) - 1] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* User scheme */
|
||||||
|
dwSchemeSource = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
dwNameLength = (_tcslen(szSchemeName) + 1) * sizeof(TCHAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Cursors"), 0,
|
||||||
|
KEY_READ | KEY_SET_VALUE, &hCursorKey) != ERROR_SUCCESS)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
RegSetValueEx(hCursorKey, NULL, 0, REG_SZ,
|
||||||
|
(LPBYTE)szSchemeName, dwNameLength);
|
||||||
|
|
||||||
|
RegSetValueEx(hCursorKey, _T("Scheme Source"), 0, REG_DWORD,
|
||||||
|
(LPBYTE)&dwSchemeSource, sizeof(DWORD));
|
||||||
|
|
||||||
|
for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
|
||||||
|
{
|
||||||
|
RegSetValueEx(hCursorKey, g_CursorData[i].lpValueName, 0,
|
||||||
|
REG_EXPAND_SZ, (LPBYTE)g_CursorData[i].szCursorPath,
|
||||||
|
(_tcslen(g_CursorData[i].szCursorPath) + 1) * sizeof(TCHAR));
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(hCursorKey);
|
||||||
|
|
||||||
|
/* Force the system to reload its cursors */
|
||||||
|
SystemParametersInfo(SPI_SETCURSORS, 0, NULL, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue