36#define DEFAULT_DOUBLE_CLICK_SPEED 500
37#define DEFAULT_CLICK_LOCK_TIME 2200
38#define DEFAULT_MOUSE_SPEED 10
39#define DEFAULT_MOUSE_ACCELERATION 1
40#define DEFAULT_MOUSE_THRESHOLD1 6
41#define DEFAULT_MOUSE_THRESHOLD2 10
42#define MIN_DOUBLE_CLICK_SPEED 200
43#define MAX_DOUBLE_CLICK_SPEED 900
44#define DEFAULT_WHEEL_SCROLL_LINES 3
142 TCHAR szBuffer[2048];
162 Guids[0] = GUID_DEVCLASS_MOUSE;
173 sizeof(Guids) /
sizeof(Guids[0]),
204 pos = (pButtonData->g_ClickLockTime - 200) / 200;
253 pButtonData->g_OrigSwapMouseButtons = pButtonData->g_SwapMouseButtons;
255 pButtonData->g_OrigDoubleClickSpeed = pButtonData->g_DoubleClickSpeed;
269 if (pButtonData->g_SwapMouseButtons)
279 if (pButtonData->g_ClickLockEnabled)
296 pButtonData->bClicked =
TRUE;
314 pButtonData->g_SwapMouseButtons =
FALSE;
320 pButtonData->g_SwapMouseButtons =
TRUE;
334 pButtonData->g_ClickLockEnabled =
FALSE;
340 pButtonData->g_ClickLockEnabled =
TRUE;
353 pButtonData->bClicked = !pButtonData->bClicked;
355 (
LPARAM)(pButtonData->bClicked ? pButtonData->hIcon1 : pButtonData->hIcon2));
365 if (pButtonData->g_OrigSwapMouseButtons != pButtonData->g_SwapMouseButtons)
367 pButtonData->g_OrigSwapMouseButtons = pButtonData->g_SwapMouseButtons;
374#if (WINVER >= 0x0500)
376 if (pButtonData->g_ClickLockEnabled)
404 pButtonData->g_DoubleClickSpeed = (14 - (
INT)lResult) * 50 + 200;
411 pButtonData->g_DoubleClickSpeed = (14 - (
INT)
HIWORD(
wParam)) * 50 + 200;
433 DWORD dwProgramFiles;
439 if (dwUserProfile > 0 &&
_tcsncmp(lpPath, szUserProfile, dwUserProfile) == 0)
441 _tcscpy(lpShortPath,
_T(
"%USERPROFILE%"));
442 _tcscat(lpShortPath, &lpPath[dwUserProfile]);
444 else if (dwSystemRoot > 0 &&
_tcsncmp(lpPath, szSystemRoot, dwSystemRoot) == 0)
446 _tcscpy(lpShortPath,
_T(
"%SystemRoot%"));
447 _tcscat(lpShortPath, &lpPath[dwSystemRoot]);
449 else if (dwProgramFiles > 0 &&
_tcsncmp(lpPath, szProgramFiles, dwProgramFiles) == 0)
451 _tcscpy(lpShortPath,
_T(
"%ProgramFiles%"));
452 _tcscat(lpShortPath, &lpPath[dwProgramFiles]);
469 TCHAR szValueData[2000];
470 TCHAR szTempData[2000];
484 for (dwIndex = 0;; dwIndex++)
486 dwValueName =
sizeof(szValueName) /
sizeof(
TCHAR);
487 dwValueData =
sizeof(szValueData) /
sizeof(
TCHAR);
488 lError =
RegEnumValue(hCursorKey, dwIndex, szValueName, &dwValueName,
500 if (szTempData[0] ==
_T(
'"'))
502 lpStart = szTempData + 1;
503 szTempData[
_tcslen(szTempData) - 1] = 0;
507 lpStart = szTempData;
522 _T(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cursors\\Schemes"),
528 for (dwIndex = 0;; dwIndex++)
530 dwValueName =
sizeof(szValueName) /
sizeof(
TCHAR);
531 dwValueData =
sizeof(szValueData) /
sizeof(
TCHAR);
532 lError =
RegEnumValue(hCursorKey, dwIndex, szValueName, &dwValueName,
542 if (szValueData[0] ==
_T(
'"'))
544 lpStart = szValueData + 1;
545 szValueData[
_tcslen(szValueData) - 1] = 0;
549 lpStart = szValueData;
555 _tcscat(szValueName, szSystemScheme);
611 TCHAR szRawText[256];
629 _stprintf(szText, szRawText, szSchemeName);
721 szNewSchemeName[0] = 0;
727 if (
_tcsstr(szNewSchemeName, szSystemScheme))
729 szNewSchemeName[
_tcslen(szNewSchemeName) -
_tcslen(szSystemScheme) - 1] = 0;
743 bSchemeExists =
FALSE;
744 for (
i = 0;
i < nSel;
i++)
749 if (
_tcscmp(szSchemeName, szNewSchemeName) == 0)
751 bSchemeExists =
TRUE;
838 memset(szFileName, 0x0,
sizeof(szFileName));
900 pStart = pStart + (
nLength + 1);
1039 DWORD dwSchemeSource = 0;
1051 _T(
"Control Panel\\Cursors"),
1058 dwDataSize =
sizeof(
DWORD);
1060 _T(
"Scheme Source"),
1066 if (dwSchemeSource != 0)
1105 if (dwSchemeSource == 0)
1109 else if (dwSchemeSource == 2)
1134 DWORD dwSchemeSource;
1144 if (lpSchemeData ==
NULL)
1148 szSchemeName[0] = 0;
1156 if (
_tcsstr(szSchemeName, szSystemScheme))
1160 szSchemeName[
_tcslen(szSchemeName) -
_tcslen(szSystemScheme) - 1] = 0;
1168 dwNameLength = (
_tcslen(szSchemeName) + 1) *
sizeof(
TCHAR);
1176 (
LPBYTE)szSchemeName, dwNameLength);
1224 pPointerData->bOrigCursorShadow = pPointerData->bCursorShadow;
1226 if (pPointerData->bCursorShadow)
1255 if (pPointerData->bOrigCursorShadow != pPointerData->bCursorShadow)
1258 pPointerData->bOrigCursorShadow = pPointerData->bCursorShadow;
1356 pPointerData->bCursorShadow =
FALSE;
1365 pPointerData->bCursorShadow =
TRUE;
1402 pOptionData->ulOrigMouseSpeed = pOptionData->ulMouseSpeed;
1411 pOptionData->OrigMouseAccel.nAcceleration = pOptionData->MouseAccel.nAcceleration;
1412 pOptionData->OrigMouseAccel.nThreshold1 = pOptionData->MouseAccel.nThreshold1;
1413 pOptionData->OrigMouseAccel.nThreshold2 = pOptionData->MouseAccel.nThreshold2;
1417 pOptionData->bOrigSnapToDefaultButton = pOptionData->bSnapToDefaultButton;
1421 pOptionData->uOrigMouseTrails = pOptionData->uMouseTrails;
1425 pOptionData->bOrigMouseVanish = pOptionData->bMouseVanish;
1429 pOptionData->bOrigMouseSonar = pOptionData->bMouseSonar;
1436 if (pOptionData->MouseAccel.nAcceleration)
1442 if (pOptionData->bSnapToDefaultButton)
1451 if (pOptionData->uMouseTrails < 2)
1464 if (pOptionData->bMouseVanish)
1470 if (pOptionData->bMouseSonar)
1488 pOptionData->MouseAccel.nAcceleration = 0;
1489 pOptionData->MouseAccel.nThreshold1 = 0;
1490 pOptionData->MouseAccel.nThreshold2 = 0;
1495 pOptionData->MouseAccel.nAcceleration = 1;
1496 pOptionData->MouseAccel.nThreshold1 = 6;
1497 pOptionData->MouseAccel.nThreshold2 = 10;
1506 pOptionData->bSnapToDefaultButton = 0;
1511 pOptionData->bSnapToDefaultButton = 1;
1525 pOptionData->uMouseTrails = 0;
1541 pOptionData->bMouseVanish =
FALSE;
1546 pOptionData->bMouseVanish =
TRUE;
1555 pOptionData->bMouseSonar =
FALSE;
1560 pOptionData->bMouseSonar =
TRUE;
1575 if (pOptionData->ulOrigMouseSpeed != pOptionData->ulMouseSpeed)
1578 pOptionData->ulOrigMouseSpeed = pOptionData->ulMouseSpeed;
1581 if (pOptionData->OrigMouseAccel.nAcceleration != pOptionData->MouseAccel.nAcceleration)
1584 pOptionData->OrigMouseAccel.nAcceleration = pOptionData->MouseAccel.nAcceleration;
1585 pOptionData->OrigMouseAccel.nThreshold1 = pOptionData->MouseAccel.nThreshold1;
1586 pOptionData->OrigMouseAccel.nThreshold2 = pOptionData->MouseAccel.nThreshold2;
1591 if (pOptionData->bOrigSnapToDefaultButton != pOptionData->bSnapToDefaultButton)
1594 pOptionData->bOrigSnapToDefaultButton = pOptionData->bSnapToDefaultButton;
1598 if (pOptionData->uOrigMouseTrails != pOptionData->uMouseTrails)
1601 pOptionData->uOrigMouseTrails = pOptionData->uMouseTrails;
1605 if (pOptionData->bOrigMouseVanish != pOptionData->bMouseVanish)
1608 pOptionData->bOrigMouseVanish = pOptionData->bMouseVanish;
1612 if (pOptionData->bOrigMouseSonar != pOptionData->bMouseSonar)
1615 pOptionData->bOrigMouseSonar = pOptionData->bMouseSonar;
1849 psh.hwndParent =
hwnd;
1877 if (nPage != 0 && nPage <= psh.nPages)
1878 psh.nStartPage = nPage;
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
#define RegCloseKey(hKey)
#define OFN_FILEMUSTEXIST
OPENFILENAMEA OPENFILENAME
#define CPLPAGE_MOUSE_BUTTONS
#define CPLPAGE_MOUSE_WHEEL
#define CPLPAGE_MOUSE_PTRMOTION
HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
struct _OPTION_DATA OPTION_DATA
struct _MOUSE_ACCEL MOUSE_ACCEL
struct _POINTER_DATA * PPOINTER_DATA
static VOID LoadCursorScheme(LPTSTR lpName, BOOL bSystem)
#define DEFAULT_MOUSE_THRESHOLD2
static BOOL BrowseCursor(HWND hwndDlg)
static INT_PTR CALLBACK WheelProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
static VOID OnDrawItem(UINT idCtl, LPDRAWITEMSTRUCT lpdis, PPOINTER_DATA pPointerData)
struct _BUTTON_DATA * PBUTTON_DATA
struct _WHEEL_DATA * PWHEEL_DATA
#define DEFAULT_MOUSE_ACCELERATION
LONG APIENTRY MouseApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
struct _WHEEL_DATA WHEEL_DATA
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
struct _CURSOR_DATA * PCURSOR_DATA
static VOID CompressPath(LPTSTR lpShortPath, LPTSTR lpPath)
static BOOL SaveCursorScheme(HWND hwndDlg)
static INT_PTR CALLBACK MouseHardwareProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
struct _OPTION_DATA * POPTION_DATA
static INT_PTR CALLBACK SaveSchemeProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
struct _POINTER_DATA POINTER_DATA
static INT_PTR CALLBACK ClickLockProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
struct _BUTTON_DATA BUTTON_DATA
static INT_PTR CALLBACK PointerProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
static INT_PTR CALLBACK ButtonProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
#define DEFAULT_MOUSE_SPEED
#define DEFAULT_MOUSE_THRESHOLD1
#define DEFAULT_WHEEL_SCROLL_LINES
static VOID LoadInitialCursorScheme(HWND hwndDlg)
static BOOL EnumerateCursorSchemes(HWND hwndDlg)
static VOID ReloadCurrentCursorScheme(VOID)
CURSOR_DATA g_CursorData[]
static VOID LoadNewCursorScheme(HWND hwndDlg)
struct _CURSOR_DATA CURSOR_DATA
static VOID ShowDialogWheelControls(HWND hwndDlg, UINT uWheelScrollLines, BOOL bInit)
static BOOL ApplyCursorScheme(HWND hwndDlg)
static BOOL DeleteUserCursorScheme(HWND hwndDlg)
static const struct @222 PropPages[]
static VOID RefreshCursorList(HWND hwndDlg, BOOL bInit)
static INT_PTR CALLBACK OptionProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
#define IDC_UPDOWN_WHEEL_SCROLL_LINES
#define IDC_EDIT_SCHEME_NAME
#define IDC_SLIDER_MOUSE_SPEED
#define IDS_SYSTEM_SCHEME
#define IDC_EDIT_WHEEL_SCROLL_LINES
#define IDC_SLIDER_POINTER_TRAIL
#define IDC_BUTTON_CLICK_LOCK
#define IDC_IMAGE_DOUBLE_CLICK_SPEED
#define IDS_OVERWRITE_TEXT
#define IDC_SWAP_MOUSE_BUTTONS
#define IDC_CHECK_SHOW_POINTER
#define IDC_RADIO_WHEEL_SCROLL_LINES
#define IDC_CHECK_POINTER_TRAIL
#define IDC_BUTTON_DELETE_SCHEME
#define IDC_CHECK_POINTER_PRECISION
#define IDC_BUTTON_BROWSE_CURSOR
#define IDC_RADIO_WHEEL_SCROLL_PAGE
#define IDC_CHECK_CURSOR_SHADOW
#define IDC_CHECK_CLICK_LOCK
#define IDC_TEXT_TRAIL_LONG
#define IDC_LISTBOX_CURSOR
#define IDI_FOLDER_CLOSED
#define IDC_BUTTON_SAVEAS_SCHEME
#define IDC_TEXT_TRAIL_SHORT
#define IDC_CHECK_SNAP_TO
#define IDC_COMBO_CURSOR_SCHEME
#define IDC_IMAGE_CURRENT_CURSOR
#define IDC_BUTTON_USE_DEFAULT_CURSOR
#define IDS_BROWSE_FILTER
#define IDC_SLIDER_CLICK_LOCK
#define IDS_OVERWRITE_TITLE
#define IDC_IMAGE_SWAP_MOUSE
#define IDC_SLIDER_DOUBLE_CLICK_SPEED
#define IDC_CHECK_HIDE_POINTER
#define IDD_CURSOR_SCHEME_SAVEAS
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
#define ERROR_NO_MORE_ITEMS
#define HeapFree(x, y, z)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
TCHAR szTitle[MAX_LOADSTRING]
static char szTempPath[MAX_PATH]
struct _PSP * HPROPSHEETPAGE
#define UNREFERENCED_PARAMETER(P)
#define PropSheet_Changed(d, w)
struct _PSHNOTIFY * LPPSHNOTIFY
#define REGSTR_PATH_CONTROLSFOLDER
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
TCHAR szCursorName[MAX_PATH]
TCHAR szCursorPath[MAX_PATH]
BOOL bSnapToDefaultButton
BOOL bOrigSnapToDefaultButton
MOUSE_ACCEL OrigMouseAccel
#define GetEnvironmentVariable
#define ExpandEnvironmentStrings
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
BOOL WINAPI SetDoubleClickTime(_In_ UINT)
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
struct tagMEASUREITEMSTRUCT * LPMEASUREITEMSTRUCT
BOOL WINAPI DrawIcon(_In_ HDC, _In_ int, _In_ int, _In_ HICON)
#define CB_FINDSTRINGEXACT
UINT WINAPI GetDoubleClickTime(void)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SPIF_UPDATEINIFILE
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
#define SPI_SETDOUBLECLICKTIME
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define COLOR_HIGHLIGHTTEXT
HWND WINAPI GetParent(_In_ HWND)
#define SPI_SETMOUSEBUTTONSWAP
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
#define SystemParametersInfo
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SendDlgItemMessage
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
#define SPI_SETWHEELSCROLLLINES