ReactOS  0.4.13-dev-563-g0561610
mouse.c File Reference
#include "main.h"
#include <commdlg.h>
#include <cplext.h>
#include <tchar.h>
Include dependency graph for mouse.c:

Go to the source code of this file.

Classes

struct  _BUTTON_DATA
 
struct  _POINTER_DATA
 
struct  _MOUSE_ACCEL
 
struct  _OPTION_DATA
 
struct  _WHEEL_DATA
 
struct  _CURSOR_DATA
 

Macros

#define DEFAULT_DOUBLE_CLICK_SPEED   500
 
#define DEFAULT_CLICK_LOCK_TIME   2200
 
#define DEFAULT_MOUSE_SPEED   10
 
#define DEFAULT_MOUSE_ACCELERATION   1
 
#define DEFAULT_MOUSE_THRESHOLD1   6
 
#define DEFAULT_MOUSE_THRESHOLD2   10
 
#define MIN_DOUBLE_CLICK_SPEED   200
 
#define MAX_DOUBLE_CLICK_SPEED   900
 
#define DEFAULT_WHEEL_SCROLL_LINES   3
 

Typedefs

typedef struct _BUTTON_DATA BUTTON_DATA
 
typedef struct _BUTTON_DATAPBUTTON_DATA
 
typedef struct _POINTER_DATA POINTER_DATA
 
typedef struct _POINTER_DATAPPOINTER_DATA
 
typedef struct _MOUSE_ACCEL MOUSE_ACCEL
 
typedef struct _OPTION_DATA OPTION_DATA
 
typedef struct _OPTION_DATAPOPTION_DATA
 
typedef struct _WHEEL_DATA WHEEL_DATA
 
typedef struct _WHEEL_DATAPWHEEL_DATA
 
typedef struct _CURSOR_DATA CURSOR_DATA
 
typedef struct _CURSOR_DATAPCURSOR_DATA
 

Functions

static INT_PTR CALLBACK MouseHardwareProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK ClickLockProc (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)
 
static VOID CompressPath (LPTSTR lpShortPath, LPTSTR lpPath)
 
static BOOL EnumerateCursorSchemes (HWND hwndDlg)
 
static VOID RefreshCursorList (HWND hwndDlg, BOOL bInit)
 
static BOOL DeleteUserCursorScheme (HWND hwndDlg)
 
static INT_PTR CALLBACK SaveSchemeProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static BOOL SaveCursorScheme (HWND hwndDlg)
 
static BOOL BrowseCursor (HWND hwndDlg)
 
static VOID LoadCursorScheme (LPTSTR lpName, BOOL bSystem)
 
static VOID ReloadCurrentCursorScheme (VOID)
 
static VOID OnDrawItem (UINT idCtl, LPDRAWITEMSTRUCT lpdis, PPOINTER_DATA pPointerData)
 
static VOID LoadNewCursorScheme (HWND hwndDlg)
 
static VOID LoadInitialCursorScheme (HWND hwndDlg)
 
static BOOL ApplyCursorScheme (HWND hwndDlg)
 
static INT_PTR CALLBACK PointerProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK OptionProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static VOID ShowDialogWheelControls (HWND hwndDlg, UINT uWheelScrollLines, BOOL bInit)
 
static INT_PTR CALLBACK WheelProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
LONG APIENTRY MouseApplet (HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 

Variables

CURSOR_DATA g_CursorData []
 
struct {
   WORD   idDlg
 
   DLGPROC   DlgProc
 
   UINT   uiReplaceWith
 
PropPages []
 

Macro Definition Documentation

◆ DEFAULT_CLICK_LOCK_TIME

#define DEFAULT_CLICK_LOCK_TIME   2200

Definition at line 37 of file mouse.c.

◆ DEFAULT_DOUBLE_CLICK_SPEED

#define DEFAULT_DOUBLE_CLICK_SPEED   500

Definition at line 36 of file mouse.c.

◆ DEFAULT_MOUSE_ACCELERATION

#define DEFAULT_MOUSE_ACCELERATION   1

Definition at line 39 of file mouse.c.

◆ DEFAULT_MOUSE_SPEED

#define DEFAULT_MOUSE_SPEED   10

Definition at line 38 of file mouse.c.

◆ DEFAULT_MOUSE_THRESHOLD1

#define DEFAULT_MOUSE_THRESHOLD1   6

Definition at line 40 of file mouse.c.

◆ DEFAULT_MOUSE_THRESHOLD2

#define DEFAULT_MOUSE_THRESHOLD2   10

Definition at line 41 of file mouse.c.

◆ DEFAULT_WHEEL_SCROLL_LINES

#define DEFAULT_WHEEL_SCROLL_LINES   3

Definition at line 44 of file mouse.c.

◆ MAX_DOUBLE_CLICK_SPEED

#define MAX_DOUBLE_CLICK_SPEED   900

Definition at line 43 of file mouse.c.

◆ MIN_DOUBLE_CLICK_SPEED

#define MIN_DOUBLE_CLICK_SPEED   200

Definition at line 42 of file mouse.c.

Typedef Documentation

◆ BUTTON_DATA

◆ CURSOR_DATA

◆ MOUSE_ACCEL

◆ OPTION_DATA

◆ PBUTTON_DATA

◆ PCURSOR_DATA

◆ POINTER_DATA

◆ POPTION_DATA

◆ PPOINTER_DATA

◆ PWHEEL_DATA

◆ WHEEL_DATA

Function Documentation

◆ ApplyCursorScheme()

static BOOL ApplyCursorScheme ( HWND  hwndDlg)
static

Definition at line 1127 of file mouse.c.

1128 {
1129  TCHAR szSchemeName[MAX_PATH];
1130  TCHAR szSystemScheme[MAX_PATH];
1132  LPTSTR lpSchemeData;
1133  DWORD dwNameLength;
1134  DWORD dwSchemeSource;
1135  UINT index, i;
1136  HKEY hCursorKey;
1137  INT nSel;
1138 
1140  if (nSel == CB_ERR)
1141  return FALSE;
1142 
1143  lpSchemeData = (LPTSTR)SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETITEMDATA, nSel, 0);
1144  if (lpSchemeData == NULL)
1145  {
1146  /* "None" cursor scheme */
1147  dwSchemeSource = 0;
1148  szSchemeName[0] = 0;
1149  dwNameLength = 0;
1150  }
1151  else
1152  {
1153  SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETLBTEXT, nSel, (LPARAM)szSchemeName);
1154  LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH);
1155 
1156  if (_tcsstr(szSchemeName, szSystemScheme))
1157  {
1158  /* System scheme */
1159  dwSchemeSource = 2;
1160  szSchemeName[_tcslen(szSchemeName) - _tcslen(szSystemScheme) - 1] = 0;
1161  }
1162  else
1163  {
1164  /* User scheme */
1165  dwSchemeSource = 1;
1166  }
1167 
1168  dwNameLength = (_tcslen(szSchemeName) + 1) * sizeof(TCHAR);
1169  }
1170 
1171  if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Cursors"), 0,
1172  KEY_READ | KEY_SET_VALUE, &hCursorKey) != ERROR_SUCCESS)
1173  return FALSE;
1174 
1175  RegSetValueEx(hCursorKey, NULL, 0, REG_SZ,
1176  (LPBYTE)szSchemeName, dwNameLength);
1177 
1178  RegSetValueEx(hCursorKey, _T("Scheme Source"), 0, REG_DWORD,
1179  (LPBYTE)&dwSchemeSource, sizeof(DWORD));
1180 
1181  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
1182  {
1183  CompressPath(szTempPath, g_CursorData[i].szCursorPath);
1184  RegSetValueEx(hCursorKey, g_CursorData[i].lpValueName, 0,
1186  (_tcslen(szTempPath) + 1) * sizeof(TCHAR));
1187  }
1188 
1189  RegCloseKey(hCursorKey);
1190 
1191  /* Force the system to reload its cursors */
1193 
1194  return TRUE;
1195 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define KEY_READ
Definition: nt_native.h:1023
#define CB_GETLBTEXT
Definition: winuser.h:1913
#define CB_GETITEMDATA
Definition: winuser.h:1911
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:79
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
#define SystemParametersInfo
Definition: winuser.h:5724
HINSTANCE hApplet
Definition: access.c:17
#define IDS_SYSTEM_SCHEME
Definition: resource.h:54
#define SendDlgItemMessage
Definition: winuser.h:5708
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1904
CHAR * LPTSTR
Definition: xmlstorage.h:192
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
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
#define CB_ERR
Definition: winuser.h:2389
#define _tcsstr
Definition: xmlstorage.h:199
static TCHAR szTempPath[MAX_PATH]
Definition: CImage.cpp:45
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define index(s, c)
Definition: various.h:29
#define IDS_ARROW
Definition: resource.h:38
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static VOID CompressPath(LPTSTR lpShortPath, LPTSTR lpPath)
Definition: mouse.c:426
#define RegOpenKeyEx
Definition: winreg.h:520
#define IDS_HAND
Definition: resource.h:52
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
unsigned int UINT
Definition: ndis.h:50
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define REG_DWORD
Definition: sdbapi.c:596
#define RegSetValueEx
Definition: winreg.h:533
#define LoadString
Definition: winuser.h:5685
#define REG_SZ
Definition: layer.c:22

Referenced by PointerProc().

◆ BrowseCursor()

static BOOL BrowseCursor ( HWND  hwndDlg)
static

Definition at line 827 of file mouse.c.

828 {
829  TCHAR szFileName[MAX_PATH];
833  INT nSel;
834 
837 
838  memset(szFileName, 0x0, sizeof(szFileName));
839  nSel = SendDlgItemMessage(hwndDlg, IDC_LISTBOX_CURSOR, LB_GETCURSEL, 0, 0);
840  if (nSel == LB_ERR)
841  {
842  MessageBox(hwndDlg, _T("LB_ERR"), _T(""), MB_ICONERROR);
843  return FALSE;
844  }
845 
846  ZeroMemory(&ofn, sizeof(OPENFILENAME));
847  ofn.lStructSize = sizeof(OPENFILENAME);
848  ofn.hwndOwner = hwndDlg;
850  ofn.nFilterIndex = 1;
851  ofn.lpstrFile = szFileName;
853  ofn.lpstrInitialDir = _T("%WINDIR%\\Cursors");
856 
857  if (!GetOpenFileName(&ofn))
858  return FALSE;
859 
860  /* Store the new cursor file path */
861  _tcsncpy(g_CursorData[nSel].szCursorPath, szFileName, MAX_PATH);
862 
863  return TRUE;
864 }
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define OFN_EXPLORER
Definition: commdlg.h:104
#define TRUE
Definition: types.h:120
GLint x0
Definition: linetemp.h:95
HWND hwndOwner
Definition: commdlg.h:330
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
OPENFILENAME ofn
Definition: main.cpp:37
#define ZeroMemory
Definition: winbase.h:1635
HINSTANCE hApplet
Definition: access.c:17
#define SendDlgItemMessage
Definition: winuser.h:5708
int32_t INT
Definition: typedefs.h:56
#define GetOpenFileName
Definition: commdlg.h:665
DWORD nMaxFile
Definition: commdlg.h:337
#define IDS_BROWSE_FILTER
Definition: resource.h:55
#define LB_ERR
Definition: winuser.h:2386
LPTSTR szFilter
Definition: mplay32.c:30
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
#define IDC_LISTBOX_CURSOR
Definition: resource.h:78
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define MB_ICONERROR
Definition: winuser.h:781
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define MessageBox
Definition: winuser.h:5688
LPSTR lpstrFile
Definition: commdlg.h:336
LPCSTR lpstrFilter
Definition: commdlg.h:332
#define LB_GETCURSEL
Definition: winuser.h:2000
LPCSTR lpstrTitle
Definition: commdlg.h:341
DWORD nFilterIndex
Definition: commdlg.h:335
#define memset(x, y, z)
Definition: compat.h:39
#define IDS_BROWSE_TITLE
Definition: resource.h:56
#define LoadString
Definition: winuser.h:5685
DWORD Flags
Definition: commdlg.h:342

Referenced by PointerProc().

◆ ButtonProc()

static INT_PTR CALLBACK ButtonProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 233 of file mouse.c.

237 {
238  HWND hDlgCtrl;
239  LRESULT lResult;
240  LPPSHNOTIFY lppsn;
241 
242  PBUTTON_DATA pButtonData;
243 
244  pButtonData = (PBUTTON_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
245 
246  switch (uMsg)
247  {
248  case WM_INITDIALOG:
249  pButtonData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BUTTON_DATA));
250  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pButtonData);
251 
253  pButtonData->g_OrigSwapMouseButtons = pButtonData->g_SwapMouseButtons;
254  pButtonData->g_DoubleClickSpeed = GetDoubleClickTime();
255  pButtonData->g_OrigDoubleClickSpeed = pButtonData->g_DoubleClickSpeed;
256 
257  /* Click lock time */
258  SystemParametersInfo(SPI_GETMOUSECLICKLOCK, 0, &pButtonData->g_ClickLockEnabled, 0);
259  SystemParametersInfo(SPI_GETMOUSECLICKLOCKTIME, 0, &pButtonData->g_ClickLockTime, 0);
260 
261  /* Load mouse button icons */
264 
265  /* Load folder icons */
268 
269  if (pButtonData->g_SwapMouseButtons)
270  {
273  }
274  else
275  {
277  }
278 
279  if (pButtonData->g_ClickLockEnabled)
280  {
281  hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_CLICK_LOCK);
283  }
284  else
285  {
286  hDlgCtrl = GetDlgItem(hwndDlg, IDC_BUTTON_CLICK_LOCK);
287  EnableWindow(hDlgCtrl, FALSE);
288  }
289 
290  hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_DOUBLE_CLICK_SPEED);
291  SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 14));
292  SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, 14 - ((pButtonData->g_DoubleClickSpeed - 200) / 50));
293 
294 
296  pButtonData->bClicked = TRUE;
297  return TRUE;
298 
299  case WM_DESTROY:
300  DestroyIcon(pButtonData->hButtonLeft);
301  DestroyIcon(pButtonData->hButtonRight);
302  DestroyIcon(pButtonData->hIcon1);
303  DestroyIcon(pButtonData->hIcon2);
304  HeapFree(GetProcessHeap(), 0, pButtonData);
305  break;
306 
307  case WM_COMMAND:
308  switch(LOWORD(wParam))
309  {
311  lResult = SendMessage((HWND)lParam, BM_GETCHECK, (WPARAM)0, (LPARAM)0);
312  if (lResult == BST_CHECKED)
313  {
314  pButtonData->g_SwapMouseButtons = FALSE;
317  }
318  else if (lResult == BST_UNCHECKED)
319  {
320  pButtonData->g_SwapMouseButtons = TRUE;
323  }
324  //SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_SwapMouseButtons, NULL, 0);
325  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
326  break;
327 
329  lResult = SendMessage((HWND)lParam, BM_GETCHECK, (WPARAM)0, (LPARAM)0);
330  hDlgCtrl = GetDlgItem(hwndDlg, IDC_BUTTON_CLICK_LOCK);
331  if (lResult == BST_CHECKED)
332  {
334  pButtonData->g_ClickLockEnabled = FALSE;
335  EnableWindow(hDlgCtrl, FALSE);
336  }
337  else if (lResult == BST_UNCHECKED)
338  {
340  pButtonData->g_ClickLockEnabled = TRUE;
341  EnableWindow(hDlgCtrl, TRUE);
342  }
343  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
344  break;
345 
348  break;
349 
351  if (HIWORD(wParam) == STN_DBLCLK)
352  {
353  pButtonData->bClicked = !pButtonData->bClicked;
355  (LPARAM)(pButtonData->bClicked ? pButtonData->hIcon1 : pButtonData->hIcon2));
356  }
357  break;
358  }
359  break;
360 
361  case WM_NOTIFY:
362  lppsn = (LPPSHNOTIFY) lParam;
363  if (lppsn->hdr.code == PSN_APPLY)
364  {
365  if (pButtonData->g_OrigSwapMouseButtons != pButtonData->g_SwapMouseButtons)
366  {
367  pButtonData->g_OrigSwapMouseButtons = pButtonData->g_SwapMouseButtons;
369 
370  }
372  //SetDoubleClickTime(pButtonData->g_DoubleClickSpeed);
373 
374 #if (WINVER >= 0x0500)
375  SystemParametersInfo(SPI_SETMOUSECLICKLOCK, 0, UlongToPtr(pButtonData->g_ClickLockEnabled), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
376  if (pButtonData->g_ClickLockEnabled)
377  SystemParametersInfo(SPI_SETMOUSECLICKLOCKTIME, pButtonData->g_ClickLockTime, NULL, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
378 #endif
379  }
380  else if (lppsn->hdr.code == PSN_RESET)
381  {
382  /* Reset swap mouse button setting */
384 
385  /* Reset double click speed setting */
387  //SetDoubleClickTime(pButtonData->g_OrigDoubleClickSpeed);
388  }
389  return TRUE;
390 
391  case WM_HSCROLL:
393  {
394  switch (LOWORD(wParam))
395  {
396  case TB_LINEUP:
397  case TB_LINEDOWN:
398  case TB_PAGEUP:
399  case TB_PAGEDOWN:
400  case TB_TOP:
401  case TB_BOTTOM:
402  case TB_ENDTRACK:
404  pButtonData->g_DoubleClickSpeed = (14 - (INT)lResult) * 50 + 200;
405  //SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_DoubleClickSpeed, NULL, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
407  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
408  break;
409 
410  case TB_THUMBTRACK:
411  pButtonData->g_DoubleClickSpeed = (14 - (INT)HIWORD(wParam)) * 50 + 200;
412  //SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_DoubleClickSpeed, NULL, 0);
414  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
415  break;
416  }
417  }
418  break;
419  }
420 
421  return FALSE;
422 }
#define TB_THUMBTRACK
Definition: commctrl.h:2050
#define MAKEINTRESOURCE
Definition: winuser.h:591
HICON hButtonLeft
Definition: mouse.c:55
#define IDI_MOUSE_RIGHT
Definition: resource.h:11
#define TRUE
Definition: types.h:120
#define TB_PAGEDOWN
Definition: commctrl.h:2048
DWORD g_ClickLockTime
Definition: mouse.c:53
HICON hIcon1
Definition: mouse.c:58
#define IMAGE_ICON
Definition: winuser.h:212
#define SPI_SETMOUSEBUTTONSWAP
Definition: winuser.h:1364
BOOL WINAPI SetDoubleClickTime(_In_ UINT)
struct _PSHNOTIFY * LPPSHNOTIFY
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
HICON hIcon2
Definition: mouse.c:59
#define IDI_FOLDER_CLOSED
Definition: resource.h:9
#define INT
Definition: polytest.cpp:20
#define TBM_SETRANGE
Definition: commctrl.h:2009
#define SystemParametersInfo
Definition: winuser.h:5724
#define IDC_SWAP_MOUSE_BUTTONS
Definition: resource.h:63
#define TBM_SETPOS
Definition: commctrl.h:2008
#define IDC_IMAGE_DOUBLE_CLICK_SPEED
Definition: resource.h:83
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_APPLY
Definition: prsht.h:117
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define TB_PAGEUP
Definition: commctrl.h:2047
#define TB_LINEDOWN
Definition: commctrl.h:2046
#define STN_DBLCLK
Definition: winuser.h:2056
UINT code
Definition: winuser.h:3112
NMHDR hdr
Definition: prsht.h:312
#define TB_BOTTOM
Definition: commctrl.h:2052
struct _BUTTON_DATA * PBUTTON_DATA
static INT_PTR CALLBACK ClickLockProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:183
BOOL bClicked
Definition: mouse.c:60
#define TBM_GETPOS
Definition: commctrl.h:2003
#define IDC_SLIDER_DOUBLE_CLICK_SPEED
Definition: resource.h:64
ULONG g_SwapMouseButtons
Definition: mouse.c:48
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1879
#define UlongToPtr(u)
Definition: config.h:106
#define WM_DESTROY
Definition: winuser.h:1591
#define BM_SETCHECK
Definition: winuser.h:1882
#define IDC_IMAGE_SWAP_MOUSE
Definition: resource.h:82
#define GetProcessHeap()
Definition: compat.h:395
#define IDC_BUTTON_CLICK_LOCK
Definition: resource.h:66
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define IDI_MOUSE_LEFT
Definition: resource.h:10
int WINAPI GetSystemMetrics(_In_ int)
ULONG g_OrigSwapMouseButtons
Definition: mouse.c:49
#define TB_LINEUP
Definition: commctrl.h:2045
#define TB_ENDTRACK
Definition: commctrl.h:2053
#define DialogBoxParam
Definition: winuser.h:5630
#define TB_TOP
Definition: commctrl.h:2051
#define DWLP_USER
Definition: winuser.h:866
#define IDC_CHECK_CLICK_LOCK
Definition: resource.h:65
#define WM_COMMAND
Definition: winuser.h:1716
#define BST_UNCHECKED
Definition: winuser.h:199
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1363
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HICON hButtonRight
Definition: mouse.c:56
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
BOOL g_ClickLockEnabled
Definition: mouse.c:52
#define PSN_RESET
Definition: prsht.h:118
#define IDI_FOLDER_OPEN
Definition: resource.h:8
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_HSCROLL
Definition: winuser.h:1719
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define STM_SETIMAGE
Definition: winuser.h:2054
#define BST_CHECKED
Definition: winuser.h:197
#define SM_SWAPBUTTON
Definition: winuser.h:974
UINT WINAPI GetDoubleClickTime(void)
Definition: ntwrapper.h:314
#define SendMessage
Definition: winuser.h:5709
#define HIWORD(l)
Definition: typedefs.h:246
#define IDD_CLICK_LOCK
Definition: resource.h:31
#define LoadImage
Definition: winuser.h:5681
#define GetWindowLongPtr
Definition: treelist.c:73
LONG_PTR LRESULT
Definition: windef.h:209
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
ULONG g_OrigDoubleClickSpeed
Definition: mouse.c:51
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
ULONG g_DoubleClickSpeed
Definition: mouse.c:50
#define WM_NOTIFY
Definition: richedit.h:61

◆ ClickLockProc()

static INT_PTR CALLBACK ClickLockProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 183 of file mouse.c.

187 {
188  HWND hDlgCtrl;
189  int pos;
190  static HICON hIcon;
191 
192  PBUTTON_DATA pButtonData;
193 
194  pButtonData = (PBUTTON_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
195 
196  switch(uMsg)
197  {
198  case WM_INITDIALOG:
199  pButtonData = (PBUTTON_DATA)lParam;
200  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pButtonData);
201 
202  hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_CLICK_LOCK);
203  SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 10));
204  pos = (pButtonData->g_ClickLockTime - 200) / 200;
205  SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pos);
206 
208  IMAGE_ICON, 16, 16, 0);
209  SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
210  return TRUE;
211 
212  case WM_COMMAND:
213  if (LOWORD(wParam) == IDOK)
214  {
215  hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_CLICK_LOCK);
216  pButtonData->g_ClickLockTime = (DWORD) (SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) * 200) + 200;
217  EndDialog(hwndDlg, TRUE);
218  if (hIcon) DestroyIcon(hIcon);
219  }
220  else if (LOWORD(wParam) == IDCANCEL)
221  {
222  EndDialog(hwndDlg, FALSE);
223  if (hIcon) DestroyIcon(hIcon);
224  }
225  break;
226  }
227 
228  return FALSE;
229 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
DWORD g_ClickLockTime
Definition: mouse.c:53
#define IDOK
Definition: winuser.h:824
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define IDC_SLIDER_CLICK_LOCK
Definition: resource.h:94
#define TBM_SETRANGE
Definition: commctrl.h:2009
#define TBM_SETPOS
Definition: commctrl.h:2008
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
#define DWORD
Definition: nt_native.h:44
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define ICON_SMALL
Definition: tnclass.cpp:48
struct _BUTTON_DATA * PBUTTON_DATA
#define TBM_GETPOS
Definition: commctrl.h:2003
#define MAKELONG(a, b)
Definition: typedefs.h:248
LONG_PTR LPARAM
Definition: windef.h:208
#define IDI_LOOK_KEY
Definition: resource.h:21
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SendMessage
Definition: winuser.h:5709
#define LoadImage
Definition: winuser.h:5681
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by ButtonProc().

◆ CompressPath()

static VOID CompressPath ( LPTSTR  lpShortPath,
LPTSTR  lpPath 
)
static

Definition at line 426 of file mouse.c.

427 {
428  TCHAR szUserProfile[MAX_PATH];
429  TCHAR szSystemRoot[MAX_PATH];
430  TCHAR szProgramFiles[MAX_PATH];
431  DWORD dwUserProfile;
432  DWORD dwSystemRoot;
433  DWORD dwProgramFiles;
434 
435  dwUserProfile = GetEnvironmentVariable(_T("USERPROFILE"), szUserProfile, MAX_PATH);
436  dwSystemRoot = GetEnvironmentVariable(_T("SystemRoot"), szSystemRoot, MAX_PATH);
437  dwProgramFiles = GetEnvironmentVariable(_T("ProgramFiles"), szProgramFiles, MAX_PATH);
438 
439  if (dwUserProfile > 0 && _tcsncmp(lpPath, szUserProfile, dwUserProfile) == 0)
440  {
441  _tcscpy(lpShortPath, _T("%USERPROFILE%"));
442  _tcscat(lpShortPath, &lpPath[dwUserProfile]);
443  }
444  else if (dwSystemRoot > 0 && _tcsncmp(lpPath, szSystemRoot, dwSystemRoot) == 0)
445  {
446  _tcscpy(lpShortPath, _T("%SystemRoot%"));
447  _tcscat(lpShortPath, &lpPath[dwSystemRoot]);
448  }
449  else if (dwProgramFiles > 0 && _tcsncmp(lpPath, szProgramFiles, dwProgramFiles) == 0)
450  {
451  _tcscpy(lpShortPath, _T("%ProgramFiles%"));
452  _tcscat(lpShortPath, &lpPath[dwProgramFiles]);
453  }
454  else
455  {
456  _tcscpy(lpShortPath, lpPath);
457  }
458 }
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
#define GetEnvironmentVariable
Definition: winbase.h:3628
int _tcsncmp(const _TCHAR *s1, const _TCHAR *s2, size_t n)
Definition: tcsncmp.h:9

Referenced by ApplyCursorScheme(), and SaveCursorScheme().

◆ DeleteUserCursorScheme()

static BOOL DeleteUserCursorScheme ( HWND  hwndDlg)
static

Definition at line 607 of file mouse.c.

608 {
609  TCHAR szSchemeName[MAX_PATH];
610  TCHAR szTitle[128];
611  TCHAR szRawText[256];
612  TCHAR szText[256];
613  HWND hDlgCtrl;
614  HKEY hCuKey;
615  HKEY hCuCursorKey;
616  LONG lResult;
617  INT nSel;
618 
619  hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMBO_CURSOR_SCHEME);
620  nSel = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0);
621  if (nSel == CB_ERR)
622  return FALSE;
623 
624  SendMessage(hDlgCtrl, CB_GETLBTEXT, nSel, (LPARAM)szSchemeName);
625 
627  LoadString(hApplet, IDS_REMOVE_TEXT, szRawText, 256);
628 
629  _stprintf(szText, szRawText, szSchemeName);
630 
631  /* Confirm scheme removal */
632  if (MessageBox(hwndDlg, szText, szTitle, MB_YESNO | MB_ICONQUESTION) == IDNO)
633  return TRUE;
634 
636  return FALSE;
637 
638  if (RegOpenKeyEx(hCuKey, _T("Control Panel\\Cursors\\Schemes"), 0, KEY_READ | KEY_SET_VALUE, &hCuCursorKey) != ERROR_SUCCESS)
639  {
640  RegCloseKey(hCuKey);
641  return FALSE;
642  }
643 
644  lResult = RegDeleteValue(hCuCursorKey, szSchemeName);
645 
646  RegCloseKey(hCuCursorKey);
647  RegCloseKey(hCuKey);
648 
649  if (lResult == ERROR_SUCCESS)
650  {
651  SendMessage(hDlgCtrl, CB_DELETESTRING, nSel, 0);
652  SendMessage(hDlgCtrl, CB_SETCURSEL, (WPARAM)0, (LPARAM)0);
653  }
654 
655  return (lResult == ERROR_SUCCESS);
656 }
#define IDS_REMOVE_TEXT
Definition: resource.h:58
#define IDS_REMOVE_TITLE
Definition: resource.h:57
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define KEY_READ
Definition: nt_native.h:1023
#define CB_GETLBTEXT
Definition: winuser.h:1913
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:79
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1904
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define MB_YESNO
Definition: winuser.h:811
static const WCHAR szText[]
Definition: dialog.c:139
long LONG
Definition: pedump.c:60
#define MB_ICONQUESTION
Definition: winuser.h:783
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ERR
Definition: winuser.h:2389
char TCHAR
Definition: xmlstorage.h:189
#define RegDeleteValue
Definition: winreg.h:508
#define _T(x)
Definition: vfdio.h:22
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define MAX_PATH
Definition: compat.h:26
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define MessageBox
Definition: winuser.h:5688
#define CB_SETCURSEL
Definition: winuser.h:1922
#define _stprintf
Definition: utility.h:124
#define RegOpenKeyEx
Definition: winreg.h:520
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3232
#define SendMessage
Definition: winuser.h:5709
#define IDNO
Definition: winuser.h:830
#define CB_DELETESTRING
Definition: winuser.h:1898
#define LoadString
Definition: winuser.h:5685

Referenced by PointerProc().

◆ EnumerateCursorSchemes()

static BOOL EnumerateCursorSchemes ( HWND  hwndDlg)
static

Definition at line 462 of file mouse.c.

463 {
464  HKEY hCursorKey;
465  DWORD dwIndex;
466  TCHAR szValueName[MAX_PATH];
467  DWORD dwValueName;
468  TCHAR szSystemScheme[MAX_PATH];
469  TCHAR szValueData[2000];
470  TCHAR szTempData[2000];
471  DWORD dwValueData;
472  LONG lError;
473  HWND hDlgCtrl;
474  LRESULT lResult;
475 
476  hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMBO_CURSOR_SCHEME);
477  SendMessage(hDlgCtrl, CB_RESETCONTENT, 0, 0);
478 
479  /* Read the users cursor schemes */
480  lError = RegOpenKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Cursors\\Schemes"),
481  0, KEY_READ | KEY_QUERY_VALUE , &hCursorKey);
482  if (lError == ERROR_SUCCESS)
483  {
484  for (dwIndex = 0;; dwIndex++)
485  {
486  dwValueName = sizeof(szValueName) / sizeof(TCHAR);
487  dwValueData = sizeof(szValueData) / sizeof(TCHAR);
488  lError = RegEnumValue(hCursorKey, dwIndex, szValueName, &dwValueName,
489  NULL, NULL, (LPBYTE)szValueData, &dwValueData);
490  if (lError == ERROR_NO_MORE_ITEMS)
491  break;
492 
493  ExpandEnvironmentStrings(szValueData, szTempData, 2000);
494 
495  if (_tcslen(szTempData) > 0)
496  {
497  LPTSTR lpCopy, lpStart;
498 
499  /* Remove quotation marks */
500  if (szTempData[0] == _T('"'))
501  {
502  lpStart = szTempData + 1;
503  szTempData[_tcslen(szTempData) - 1] = 0;
504  }
505  else
506  {
507  lpStart = szTempData;
508  }
509 
510  lpCopy = _tcsdup(lpStart);
511 
512  lResult = SendMessage(hDlgCtrl, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValueName);
513  SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)lpCopy);
514  }
515  }
516 
517  RegCloseKey(hCursorKey);
518  }
519 
520  /* Read the system cursor schemes */
522  _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cursors\\Schemes"),
523  0, KEY_READ | KEY_QUERY_VALUE , &hCursorKey);
524  if (lError == ERROR_SUCCESS)
525  {
526  LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH);
527 
528  for (dwIndex = 0;; dwIndex++)
529  {
530  dwValueName = sizeof(szValueName) / sizeof(TCHAR);
531  dwValueData = sizeof(szValueData) / sizeof(TCHAR);
532  lError = RegEnumValue(hCursorKey, dwIndex, szValueName, &dwValueName,
533  NULL, NULL, (LPBYTE)szValueData, &dwValueData);
534  if (lError == ERROR_NO_MORE_ITEMS)
535  break;
536 
537  if (_tcslen(szValueData) > 0)
538  {
539  LPTSTR lpCopy, lpStart;
540 
541  /* Remove quotation marks */
542  if (szValueData[0] == _T('"'))
543  {
544  lpStart = szValueData + 1;
545  szValueData[_tcslen(szValueData) - 1] = 0;
546  }
547  else
548  {
549  lpStart = szValueData;
550  }
551 
552  lpCopy = _tcsdup(lpStart);
553 
554  _tcscat(szValueName, TEXT(" "));
555  _tcscat(szValueName, szSystemScheme);
556 
557  lResult = SendMessage(hDlgCtrl, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValueName);
558  SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)lpCopy);
559  }
560  }
561 
562  RegCloseKey(hCursorKey);
563  }
564 
565  /* Add the "(none)" entry */
566  LoadString(hApplet, IDS_NONE, szSystemScheme, MAX_PATH);
567  lResult = SendMessage(hDlgCtrl, CB_ADDSTRING, (WPARAM)0, (LPARAM)szSystemScheme);
568  SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)NULL);
569 
570  return TRUE;
571 }
#define CB_SETITEMDATA
Definition: winuser.h:1927
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define IDS_NONE
Definition: resource.h:122
#define ExpandEnvironmentStrings
Definition: winbase.h:3588
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:79
#define _tcsdup
Definition: tchar.h:625
HINSTANCE hApplet
Definition: access.c:17
#define IDS_SYSTEM_SCHEME
Definition: resource.h:54
UINT_PTR WPARAM
Definition: windef.h:207
CHAR * LPTSTR
Definition: xmlstorage.h:192
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
#define CB_ADDSTRING
Definition: winuser.h:1897
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_RESETCONTENT
Definition: winuser.h:1920
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RegOpenKeyEx
Definition: winreg.h:520
#define TEXT(s)
Definition: k32.h:26
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define SendMessage
Definition: winuser.h:5709
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
LONG RegEnumValue(HKEY Key, ULONG Index, PWCHAR ValueName, ULONG *NameSize, ULONG *Type, PUCHAR Data, ULONG *DataSize)
LONG_PTR LRESULT
Definition: windef.h:209
#define LoadString
Definition: winuser.h:5685
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by PointerProc().

◆ LoadCursorScheme()

static VOID LoadCursorScheme ( LPTSTR  lpName,
BOOL  bSystem 
)
static

Definition at line 868 of file mouse.c.

869 {
870  UINT index, i;
871 
872  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
873  {
874  if (g_CursorData[i].hCursor != NULL)
875  {
876  DestroyCursor(g_CursorData[i].hCursor);
877  g_CursorData[i].hCursor = 0;
878  }
879  g_CursorData[i].szCursorPath[0] = 0;
880  }
881 
882  if (lpName != NULL)
883  {
884  LPTSTR pStart = lpName;
885  LPTSTR pEnd = pStart;
886  INT nLength;
887 
888  i = 0;
889  while (pEnd)
890  {
891  pEnd = _tcschr(pStart, _T(','));
892  if (pEnd)
893  nLength = ((INT_PTR)pEnd - (INT_PTR)pStart) / sizeof(TCHAR);
894  else
895  nLength = _tcslen(pStart);
896 
897  _tcsncpy(g_CursorData[i].szCursorPath, pStart, nLength);
899 
900  pStart = pStart + (nLength + 1);
901  i++;
902  }
903 
904  }
905 
906  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
907  {
908  if (g_CursorData[i].szCursorPath[0] == 0)
910  IMAGE_CURSOR, 0, 0,
912  else
914  IMAGE_CURSOR, 0, 0,
916  }
917 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define LR_SHARED
Definition: winuser.h:1090
TCHAR szCursorPath[MAX_PATH]
Definition: mouse.c:116
#define LR_LOADFROMFILE
Definition: winuser.h:1082
#define IMAGE_CURSOR
Definition: winuser.h:213
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
_In_ DWORD nLength
Definition: wincon.h:461
_In_ LPCSTR lpName
Definition: winbase.h:2729
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
HICON HCURSOR
Definition: windef.h:284
int32_t INT_PTR
Definition: typedefs.h:62
int32_t INT
Definition: typedefs.h:56
CHAR * LPTSTR
Definition: xmlstorage.h:192
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
Definition: glfuncs.h:248
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
_TCHAR * _tcschr(const _TCHAR *s, _XINT c)
Definition: tcschr.h:4
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition: cursoricon.c:2654
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
#define index(s, c)
Definition: various.h:29
#define IDS_ARROW
Definition: resource.h:38
#define IDS_HAND
Definition: resource.h:52
unsigned int UINT
Definition: ndis.h:50
#define LoadImage
Definition: winuser.h:5681
HCURSOR hCursor
Definition: mouse.c:114

Referenced by LoadNewCursorScheme().

◆ LoadInitialCursorScheme()

static VOID LoadInitialCursorScheme ( HWND  hwndDlg)
static

Definition at line 1031 of file mouse.c.

1032 {
1033  TCHAR szSchemeName[MAX_PATH];
1034  TCHAR szSystemScheme[MAX_PATH];
1035  TCHAR szCursorPath[MAX_PATH];
1036  HKEY hCursorKey;
1037  LONG lError;
1038  DWORD dwDataSize;
1039  DWORD dwSchemeSource = 0;
1040  UINT index, i;
1041  DWORD dwType;
1042  INT nSel;
1043 
1044  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
1045  {
1046  g_CursorData[i].hCursor = 0;
1047  g_CursorData[i].szCursorPath[0] = 0;
1048  }
1049 
1051  _T("Control Panel\\Cursors"),
1052  0,
1054  &hCursorKey);
1055  if (lError != ERROR_SUCCESS)
1056  return;
1057 
1058  dwDataSize = sizeof(DWORD);
1059  lError = RegQueryValueEx(hCursorKey,
1060  _T("Scheme Source"),
1061  NULL,
1062  NULL,
1063  (LPBYTE)&dwSchemeSource,
1064  &dwDataSize);
1065 
1066  if (dwSchemeSource != 0)
1067  {
1068  dwDataSize = MAX_PATH * sizeof(TCHAR);
1069  lError = RegQueryValueEx(hCursorKey,
1070  NULL,
1071  NULL,
1072  NULL,
1073  (LPBYTE)szSchemeName,
1074  &dwDataSize);
1075 
1076  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
1077  {
1078  dwDataSize = MAX_PATH * sizeof(TCHAR);
1079  lError = RegQueryValueEx(hCursorKey,
1080  g_CursorData[i].lpValueName,
1081  NULL,
1082  &dwType,
1083  (LPBYTE)szCursorPath,
1084  &dwDataSize);
1085  if (lError == ERROR_SUCCESS)
1086  {
1087  if (dwType == REG_EXPAND_SZ)
1088  {
1089  ExpandEnvironmentStrings(szCursorPath, g_CursorData[i].szCursorPath, MAX_PATH);
1090  }
1091  else
1092  {
1093  _tcscpy(g_CursorData[i].szCursorPath, szCursorPath);
1094  }
1095  }
1096  }
1097  }
1098 
1099  RegCloseKey(hCursorKey);
1100 
1102  RefreshCursorList(hwndDlg, TRUE);
1103 
1104  /* Build the full scheme name */
1105  if (dwSchemeSource == 0)
1106  {
1107  LoadString(hApplet, IDS_NONE, szSchemeName, MAX_PATH);
1108  }
1109  else if (dwSchemeSource == 2)
1110  {
1111  LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH);
1112  _tcsncat(szSchemeName, _T(" "), MAX_PATH - _tcslen(szSchemeName) - 1);
1113  _tcsncat(szSchemeName, szSystemScheme, MAX_PATH - _tcslen(szSchemeName) - 1);
1114  }
1115 
1116  /* Search and select the current scheme name from the scheme list */
1117  nSel = SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_FINDSTRINGEXACT, -1, (LPARAM)szSchemeName);
1118  if (nSel != CB_ERR)
1120 
1121  /* Enable /disable delete button */
1122  EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_DELETE_SCHEME), (dwSchemeSource == 1));
1123 }
#define RegQueryValueEx
Definition: winreg.h:524
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
TCHAR szCursorPath[MAX_PATH]
Definition: mouse.c:116
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define IDS_NONE
Definition: resource.h:122
#define ExpandEnvironmentStrings
Definition: winbase.h:3588
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:79
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
HINSTANCE hApplet
Definition: access.c:17
#define IDS_SYSTEM_SCHEME
Definition: resource.h:54
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
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
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
#define CB_ERR
Definition: winuser.h:2389
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
_TCHAR * _tcsncat(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncat.h:5
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static VOID RefreshCursorList(HWND hwndDlg, BOOL bInit)
Definition: mouse.c:575
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_BUTTON_DELETE_SCHEME
Definition: resource.h:80
#define index(s, c)
Definition: various.h:29
#define IDS_ARROW
Definition: resource.h:38
#define CB_SETCURSEL
Definition: winuser.h:1922
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define RegOpenKeyEx
Definition: winreg.h:520
#define IDS_HAND
Definition: resource.h:52
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
unsigned int UINT
Definition: ndis.h:50
static VOID ReloadCurrentCursorScheme(VOID)
Definition: mouse.c:921
#define LoadString
Definition: winuser.h:5685
HCURSOR hCursor
Definition: mouse.c:114
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1901

Referenced by PointerProc().

◆ LoadNewCursorScheme()

static VOID LoadNewCursorScheme ( HWND  hwndDlg)
static

Definition at line 999 of file mouse.c.

1000 {
1002  TCHAR szSystemScheme[MAX_PATH];
1003  HWND hDlgCtrl;
1004  BOOL bEnable;
1005  LPTSTR lpName;
1006  INT nSel;
1007 
1009  if (nSel == CB_ERR)
1010  return;
1011 
1013 
1014  LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH);
1015  if (_tcsstr(buffer, szSystemScheme) || nSel == 0) // Avoid the default scheme - Can be deleted
1016  bEnable = FALSE;
1017  else
1018  bEnable = TRUE;
1019 
1020  /* Delete button */
1021  hDlgCtrl = GetDlgItem(hwndDlg, IDC_BUTTON_DELETE_SCHEME);
1022  EnableWindow(hDlgCtrl, bEnable);
1023 
1026  RefreshCursorList(hwndDlg, FALSE);
1027 }
static VOID LoadCursorScheme(LPTSTR lpName, BOOL bSystem)
Definition: mouse.c:868
#define TRUE
Definition: types.h:120
#define CB_GETLBTEXT
Definition: winuser.h:1913
#define CB_GETITEMDATA
Definition: winuser.h:1911
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:79
_In_ LPCSTR lpName
Definition: winbase.h:2729
GLuint buffer
Definition: glext.h:5915
HINSTANCE hApplet
Definition: access.c:17
#define IDS_SYSTEM_SCHEME
Definition: resource.h:54
#define SendDlgItemMessage
Definition: winuser.h:5708
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1904
CHAR * LPTSTR
Definition: xmlstorage.h:192
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ERR
Definition: winuser.h:2389
#define _tcsstr
Definition: xmlstorage.h:199
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static VOID RefreshCursorList(HWND hwndDlg, BOOL bInit)
Definition: mouse.c:575
#define MAX_PATH
Definition: compat.h:26
#define IDC_BUTTON_DELETE_SCHEME
Definition: resource.h:80
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
_In_ BOOL bEnable
Definition: winddi.h:3426
#define LoadString
Definition: winuser.h:5685

Referenced by PointerProc().

◆ MouseApplet()

LONG APIENTRY MouseApplet ( HWND  hwnd,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 1829 of file mouse.c.

1830 {
1832  PROPSHEETHEADER psh;
1833  HPSXA hpsxa;
1834  TCHAR Caption[256];
1835  UINT i;
1836  LONG ret;
1837 
1838  UNREFERENCED_PARAMETER(lParam1);
1839  UNREFERENCED_PARAMETER(lParam2);
1840  UNREFERENCED_PARAMETER(uMsg);
1842 
1843  LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR));
1844 
1845  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
1846  psh.dwSize = sizeof(PROPSHEETHEADER);
1847  psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
1848  psh.hwndParent = hwnd;
1849  psh.hInstance = hApplet;
1850  psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON_1);
1851  psh.pszCaption = Caption;
1852  psh.nStartPage = 0;
1853  psh.phpage = hpsp;
1854  psh.pfnCallback = PropSheetProc;
1855 
1856  /* Load additional pages provided by shell extensions */
1858 
1859  for (i = 0; i != sizeof(PropPages) / sizeof(PropPages[0]); i++)
1860  {
1861  /* Override the background page if requested by a shell extension */
1862  if (PropPages[i].uiReplaceWith != 0 && hpsxa != NULL &&
1864  {
1865  /* The shell extension added one or more pages to replace a page.
1866  Don't create the built-in page anymore! */
1867  continue;
1868  }
1869 
1871  }
1872 
1873  if (hpsxa != NULL)
1875 
1876  ret = (LONG)(PropertySheet(&psh) != -1);
1877 
1878  if (hpsxa != NULL)
1880 
1881  return ret;
1882 }
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:1755
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:1577
#define REGSTR_PATH_CONTROLSFOLDER
Definition: regstr.h:76
#define ZeroMemory
Definition: winbase.h:1635
HINSTANCE hApplet
Definition: access.c:17
UINT uiReplaceWith
Definition: mouse.c:1818
#define PSH_USECALLBACK
Definition: prsht.h:48
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: mouse.c:1798
#define MAX_CPL_PAGES
Definition: main.h:47
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
Definition: glfuncs.h:248
#define PSH_USEICONID
Definition: prsht.h:42
long LONG
Definition: pedump.c:60
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
WORD idDlg
Definition: mouse.c:1816
#define PROPSHEETHEADER
Definition: prsht.h:374
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_CPLNAME_1
Definition: resource.h:6
char TCHAR
Definition: xmlstorage.h:189
#define PSH_PROPTITLE
Definition: prsht.h:40
DLGPROC DlgProc
Definition: mouse.c:1817
int ret
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
Definition: propsheet.c:15
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: advmon.c:13
#define TEXT(s)
Definition: k32.h:26
static const struct @211 PropPages[]
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
Definition: shellord.c:1724
#define PropertySheet
Definition: prsht.h:382
#define IDC_CPLICON_1
Definition: resource.h:4
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
Definition: shellord.c:1607
#define LoadString
Definition: winuser.h:5685
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ MouseHardwareProc()

static INT_PTR CALLBACK MouseHardwareProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 156 of file mouse.c.

160 {
161  GUID Guids[1];
162  Guids[0] = GUID_DEVCLASS_MOUSE;
163 
166 
167  switch(uMsg)
168  {
169  case WM_INITDIALOG:
170  /* create the hardware page */
172  Guids,
173  sizeof(Guids) / sizeof(Guids[0]),
175  break;
176  }
177 
178  return FALSE;
179 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
WPARAM wParam
Definition: combotst.c:138
HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139

◆ OnDrawItem()

static VOID OnDrawItem ( UINT  idCtl,
LPDRAWITEMSTRUCT  lpdis,
PPOINTER_DATA  pPointerData 
)
static

Definition at line 943 of file mouse.c.

946 {
947  RECT rc;
948 
949  if (lpdis->itemState & ODS_SELECTED)
950  {
951  FillRect(lpdis->hDC,
952  &lpdis->rcItem,
953  (HBRUSH)(COLOR_HIGHLIGHT + 1));
954  SetBkColor(lpdis->hDC,
956  SetTextColor(lpdis->hDC,
958  }
959  else
960  {
961  FillRect(lpdis->hDC,
962  &lpdis->rcItem,
963  (HBRUSH)(COLOR_WINDOW + 1));
964  SetBkColor(lpdis->hDC,
966  SetTextColor(lpdis->hDC,
968  }
969 
970  if (lpdis->itemID != (UINT)-1)
971  {
972  CopyRect(&rc, &lpdis->rcItem);
973  rc.left += 5;
974  DrawText(lpdis->hDC,
976  -1,
977  &rc,
979 
980  if (g_CursorData[lpdis->itemData].hCursor != NULL)
981  {
982  DrawIcon(lpdis->hDC,
983  lpdis->rcItem.right - pPointerData->cxCursor - 4,
984  lpdis->rcItem.top + 2,
985  g_CursorData[lpdis->itemData].hCursor);
986  }
987  }
988 
989  if (lpdis->itemState & ODS_FOCUS)
990  {
991  CopyRect(&rc, &lpdis->rcItem);
992  InflateRect(&rc, -1, -1);
993  DrawFocusRect(lpdis->hDC, &rc);
994  }
995 }
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define COLOR_HIGHLIGHT
Definition: winuser.h:916
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT)
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
LONG top
Definition: windef.h:292
ULONG_PTR itemData
Definition: winuser.h:3046
#define ODS_FOCUS
Definition: winuser.h:2503
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define COLOR_WINDOW
Definition: winuser.h:908
DWORD WINAPI GetSysColor(_In_ int)
#define DrawText
Definition: winuser.h:5637
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
#define DT_LEFT
Definition: winuser.h:534
smooth NULL
Definition: ftsmooth.c:416
#define DT_VCENTER
Definition: winuser.h:543
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:917
INT cxCursor
Definition: mouse.c:69
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:886
#define DT_SINGLELINE
Definition: winuser.h:540
BOOL WINAPI DrawIcon(_In_ HDC, _In_ int, _In_ int, _In_ HICON)
Definition: cursoricon.c:1987
unsigned int UINT
Definition: ndis.h:50
#define ODS_SELECTED
Definition: winuser.h:2499
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
TCHAR szCursorName[MAX_PATH]
Definition: mouse.c:115
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HCURSOR hCursor
Definition: mouse.c:114

Referenced by PointerProc().

◆ OptionProc()

static INT_PTR CALLBACK OptionProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 1382 of file mouse.c.

1386 {
1387  POPTION_DATA pOptionData;
1388  HWND hDlgCtrl;
1389  LPPSHNOTIFY lppsn;
1390 
1391  pOptionData = (POPTION_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1392 
1393  switch(uMsg)
1394  {
1395  case WM_INITDIALOG:
1396  pOptionData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(OPTION_DATA));
1397  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pOptionData);
1398 
1399  /* Get mouse sensitivity */
1400  if (!SystemParametersInfo(SPI_GETMOUSESPEED, 0, &pOptionData->ulMouseSpeed, 0))
1401  pOptionData->ulMouseSpeed = DEFAULT_MOUSE_SPEED;
1402  pOptionData->ulOrigMouseSpeed = pOptionData->ulMouseSpeed;
1403 
1404 
1405  if (!SystemParametersInfo(SPI_GETMOUSE, 0, &pOptionData->MouseAccel, 0))
1406  {
1410  }
1411  pOptionData->OrigMouseAccel.nAcceleration = pOptionData->MouseAccel.nAcceleration;
1412  pOptionData->OrigMouseAccel.nThreshold1 = pOptionData->MouseAccel.nThreshold1;
1413  pOptionData->OrigMouseAccel.nThreshold2 = pOptionData->MouseAccel.nThreshold2;
1414 
1415  /* Snap to default button */
1416  SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0, &pOptionData->bSnapToDefaultButton, 0);
1417  pOptionData->bOrigSnapToDefaultButton = pOptionData->bSnapToDefaultButton;
1418 
1419  /* Mouse trails */
1420  SystemParametersInfo(SPI_GETMOUSETRAILS, 0, &pOptionData->uMouseTrails, 0);
1421  pOptionData->uOrigMouseTrails = pOptionData->uMouseTrails;
1422 
1423  /* Hide pointer while typing */
1424  SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &pOptionData->bMouseVanish, 0);
1425  pOptionData->bOrigMouseVanish = pOptionData->bMouseVanish;
1426 
1427  /* Show pointer with Ctrl-Key */
1428  SystemParametersInfo(SPI_GETMOUSESONAR, 0, &pOptionData->bMouseSonar, 0);
1429  pOptionData->bOrigMouseSonar = pOptionData->bMouseSonar;
1430 
1431  /* Set mouse speed */
1432  hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SPEED);
1433  SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(1, 20));
1434  SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pOptionData->ulMouseSpeed);
1435 
1436  if (pOptionData->MouseAccel.nAcceleration)
1437  {
1438  hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_POINTER_PRECISION);
1439  SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
1440  }
1441 
1442  if (pOptionData->bSnapToDefaultButton)
1443  {
1444  hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_SNAP_TO);
1445  SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
1446  }
1447 
1448  /* Set mouse trail */
1449  hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL);
1450  SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 5));
1451  if (pOptionData->uMouseTrails < 2)
1452  {
1453  SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)5);
1454  EnableWindow(hDlgCtrl, FALSE);
1457  }
1458  else
1459  {
1461  SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pOptionData->uMouseTrails - 2);
1462  }
1463 
1464  if (pOptionData->bMouseVanish)
1465  {
1466  hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_HIDE_POINTER);
1467  SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
1468  }
1469 
1470  if (pOptionData->bMouseSonar)
1471  {
1472  hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_SHOW_POINTER);
1473  SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
1474  }
1475 
1476  break;
1477 
1478  case WM_DESTROY:
1479  HeapFree(GetProcessHeap(), 0, pOptionData);
1480  break;
1481 
1482  case WM_COMMAND:
1483  switch(LOWORD(wParam))
1484  {
1487  {
1488  pOptionData->MouseAccel.nAcceleration = 0;
1489  pOptionData->MouseAccel.nThreshold1 = 0;
1490  pOptionData->MouseAccel.nThreshold2 = 0;
1492  }
1493  else
1494  {
1495  pOptionData->MouseAccel.nAcceleration = 1;
1496  pOptionData->MouseAccel.nThreshold1 = 6;
1497  pOptionData->MouseAccel.nThreshold2 = 10;
1499  }
1500  SystemParametersInfo(SPI_SETMOUSE, 0, &pOptionData->MouseAccel, 0);
1501  break;
1502 
1503  case IDC_CHECK_SNAP_TO:
1505  {
1506  pOptionData->bSnapToDefaultButton = 0;
1508  }
1509  else
1510  {
1511  pOptionData->bSnapToDefaultButton = 1;
1513  }
1514  SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, (UINT)pOptionData->bSnapToDefaultButton, 0, 0);
1515  break;
1516 
1518  hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL);
1520  {
1522  EnableWindow(hDlgCtrl, FALSE);
1525  pOptionData->uMouseTrails = 0;
1526  }
1527  else
1528  {
1530  EnableWindow(hDlgCtrl, TRUE);
1533  pOptionData->uMouseTrails = (UINT)SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) + 2;
1534  }
1535  SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uMouseTrails, 0, 0);
1536  break;
1537 
1540  {
1541  pOptionData->bMouseVanish = FALSE;
1543  }
1544  else
1545  {
1546  pOptionData->bMouseVanish = TRUE;
1548  }
1549  SystemParametersInfo(SPI_SETMOUSEVANISH, 0, IntToPtr(pOptionData->bMouseVanish), 0);
1550  break;
1551 
1554  {
1555  pOptionData->bMouseSonar = FALSE;
1557  }
1558  else
1559  {
1560  pOptionData->bMouseSonar = TRUE;
1562  }
1563  SystemParametersInfo(SPI_SETMOUSESONAR, 0, IntToPtr(pOptionData->bMouseSonar), 0);
1564  break;
1565 
1566  }
1567  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1568  break;
1569 
1570  case WM_NOTIFY:
1571  lppsn = (LPPSHNOTIFY)lParam;
1572  if (lppsn->hdr.code == PSN_APPLY)
1573  {
1574  /* Set mouse speed */
1575  if (pOptionData->ulOrigMouseSpeed != pOptionData->ulMouseSpeed)
1576  {
1577  SystemParametersInfo(SPI_SETMOUSESPEED, 0, IntToPtr(pOptionData->ulMouseSpeed), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
1578  pOptionData->ulOrigMouseSpeed = pOptionData->ulMouseSpeed;
1579  }
1580 
1581  if (pOptionData->OrigMouseAccel.nAcceleration != pOptionData->MouseAccel.nAcceleration)
1582  {
1584  pOptionData->OrigMouseAccel.nAcceleration = pOptionData->MouseAccel.nAcceleration;
1585  pOptionData->OrigMouseAccel.nThreshold1 = pOptionData->MouseAccel.nThreshold1;
1586  pOptionData->OrigMouseAccel.nThreshold2 = pOptionData->MouseAccel.nThreshold2;
1587  }
1588 
1589 
1590  /* Set snap to default button */
1591  if (pOptionData->bOrigSnapToDefaultButton != pOptionData->bSnapToDefaultButton)
1592  {
1593  SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, (UINT)pOptionData->bSnapToDefaultButton, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
1594  pOptionData->bOrigSnapToDefaultButton = pOptionData->bSnapToDefaultButton;
1595  }
1596 
1597  /* Set mouse trails setting */
1598  if (pOptionData->uOrigMouseTrails != pOptionData->uMouseTrails)
1599  {
1600  SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uMouseTrails, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
1601  pOptionData->uOrigMouseTrails = pOptionData->uMouseTrails;
1602  }
1603 
1604  /* Hide pointer while typing */
1605  if (pOptionData->bOrigMouseVanish != pOptionData->bMouseVanish)
1606  {
1607  SystemParametersInfo(SPI_SETMOUSEVANISH, 0, IntToPtr(pOptionData->bMouseVanish), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
1608  pOptionData->bOrigMouseVanish = pOptionData->bMouseVanish;
1609  }
1610 
1611  /* Show pointer with Ctrl-Key */
1612  if (pOptionData->bOrigMouseSonar != pOptionData->bMouseSonar)
1613  {
1614  SystemParametersInfo(SPI_SETMOUSESONAR, 0, IntToPtr(pOptionData->bMouseSonar), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
1615  pOptionData->bOrigMouseSonar = pOptionData->bMouseSonar;
1616  }
1617  return TRUE;
1618  }
1619  else if (lppsn->hdr.code == PSN_RESET)
1620  {
1621  /* Set the original mouse speed */
1622  SystemParametersInfo(SPI_SETMOUSESPEED, 0, IntToPtr(pOptionData->ulOrigMouseSpeed), 0);
1623  SystemParametersInfo(SPI_SETMOUSE, 0, &pOptionData->OrigMouseAccel, 0);
1624  SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, (UINT)pOptionData->bOrigSnapToDefaultButton, 0, 0);
1625  SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uOrigMouseTrails, 0, 0);
1626  SystemParametersInfo(SPI_SETMOUSEVANISH, 0, IntToPtr(pOptionData->bOrigMouseVanish), 0);
1627  SystemParametersInfo(SPI_SETMOUSESONAR, 0,IntToPtr(pOptionData->bOrigMouseSonar), 0);
1628  }
1629  break;
1630 
1631  case WM_HSCROLL:
1632  if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SPEED))
1633  {
1634  switch (LOWORD(wParam))
1635  {
1636  case TB_LINEUP:
1637  case TB_LINEDOWN:
1638  case TB_PAGEUP:
1639  case TB_PAGEDOWN:
1640  case TB_TOP:
1641  case TB_BOTTOM:
1642  case TB_ENDTRACK:
1643  pOptionData->ulMouseSpeed = (ULONG)SendDlgItemMessage(hwndDlg, IDC_SLIDER_MOUSE_SPEED, TBM_GETPOS, 0, 0);
1644  SystemParametersInfo(SPI_SETMOUSESPEED, 0, IntToPtr(pOptionData->ulMouseSpeed), SPIF_SENDCHANGE);
1645  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1646  break;
1647 #if 0
1648  case TB_THUMBTRACK:
1649  pOptionData->ulMouseSpeed = (ULONG)HIWORD(wParam) + 1;
1650  SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSpeed, SPIF_SENDCHANGE);
1651  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1652  break;
1653 #endif
1654  }
1655  }
1656  else if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL))
1657  {
1658  switch (LOWORD(wParam))
1659  {
1660  case TB_LINEUP:
1661  case TB_LINEDOWN:
1662  case TB_PAGEUP:
1663  case TB_PAGEDOWN:
1664  case TB_TOP:
1665  case TB_BOTTOM:
1666  case TB_ENDTRACK:
1667  pOptionData->uMouseTrails = (ULONG)SendDlgItemMessage(hwndDlg, IDC_SLIDER_POINTER_TRAIL, TBM_GETPOS, 0, 0) + 2;
1668  SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uMouseTrails, 0, SPIF_UPDATEINIFILE);
1669  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1670  break;
1671 
1672  case TB_THUMBTRACK:
1673  pOptionData->uMouseTrails = (ULONG)HIWORD(wParam) + 2;
1674  SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uMouseTrails, 0, SPIF_UPDATEINIFILE);
1675  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1676  break;
1677  }
1678  }
1679  break;
1680  }
1681 
1682  return FALSE;
1683 }
#define DEFAULT_MOUSE_ACCELERATION
Definition: mouse.c:39
#define TB_THUMBTRACK
Definition: commctrl.h:2050
BOOL bSnapToDefaultButton
Definition: mouse.c:89
#define TRUE
Definition: types.h:120
#define TB_PAGEDOWN
Definition: commctrl.h:2048
#define DEFAULT_MOUSE_THRESHOLD2
Definition: mouse.c:41
struct _PSHNOTIFY * LPPSHNOTIFY
INT nAcceleration
Definition: mouse.c:78
ULONG ulOrigMouseSpeed
Definition: mouse.c:84
INT nThreshold2
Definition: mouse.c:77
UINT uMouseTrails
Definition: mouse.c:92
#define TBM_SETRANGE
Definition: commctrl.h:2009
#define SystemParametersInfo
Definition: winuser.h:5724
struct _OPTION_DATA * POPTION_DATA
#define SPI_SETMOUSE
Definition: winuser.h:1338
#define TBM_SETPOS
Definition: commctrl.h:2008
#define IDC_CHECK_POINTER_TRAIL
Definition: resource.h:75
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_CHECK_HIDE_POINTER
Definition: resource.h:74
UINT uOrigMouseTrails
Definition: mouse.c:93
BOOL bOrigSnapToDefaultButton
Definition: mouse.c:90
#define SetWindowLongPtr
Definition: treelist.c:70
#define IDC_CHECK_POINTER_PRECISION
Definition: resource.h:76
WPARAM wParam
Definition: combotst.c:138
#define TB_PAGEUP
Definition: commctrl.h:2047
#define TB_LINEDOWN
Definition: commctrl.h:2046
UINT code
Definition: winuser.h:3112
NMHDR hdr
Definition: prsht.h:312
#define TB_BOTTOM
Definition: commctrl.h:2052
BOOL bOrigMouseSonar
Definition: mouse.c:99
#define TBM_GETPOS
Definition: commctrl.h:2003
MOUSE_ACCEL OrigMouseAccel
Definition: mouse.c:87
#define SPI_GETMOUSE
Definition: winuser.h:1337
#define MAKELONG(a, b)
Definition: typedefs.h:248
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_TEXT_TRAIL_LONG
Definition: resource.h:105
#define IDC_CHECK_SHOW_POINTER
Definition: resource.h:73
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDC_SLIDER_MOUSE_SPEED
Definition: resource.h:71
#define WM_DESTROY
Definition: winuser.h:1591
#define IDC_CHECK_SNAP_TO
Definition: resource.h:72
#define IntToPtr(i)
Definition: basetsd.h:89
#define DEFAULT_MOUSE_SPEED
Definition: mouse.c:38
#define BM_SETCHECK
Definition: winuser.h:1882
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
BOOL bOrigMouseVanish
Definition: mouse.c:96
#define TB_LINEUP
Definition: commctrl.h:2045
#define TB_ENDTRACK
Definition: commctrl.h:2053
#define TB_TOP
Definition: commctrl.h:2051
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define DEFAULT_MOUSE_THRESHOLD1
Definition: mouse.c:40
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define PSN_RESET
Definition: prsht.h:118
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define WM_HSCROLL
Definition: winuser.h:1719
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define BST_CHECKED
Definition: winuser.h:197
BOOL bMouseSonar
Definition: mouse.c:98
#define SendMessage
Definition: winuser.h:5709
#define HIWORD(l)
Definition: typedefs.h:246
BOOL bMouseVanish
Definition: mouse.c:95
unsigned int ULONG
Definition: retypes.h:1
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDC_SLIDER_POINTER_TRAIL
Definition: resource.h:77
INT nThreshold1
Definition: mouse.c:76
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define IDC_TEXT_TRAIL_SHORT
Definition: resource.h:104
#define WM_NOTIFY
Definition: richedit.h:61
MOUSE_ACCEL MouseAccel
Definition: mouse.c:86
ULONG ulMouseSpeed
Definition: mouse.c:83

◆ PointerProc()

static INT_PTR CALLBACK PointerProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 1199 of file mouse.c.

1203 {
1204  PPOINTER_DATA pPointerData;
1205  LPPSHNOTIFY lppsn;
1206  INT nSel;
1207 
1208  pPointerData = (PPOINTER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1209 
1210  switch (uMsg)
1211  {
1212  case WM_INITDIALOG:
1213  pPointerData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(POINTER_DATA));
1214  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pPointerData);
1215 
1216  pPointerData->cxCursor = GetSystemMetrics(SM_CXCURSOR);
1217  pPointerData->cyCursor = GetSystemMetrics(SM_CYCURSOR);
1218 
1219  EnumerateCursorSchemes(hwndDlg);
1220  LoadInitialCursorScheme(hwndDlg);
1221 
1222  /* Get cursor shadow setting */
1223  SystemParametersInfo(SPI_GETCURSORSHADOW, 0, &pPointerData->bCursorShadow, 0);
1224  pPointerData->bOrigCursorShadow = pPointerData->bCursorShadow;
1225 
1226  if (pPointerData->bCursorShadow)
1227  {
1229  }
1230 
1231  if ((INT)wParam == IDC_LISTBOX_CURSOR)
1232  return TRUE;
1233  else
1234  return FALSE;
1235 
1236  case WM_MEASUREITEM:
1238  break;
1239 
1240  case WM_DRAWITEM:
1241  if (wParam == IDC_LISTBOX_CURSOR)
1242  OnDrawItem((UINT)wParam, (LPDRAWITEMSTRUCT)lParam, pPointerData);
1243  return TRUE;
1244 
1245  case WM_DESTROY:
1246  HeapFree(GetProcessHeap(), 0, pPointerData);
1247  break;
1248 
1249  case WM_NOTIFY:
1250  lppsn = (LPPSHNOTIFY) lParam;
1251  if (lppsn->hdr.code == PSN_APPLY)
1252  {
1253  ApplyCursorScheme(hwndDlg);
1254 //#if (WINVER >= 0x0500)
1255  if (pPointerData->bOrigCursorShadow != pPointerData->bCursorShadow)
1256  {
1257  SystemParametersInfo(SPI_SETCURSORSHADOW, 0, UlongToPtr(pPointerData->bCursorShadow), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
1258  pPointerData->bOrigCursorShadow = pPointerData->bCursorShadow;
1259  }
1260 //#endif
1261  return TRUE;
1262  }
1263  else if (lppsn->hdr.code == PSN_RESET)
1264  {
1265 //#if (WINVER >= 0x0500)
1266  SystemParametersInfo(SPI_SETCURSORSHADOW, 0, UlongToPtr(pPointerData->bOrigCursorShadow), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
1267 //#endif
1268  }
1269  break;
1270 
1271  case WM_COMMAND:
1272  switch (LOWORD(wParam))
1273  {
1275  if (HIWORD(wParam) == CBN_SELENDOK)
1276  {
1277  LoadNewCursorScheme(hwndDlg);
1278  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1279  }
1280  break;
1281 
1282  case IDC_LISTBOX_CURSOR:
1283  switch (HIWORD(wParam))
1284  {
1285  case LBN_SELCHANGE:
1286  nSel = SendMessage((HWND)lParam, LB_GETCURSEL, 0, 0);
1287 
1288  if(nSel == LB_ERR)
1289  break;
1290 
1292  (LPARAM)g_CursorData[nSel].hCursor);
1294  (g_CursorData[nSel].szCursorPath[0] != 0));
1295  break;
1296 
1297  case LBN_DBLCLK:
1298  if (BrowseCursor(hwndDlg))
1299  {
1300  /* Update cursor list and preview */
1302  RefreshCursorList(hwndDlg, FALSE);
1303 
1304  /* Enable the "Set Default" button */
1306 
1307  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1308  }
1309  break;
1310  }
1311  break;
1312 
1314  SaveCursorScheme(hwndDlg);
1315  break;
1316 
1318  nSel = SendDlgItemMessage(hwndDlg, IDC_LISTBOX_CURSOR, LB_GETCURSEL, 0, 0);
1319  if (nSel != LB_ERR)
1320  {
1321  /* Clean the path of the currently selected cursor */
1322  memset(g_CursorData[nSel].szCursorPath, 0x0, MAX_PATH * sizeof(TCHAR));
1323 
1324  /* Update cursor list and preview */
1326  RefreshCursorList(hwndDlg, FALSE);
1327 
1328  /* Disable the "Set Default" button */
1330 
1331  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1332  }
1333  break;
1334 
1336  if (BrowseCursor(hwndDlg))
1337  {
1338  /* Update cursor list and preview */
1340  RefreshCursorList(hwndDlg, FALSE);
1341 
1342  /* Enable the "Set Default" button */
1344 
1345  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1346  }
1347  break;
1348 
1350  DeleteUserCursorScheme(hwndDlg);
1351  break;
1352 
1355  {
1356  pPointerData->bCursorShadow = FALSE;
1358 //#if (WINVER >= 0x0500)
1359 // SystemParametersInfo(SPI_SETCURSORSHADOW, 0, (PVOID)pPointerData->bCursorShadow, 0);
1360 //#endif
1361 // PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1362  }
1363  else
1364  {
1365  pPointerData->bCursorShadow = TRUE;
1367  }
1368 //#if (WINVER >= 0x0500)
1369  //SystemParametersInfo(SPI_SETCURSORSHADOW, 0, (PVOID)pPointerData->bCursorShadow, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
1370 //#endif
1371  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1372  break;
1373  }
1374  break;
1375  }
1376 
1377  return FALSE;
1378 }
struct tagMEASUREITEMSTRUCT * LPMEASUREITEMSTRUCT
static BOOL DeleteUserCursorScheme(HWND hwndDlg)
Definition: mouse.c:607
#define TRUE
Definition: types.h:120
static VOID LoadNewCursorScheme(HWND hwndDlg)
Definition: mouse.c:999
GLint x0
Definition: linetemp.h:95
struct _PSHNOTIFY * LPPSHNOTIFY
#define IMAGE_CURSOR
Definition: winuser.h:213
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:79
#define SM_CYCURSOR
Definition: winuser.h:965
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
#define SystemParametersInfo
Definition: winuser.h:5724
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define IDC_BUTTON_SAVEAS_SCHEME
Definition: resource.h:91
#define PSN_APPLY
Definition: prsht.h:117
static VOID OnDrawItem(UINT idCtl, LPDRAWITEMSTRUCT lpdis, PPOINTER_DATA pPointerData)
Definition: mouse.c:943
static BOOL BrowseCursor(HWND hwndDlg)
Definition: mouse.c:827
#define LBN_SELCHANGE
Definition: winuser.h:2036
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDC_BUTTON_BROWSE_CURSOR
Definition: resource.h:90
static BOOL SaveCursorScheme(HWND hwndDlg)
Definition: mouse.c:696
UINT code
Definition: winuser.h:3112
NMHDR hdr
Definition: prsht.h:312
#define LB_ERR
Definition: winuser.h:2386
#define CBN_SELENDOK
Definition: winuser.h:1942
INT cyCursor
Definition: mouse.c:70
LONG_PTR LPARAM
Definition: windef.h:208
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define UlongToPtr(u)
Definition: config.h:106
struct _POINTER_DATA * PPOINTER_DATA
#define WM_DESTROY
Definition: winuser.h:1591
static BOOL EnumerateCursorSchemes(HWND hwndDlg)
Definition: mouse.c:462
BOOL bCursorShadow
Definition: mouse.c:66
char TCHAR
Definition: xmlstorage.h:189
#define BM_SETCHECK
Definition: winuser.h:1882
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SM_CXCURSOR
Definition: winuser.h:964
INT cxCursor
Definition: mouse.c:69
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
static VOID LoadInitialCursorScheme(HWND hwndDlg)
Definition: mouse.c:1031
static VOID RefreshCursorList(HWND hwndDlg, BOOL bInit)
Definition: mouse.c:575
#define MAX_PATH
Definition: compat.h:26
int WINAPI GetSystemMetrics(_In_ int)
#define IDC_LISTBOX_CURSOR
Definition: resource.h:78
#define WM_MEASUREITEM
Definition: winuser.h:1628
#define LBN_DBLCLK
Definition: winuser.h:2032
#define IDC_BUTTON_DELETE_SCHEME
Definition: resource.h:80
BOOL bOrigCursorShadow
Definition: mouse.c:67
#define IDC_BUTTON_USE_DEFAULT_CURSOR
Definition: resource.h:89
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static BOOL ApplyCursorScheme(HWND hwndDlg)
Definition: mouse.c:1127
#define PSN_RESET
Definition: prsht.h:118
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LB_GETCURSEL
Definition: winuser.h:2000
unsigned int UINT
Definition: ndis.h:50
static VOID ReloadCurrentCursorScheme(VOID)
Definition: mouse.c:921
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define STM_SETIMAGE
Definition: winuser.h:2054
#define IDC_IMAGE_CURRENT_CURSOR
Definition: resource.h:96
#define BST_CHECKED
Definition: winuser.h:197
#define WM_DRAWITEM
Definition: winuser.h:1627
#define IDC_CHECK_CURSOR_SHADOW
Definition: resource.h:81
#define SendMessage
Definition: winuser.h:5709
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
#define memset(x, y, z)
Definition: compat.h:39
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 1798 of file mouse.c.

1799 {
1800  // NOTE: This callback is needed to set large icon correctly.
1801  HICON hIcon;
1802  switch (uMsg)
1803  {
1804  case PSCB_INITIALIZED:
1805  {
1807  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
1808  break;
1809  }
1810  }
1811  return 0;
1812 }
static HICON
Definition: imagelist.c:84
HINSTANCE hApplet
Definition: access.c:17
LONG_PTR LPARAM
Definition: windef.h:208
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_CPLICON_1
Definition: resource.h:4
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by MouseApplet().

◆ RefreshCursorList()

static VOID RefreshCursorList ( HWND  hwndDlg,
BOOL  bInit 
)
static

Definition at line 575 of file mouse.c.

576 {
577  INT index;
578  INT i;
579  INT nSel;
580 
581  nSel = bInit ? 0 : SendDlgItemMessage(hwndDlg, IDC_LISTBOX_CURSOR, LB_GETCURSEL, 0, 0);
582 
583  if (bInit)
584  {
586  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
587  {
588  LoadString(hApplet, index, g_CursorData[i].szCursorName, MAX_PATH);
590  }
591 
593  }
594  else
595  {
597  }
598 
600  (LPARAM)g_CursorData[nSel].hCursor);
601 
602  EnableWindow(GetDlgItem(hwndDlg,IDC_BUTTON_USE_DEFAULT_CURSOR), (g_CursorData[nSel].szCursorPath[0] != 0));
603 }
#define LB_SETCURSEL
Definition: winuser.h:2024
#define LB_ADDSTRING
Definition: winuser.h:1992
#define IMAGE_CURSOR
Definition: winuser.h:213
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
HINSTANCE hApplet
Definition: access.c:17
#define SendDlgItemMessage
Definition: winuser.h:5708
int32_t INT
Definition: typedefs.h:56
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
Definition: glfuncs.h:248
#define LB_RESETCONTENT
Definition: winuser.h:2016
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define MAX_PATH
Definition: compat.h:26
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define IDC_LISTBOX_CURSOR
Definition: resource.h:78
#define IDC_BUTTON_USE_DEFAULT_CURSOR
Definition: resource.h:89
#define index(s, c)
Definition: various.h:29
#define IDS_ARROW
Definition: resource.h:38
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDS_HAND
Definition: resource.h:52
#define LB_GETCURSEL
Definition: winuser.h:2000
#define STM_SETIMAGE
Definition: winuser.h:2054
#define IDC_IMAGE_CURRENT_CURSOR
Definition: resource.h:96
#define LoadString
Definition: winuser.h:5685

Referenced by LoadInitialCursorScheme(), LoadNewCursorScheme(), and PointerProc().

◆ ReloadCurrentCursorScheme()

static VOID ReloadCurrentCursorScheme ( VOID  )
static

Definition at line 921 of file mouse.c.

922 {
923  UINT index, i;
924 
925  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
926  {
927  if (g_CursorData[i].hCursor != NULL)
928  DestroyCursor(g_CursorData[i].hCursor);
929 
930  if (g_CursorData[i].szCursorPath[0] == 0)
932  IMAGE_CURSOR, 0, 0,
934  else
936  IMAGE_CURSOR, 0, 0,
938  }
939 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define LR_SHARED
Definition: winuser.h:1090
#define LR_LOADFROMFILE
Definition: winuser.h:1082
#define IMAGE_CURSOR
Definition: winuser.h:213
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
HICON HCURSOR
Definition: windef.h:284
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
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition: cursoricon.c:2654
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
#define index(s, c)
Definition: various.h:29
#define IDS_ARROW
Definition: resource.h:38
#define IDS_HAND
Definition: resource.h:52
unsigned int UINT
Definition: ndis.h:50
#define LoadImage
Definition: winuser.h:5681
HCURSOR hCursor
Definition: mouse.c:114

Referenced by LoadInitialCursorScheme(), and PointerProc().

◆ SaveCursorScheme()

static BOOL SaveCursorScheme ( HWND  hwndDlg)
static

Definition at line 696 of file mouse.c.

697 {
698  TCHAR szSystemScheme[MAX_PATH];
699  TCHAR szSchemeName[MAX_PATH];
700  TCHAR szNewSchemeName[MAX_PATH];
702  TCHAR szTitle[128];
703  TCHAR szText[256];
704  INT nSel;
705  INT index, i, nLength;
706  LPTSTR lpSchemeData;
707  HKEY hCuKey;
708  HKEY hCuCursorKey;
709  LONG lError = ERROR_SUCCESS;
710  BOOL bSchemeExists;
711 
712  LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH);
713 
715  if (nSel == CB_ERR)
716  return FALSE;
717 
718  if (nSel == 0)
719  {
720  szSchemeName[0] = 0;
721  szNewSchemeName[0] = 0;
722  }
723  else
724  {
725  SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETLBTEXT, nSel, (LPARAM)szNewSchemeName);
726 
727  if (_tcsstr(szNewSchemeName, szSystemScheme))
728  {
729  szNewSchemeName[_tcslen(szNewSchemeName) - _tcslen(szSystemScheme) - 1] = 0;
730  }
731  }
732 
733  /* Ask for a name for the new cursor scheme */
735  hwndDlg, SaveSchemeProc, (LPARAM)szNewSchemeName))
736  return TRUE;
737 
738  /* Check all non-system schemes for the new name */
740  if (nSel == CB_ERR)
741  return FALSE;
742 
743  bSchemeExists = FALSE;
744  for (i = 0; i < nSel; i++)
745  {
747  if (_tcsstr(szSchemeName, szSystemScheme) == NULL)
748  {
749  if (_tcscmp(szSchemeName, szNewSchemeName) == 0)
750  {
751  bSchemeExists = TRUE;
752  break;
753  }
754  }
755  }
756 
757  if (bSchemeExists)
758  {
761 
762  /* Confirm scheme overwrite */
763  if (MessageBox(hwndDlg, szText, szTitle, MB_YESNO | MB_ICONQUESTION) == IDNO)
764  return TRUE;
765  }
766 
767  /* Save the cursor scheme */
768  nLength = 0;
769  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
770  {
771  if (i > 0)
772  nLength++;
773  nLength += _tcslen(g_CursorData[i].szCursorPath);
774  }
775  nLength++;
776 
777  lpSchemeData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength * sizeof(TCHAR));
778 
779  if(!lpSchemeData)
780  return FALSE;
781 
782  for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
783  {
784  CompressPath(szTempPath, g_CursorData[i].szCursorPath);
785  if (i > 0)
786  _tcscat(lpSchemeData, _T(","));
787  _tcscat(lpSchemeData, szTempPath);
788  }
789 
791  {
792  HeapFree(GetProcessHeap(), 0, lpSchemeData);
793  return FALSE;
794  }
795 
796  if (RegOpenKeyEx(hCuKey, _T("Control Panel\\Cursors\\Schemes"), 0, KEY_READ | KEY_SET_VALUE, &hCuCursorKey) != ERROR_SUCCESS)
797  {
798  RegCloseKey(hCuKey);
799  HeapFree(GetProcessHeap(), 0, lpSchemeData);
800  return FALSE;
801  }
802 
803  lError = RegSetValueEx(hCuCursorKey, szNewSchemeName, 0,
804  REG_EXPAND_SZ, (LPBYTE)lpSchemeData,
805  (_tcslen(lpSchemeData) + 1) * sizeof(TCHAR));
806 
807  RegCloseKey(hCuCursorKey);
808  RegCloseKey(hCuKey);
809 
810  /* Add the new scheme to the scheme list and select it */
811  if (lError == ERROR_SUCCESS)
812  {
813  LPTSTR copy = _tcsdup(lpSchemeData);
814 
815  nSel = SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_ADDSTRING, (WPARAM)0, (LPARAM)szNewSchemeName);
818  }
819 
820  HeapFree(GetProcessHeap(), 0, lpSchemeData);
821 
822  return (lError == ERROR_SUCCESS);
823 }
#define CB_SETITEMDATA
Definition: winuser.h:1927
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define KEY_READ
Definition: nt_native.h:1023
int _tcscmp(const _TCHAR *s1, const _TCHAR *s2)
Definition: tcscmp.h:8
#define CB_GETLBTEXT
Definition: winuser.h:1913
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:79
_In_ DWORD nLength
Definition: wincon.h:461
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
#define _tcsdup
Definition: tchar.h:625
HINSTANCE hApplet
Definition: access.c:17
#define IDS_SYSTEM_SCHEME
Definition: resource.h:54
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1904
CHAR * LPTSTR
Definition: xmlstorage.h:192
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
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define MB_YESNO
Definition: winuser.h:811
static const WCHAR szText[]
Definition: dialog.c:139
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define CB_ADDSTRING
Definition: winuser.h:1897
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
#define MB_ICONQUESTION
Definition: winuser.h:783
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
#define CB_ERR
Definition: winuser.h:2389
#define _tcsstr
Definition: xmlstorage.h:199
static TCHAR szTempPath[MAX_PATH]
Definition: CImage.cpp:45
#define IDS_OVERWRITE_TEXT
Definition: resource.h:60
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define MAX_PATH
Definition: compat.h:26
#define IDS_OVERWRITE_TITLE
Definition: resource.h:59
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define DialogBoxParam
Definition: winuser.h:5630
#define index(s, c)
Definition: various.h:29
#define MessageBox
Definition: winuser.h:5688
#define IDS_ARROW
Definition: resource.h:38
#define CB_SETCURSEL
Definition: winuser.h:1922
static VOID CompressPath(LPTSTR lpShortPath, LPTSTR lpPath)
Definition: mouse.c:426
#define RegOpenKeyEx
Definition: winreg.h:520
#define IDS_HAND
Definition: resource.h:52
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define IDD_CURSOR_SCHEME_SAVEAS
Definition: resource.h:30
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static INT_PTR CALLBACK SaveSchemeProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:660
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3232
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
#define CB_GETCOUNT
Definition: winuser.h:1903
#define IDNO
Definition: winuser.h:830
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RegSetValueEx
Definition: winreg.h:533
#define LoadString
Definition: winuser.h:5685

Referenced by PointerProc().

◆ SaveSchemeProc()

static INT_PTR CALLBACK SaveSchemeProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 660 of file mouse.c.

664 {
665  LPTSTR pSchemeName;
666 
667  switch (uMsg)
668  {
669  case WM_INITDIALOG:
670  pSchemeName = (LPTSTR)lParam;
671  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSchemeName);
673  0, (LPARAM)pSchemeName);
674  break;
675 
676  case WM_COMMAND:
677  if (LOWORD(wParam) == IDOK)
678  {
679  pSchemeName = (LPTSTR)GetWindowLongPtr(hwndDlg, DWLP_USER);
681  (WPARAM)MAX_PATH, (LPARAM)pSchemeName);
682  EndDialog(hwndDlg, TRUE);
683  }
684  else if (LOWORD(wParam) == IDCANCEL)
685  {
686  EndDialog(hwndDlg, FALSE);
687  }
688  break;
689  }
690 
691  return FALSE;
692 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define WM_GETTEXT
Definition: winuser.h:1600
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
CHAR * LPTSTR
Definition: xmlstorage.h:192
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
#define IDC_EDIT_SCHEME_NAME
Definition: resource.h:92
#define MAX_PATH
Definition: compat.h:26
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by SaveCursorScheme().

◆ ShowDialogWheelControls()

static VOID ShowDialogWheelControls ( HWND  hwndDlg,
UINT  uWheelScrollLines,
BOOL  bInit 
)
static

Definition at line 1687 of file mouse.c.

1688 {
1689  HWND hDlgCtrl;
1690 
1691  if (uWheelScrollLines != WHEEL_PAGESCROLL)
1692  {
1693  hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_WHEEL_SCROLL_LINES);
1694  SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
1695 
1696  hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES);
1697  EnableWindow(hDlgCtrl, TRUE);
1698 
1699  hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_WHEEL_SCROLL_LINES);
1700  EnableWindow(hDlgCtrl, TRUE);
1701 
1702  hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_WHEEL_SCROLL_PAGE);
1704  }
1705  else
1706  {
1707  hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_WHEEL_SCROLL_LINES);
1709 
1710  hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES);
1711  EnableWindow(hDlgCtrl, FALSE);
1712 
1713  hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_WHEEL_SCROLL_LINES);
1714  EnableWindow(hDlgCtrl, FALSE);
1715 
1716  hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_WHEEL_SCROLL_PAGE);
1717  SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
1718 
1719  /* Set the default scroll lines value */
1720  if (bInit != FALSE)
1722  }
1723 }
#define TRUE
Definition: types.h:120
#define IDC_RADIO_WHEEL_SCROLL_LINES
Definition: resource.h:67
UINT_PTR WPARAM
Definition: windef.h:207
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_SETCHECK
Definition: winuser.h:1882
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
#define IDC_UPDOWN_WHEEL_SCROLL_LINES
Definition: resource.h:69
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define WHEEL_PAGESCROLL
Definition: zmouse.h:26
#define DEFAULT_WHEEL_SCROLL_LINES
Definition: mouse.c:44
#define BST_CHECKED
Definition: winuser.h:197
#define SendMessage
Definition: winuser.h:5709
#define IDC_EDIT_WHEEL_SCROLL_LINES
Definition: resource.h:68
#define IDC_RADIO_WHEEL_SCROLL_PAGE
Definition: resource.h:70

Referenced by WheelProc().

◆ WheelProc()

static INT_PTR CALLBACK WheelProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 1727 of file mouse.c.

1731 {
1732  LPPSHNOTIFY lppsn;
1733  PWHEEL_DATA pWheelData;
1734 
1735  pWheelData = (PWHEEL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1736 
1737  switch (uMsg)
1738  {
1739  case WM_INITDIALOG:
1740  pWheelData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WHEEL_DATA));
1741  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pWheelData);
1742 
1743  /* Get wheel scroll lines */
1744  SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &pWheelData->uWheelScrollLines, 0);
1745 
1746  ShowDialogWheelControls(hwndDlg, pWheelData->uWheelScrollLines, TRUE);
1747  SendDlgItemMessage(hwndDlg, IDC_UPDOWN_WHEEL_SCROLL_LINES, UDM_SETRANGE, 0, MAKELONG((short)100, (short)0));
1748  if (pWheelData->uWheelScrollLines != WHEEL_PAGESCROLL)
1749  {
1751  }
1752  return TRUE;
1753 
1754  case WM_DESTROY:
1755  HeapFree(GetProcessHeap(), 0, pWheelData);
1756  break;
1757 
1758  case WM_COMMAND:
1759  switch (LOWORD(wParam))
1760  {
1763  ShowDialogWheelControls(hwndDlg, pWheelData->uWheelScrollLines, FALSE);
1764  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1765  break;
1766 
1768  pWheelData->uWheelScrollLines = WHEEL_PAGESCROLL;
1769  ShowDialogWheelControls(hwndDlg, pWheelData->uWheelScrollLines, FALSE);
1770  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1771  break;
1772 
1774  if (pWheelData && HIWORD(wParam) == EN_CHANGE)
1775  {
1777  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1778  }
1779  break;
1780  }
1781  break;
1782 
1783  case WM_NOTIFY:
1784  lppsn = (LPPSHNOTIFY)lParam;
1785  if (lppsn->hdr.code == PSN_APPLY)
1786  {
1789  return TRUE;
1790  }
1791  break;
1792  }
1793 
1794  return FALSE;
1795 }
#define TRUE
Definition: types.h:120
struct _PSHNOTIFY * LPPSHNOTIFY
#define IDC_RADIO_WHEEL_SCROLL_LINES
Definition: resource.h:67
#define SPI_SETWHEELSCROLLLINES
Definition: zmouse.h:30
#define SystemParametersInfo
Definition: winuser.h:5724
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_APPLY
Definition: prsht.h:117
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
UINT code
Definition: winuser.h:3112
NMHDR hdr
Definition: prsht.h:312
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
static VOID ShowDialogWheelControls(HWND hwndDlg, UINT uWheelScrollLines, BOOL bInit)
Definition: mouse.c:1687
#define UDM_SETRANGE
Definition: commctrl.h:2113
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
#define DWLP_USER
Definition: winuser.h:866
#define IDC_UPDOWN_WHEEL_SCROLL_LINES
Definition: resource.h:69
#define WM_COMMAND
Definition: winuser.h:1716
UINT uWheelScrollLines
Definition: mouse.c:105
HWND WINAPI GetParent(_In_ HWND)
struct _WHEEL_DATA * PWHEEL_DATA
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define WHEEL_PAGESCROLL
Definition: zmouse.h:26
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_EDIT_WHEEL_SCROLL_LINES
Definition: resource.h:68
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_RADIO_WHEEL_SCROLL_PAGE
Definition: resource.h:70
#define EN_CHANGE
Definition: winuser.h:1983

Variable Documentation

◆ DlgProc

DLGPROC DlgProc

Definition at line 1817 of file mouse.c.

Referenced by MouseApplet().

◆ g_CursorData

CURSOR_DATA g_CursorData[]
Initial value:
=
{{IDS_ARROW, 100, _T("Arrow"), 0, _T(""), _T("")},
{IDS_HELP, 112, _T("Help"), 0, _T(""), _T("")},
{IDS_APPSTARTING, 111, _T("AppStarting"), 0, _T(""), _T("")},
{IDS_WAIT, 102, _T("Wait"), 0, _T(""), _T("")},
{IDS_CROSSHAIR, 103, _T("Crosshair"), 0, _T(""), _T("")},
{IDS_IBEAM, 101, _T("IBeam"), 0, _T(""), _T("")},
{IDS_NWPEN, 113, _T("NWPen"), 0, _T(""), _T("")},
{IDS_NO, 110, _T("No"), 0, _T(""), _T("")},
{IDS_SIZENS, 108, _T("SizeNS"), 0, _T(""), _T("")},
{IDS_SIZEWE, 107, _T("SizeWE"), 0, _T(""), _T("")},
{IDS_SIZENWSE, 105, _T("SizeNWSE"), 0, _T(""), _T("")},
{IDS_SIZENESW, 106, _T("SizeNESW"), 0, _T(""), _T("")},
{IDS_SIZEALL, 109, _T("SizeAll"), 0, _T(""), _T("")},
{IDS_UPARROW, 104, _T("UpArrow"), 0, _T(""), _T("")},
{IDS_HAND, 114, _T("Hand"), 0, _T(""), _T("")}}
#define IDS_SIZEALL
Definition: resource.h:50
#define IDS_UPARROW
Definition: resource.h:51
#define IDS_WAIT
Definition: resource.h:41
#define IDS_IBEAM
Definition: resource.h:43
#define IDS_SIZENESW
Definition: resource.h:49
#define IDS_NWPEN
Definition: resource.h:44
#define IDS_SIZENWSE
Definition: resource.h:48
#define IDS_SIZEWE
Definition: resource.h:47
#define IDS_NO
Definition: resource.h:17
#define _T(x)
Definition: vfdio.h:22
#define IDS_APPSTARTING
Definition: resource.h:40
#define IDS_SIZENS
Definition: resource.h:46
#define IDS_ARROW
Definition: resource.h:38
#define IDS_HAND
Definition: resource.h:52
#define IDS_HELP
Definition: resource.h:3
#define IDS_CROSSHAIR
Definition: resource.h:42

Definition at line 120 of file mouse.c.

Referenced by ApplyCursorScheme(), BrowseCursor(), LoadCursorScheme(), LoadInitialCursorScheme(), OnDrawItem(), PointerProc(), RefreshCursorList(), ReloadCurrentCursorScheme(), and SaveCursorScheme().

◆ idDlg

WORD idDlg

Definition at line 1816 of file mouse.c.

Referenced by MouseApplet().

◆ PropPages

const { ... } PropPages[]
Initial value:
=
{
}
#define IDD_PAGE_WHEEL
Definition: resource.h:26
#define IDD_PAGE_BUTTON
Definition: resource.h:23
#define CPLPAGE_MOUSE_BUTTONS
Definition: cplext.h:4
#define CPLPAGE_MOUSE_WHEEL
Definition: cplext.h:6
static INT_PTR CALLBACK PointerProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:1199
static INT_PTR CALLBACK ButtonProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:233
#define CPLPAGE_MOUSE_PTRMOTION
Definition: cplext.h:5
#define IDD_HARDWARE
Definition: resource.h:28
static INT_PTR CALLBACK OptionProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:1382
static INT_PTR CALLBACK WheelProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:1727
#define IDD_PAGE_POINTER
Definition: resource.h:24
static INT_PTR CALLBACK MouseHardwareProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:156
#define IDD_PAGE_OPTION
Definition: resource.h:25

Referenced by MouseApplet().

◆ uiReplaceWith

UINT uiReplaceWith

Definition at line 1818 of file mouse.c.

Referenced by MouseApplet().