ReactOS 0.4.16-dev-197-g92996da
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 index(s, c)
Definition: various.h:29
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
static VOID CompressPath(LPTSTR lpShortPath, LPTSTR lpPath)
Definition: mouse.c:426
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
#define IDS_SYSTEM_SCHEME
Definition: resource.h:56
#define IDS_HAND
Definition: resource.h:54
#define IDS_ARROW
Definition: resource.h:40
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:81
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint index
Definition: glext.h:6031
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 REG_SZ
Definition: layer.c:22
static char szTempPath[MAX_PATH]
Definition: data.c:16
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define REG_DWORD
Definition: sdbapi.c:596
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
#define _T(x)
Definition: vfdio.h:22
LONG_PTR LPARAM
Definition: windef.h:208
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegOpenKeyEx
Definition: winreg.h:520
#define RegSetValueEx
Definition: winreg.h:533
#define CB_GETLBTEXT
Definition: winuser.h:1955
#define CB_ERR
Definition: winuser.h:2438
#define SPIF_SENDCHANGE
Definition: winuser.h:1575
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1574
#define CB_GETITEMDATA
Definition: winuser.h:1953
#define LoadString
Definition: winuser.h:5831
#define SystemParametersInfo
Definition: winuser.h:5870
#define CB_GETCURSEL
Definition: winuser.h:1946
#define SendDlgItemMessage
Definition: winuser.h:5854
char TCHAR
Definition: xmlstorage.h:189
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define _tcsstr
Definition: xmlstorage.h:199
#define _tcslen
Definition: xmlstorage.h:198

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_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define GetOpenFileName
Definition: commdlg.h:665
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
#define IDS_BROWSE_TITLE
Definition: resource.h:58
#define IDC_LISTBOX_CURSOR
Definition: resource.h:80
#define IDS_BROWSE_FILTER
Definition: resource.h:57
#define _tcsncpy
Definition: tchar.h:1410
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
LPTSTR szFilter
Definition: mplay32.c:30
#define memset(x, y, z)
Definition: compat.h:39
OPENFILENAME ofn
Definition: sndrec32.cpp:56
DWORD nFilterIndex
Definition: commdlg.h:335
HWND hwndOwner
Definition: commdlg.h:330
LPCSTR lpstrTitle
Definition: commdlg.h:341
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
#define ZeroMemory
Definition: winbase.h:1736
#define LB_ERR
Definition: winuser.h:2435
#define MB_ICONERROR
Definition: winuser.h:790
#define MessageBox
Definition: winuser.h:5834
#define LB_GETCURSEL
Definition: winuser.h:2042

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}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
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
#define IDC_BUTTON_CLICK_LOCK
Definition: resource.h:68
#define IDC_IMAGE_DOUBLE_CLICK_SPEED
Definition: resource.h:85
#define IDC_SWAP_MOUSE_BUTTONS
Definition: resource.h:65
#define IDC_CHECK_CLICK_LOCK
Definition: resource.h:67
#define IDI_FOLDER_CLOSED
Definition: resource.h:21
#define IDI_MOUSE_RIGHT
Definition: resource.h:13
#define IDI_MOUSE_LEFT
Definition: resource.h:12
#define IDD_CLICK_LOCK
Definition: resource.h:33
#define IDC_IMAGE_SWAP_MOUSE
Definition: resource.h:84
#define IDC_SLIDER_DOUBLE_CLICK_SPEED
Definition: resource.h:66
#define IDI_FOLDER_OPEN
Definition: resource.h:22
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define UlongToPtr(u)
Definition: config.h:106
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define INT
Definition: polytest.cpp:20
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define PSN_RESET
Definition: prsht.h:118
struct _PSHNOTIFY * LPPSHNOTIFY
#define TB_TOP
Definition: commctrl.h:2084
#define TB_ENDTRACK
Definition: commctrl.h:2086
#define TB_PAGEUP
Definition: commctrl.h:2080
#define TB_BOTTOM
Definition: commctrl.h:2085
#define TBM_GETPOS
Definition: commctrl.h:2036
#define TB_PAGEDOWN
Definition: commctrl.h:2081
#define TBM_SETRANGE
Definition: commctrl.h:2042
#define TB_THUMBTRACK
Definition: commctrl.h:2083
#define TB_LINEUP
Definition: commctrl.h:2078
#define TBM_SETPOS
Definition: commctrl.h:2041
#define TB_LINEDOWN
Definition: commctrl.h:2079
#define WM_NOTIFY
Definition: richedit.h:61
ULONG g_OrigDoubleClickSpeed
Definition: mouse.c:51
HICON hButtonLeft
Definition: mouse.c:55
HICON hButtonRight
Definition: mouse.c:56
HICON hIcon2
Definition: mouse.c:59
BOOL g_ClickLockEnabled
Definition: mouse.c:52
BOOL bClicked
Definition: mouse.c:60
ULONG g_OrigSwapMouseButtons
Definition: mouse.c:49
DWORD g_ClickLockTime
Definition: mouse.c:53
ULONG g_DoubleClickSpeed
Definition: mouse.c:50
ULONG g_SwapMouseButtons
Definition: mouse.c:48
HICON hIcon1
Definition: mouse.c:58
NMHDR hdr
Definition: prsht.h:330
UINT code
Definition: winuser.h:3162
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI SetDoubleClickTime(_In_ UINT)
#define DWLP_USER
Definition: winuser.h:875
#define WM_HSCROLL
Definition: winuser.h:1746
#define BST_UNCHECKED
Definition: winuser.h:199
#define IMAGE_ICON
Definition: winuser.h:212
#define WM_COMMAND
Definition: winuser.h:1743
#define DialogBoxParam
Definition: winuser.h:5776
#define WM_INITDIALOG
Definition: winuser.h:1742
UINT WINAPI GetDoubleClickTime(void)
Definition: ntwrapper.h:314
#define STM_SETIMAGE
Definition: winuser.h:2096
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define BM_SETCHECK
Definition: winuser.h:1924
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1384
#define SendMessage
Definition: winuser.h:5855
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define LoadImage
Definition: winuser.h:5827
#define SPI_SETMOUSEBUTTONSWAP
Definition: winuser.h:1385
#define LR_DEFAULTCOLOR
Definition: winuser.h:1090
#define WM_DESTROY
Definition: winuser.h:1612
#define SM_SWAPBUTTON
Definition: winuser.h:987
#define STN_DBLCLK
Definition: winuser.h:2098
#define MAKEINTRESOURCE
Definition: winuser.h:591
int WINAPI GetSystemMetrics(_In_ int)
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1921
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105

◆ 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;
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 IDC_SLIDER_CLICK_LOCK
Definition: resource.h:96
#define IDI_LOCK_KEY
Definition: resource.h:23
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
#define DWORD
Definition: nt_native.h:44
#define ICON_SMALL
Definition: tnclass.cpp:48
#define IDCANCEL
Definition: winuser.h:834
#define IDOK
Definition: winuser.h:833
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

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}
#define _tcscat
Definition: tchar.h:622
#define _tcscpy
Definition: tchar.h:623
#define _tcsncmp
Definition: tchar.h:1428
#define GetEnvironmentVariable
Definition: winbase.h:3838

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:60
#define IDS_REMOVE_TITLE
Definition: resource.h:59
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3209
#define _stprintf
Definition: utility.h:124
long LONG
Definition: pedump.c:60
#define RegDeleteValue
Definition: winreg.h:508
#define CB_SETCURSEL
Definition: winuser.h:1964
#define MB_YESNO
Definition: winuser.h:820
#define IDNO
Definition: winuser.h:839
#define MB_ICONQUESTION
Definition: winuser.h:792
#define CB_DELETESTRING
Definition: winuser.h:1940

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 IDS_NONE
Definition: resource.h:133
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define _tcsdup
Definition: tchar.h:625
#define TEXT(s)
Definition: k32.h:26
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define ExpandEnvironmentStrings
Definition: winbase.h:3798
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define RegEnumValue
Definition: winreg.h:511
#define CB_SETITEMDATA
Definition: winuser.h:1969
#define CB_RESETCONTENT
Definition: winuser.h:1962
#define CB_ADDSTRING
Definition: winuser.h:1939

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);
878 }
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 _tcschr
Definition: tchar.h:1406
HCURSOR hCursor
Definition: mouse.c:114
TCHAR szCursorPath[MAX_PATH]
Definition: mouse.c:116
int32_t INT_PTR
Definition: typedefs.h:64
_In_ LPCSTR lpName
Definition: winbase.h:2813
_In_ DWORD nLength
Definition: wincon.h:473
HICON HCURSOR
Definition: windef.h:299
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition: cursoricon.c:2741
#define LR_LOADFROMFILE
Definition: winuser.h:1095
#define LR_SHARED
Definition: winuser.h:1103
#define IMAGE_CURSOR
Definition: winuser.h:213
#define LR_DEFAULTSIZE
Definition: winuser.h:1097

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}
static VOID ReloadCurrentCursorScheme(VOID)
Definition: mouse.c:921
static VOID RefreshCursorList(HWND hwndDlg, BOOL bInit)
Definition: mouse.c:575
#define IDC_BUTTON_DELETE_SCHEME
Definition: resource.h:82
#define _tcsncat
Definition: tchar.h:1408
#define RegQueryValueEx
Definition: winreg.h:524
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1943

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
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint buffer
Definition: glext.h:5915
_In_ BOOL bEnable
Definition: winddi.h:3426

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 UINT i;
1835 INT nPage = 0;
1836 LONG ret;
1837
1838 UNREFERENCED_PARAMETER(lParam1);
1839 UNREFERENCED_PARAMETER(lParam2);
1842
1843 if (uMsg == CPL_STARTWPARMSW && lParam2 != 0)
1844 nPage = _wtoi((PWSTR)lParam2);
1845
1846 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
1847 psh.dwSize = sizeof(PROPSHEETHEADER);
1849 psh.hwndParent = hwnd;
1850 psh.hInstance = hApplet;
1851 psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON_1);
1852 psh.pszCaption = MAKEINTRESOURCEW(IDS_CPLNAME_1);
1853 psh.nStartPage = 0;
1854 psh.phpage = hpsp;
1855 psh.pfnCallback = PropSheetProc;
1856
1857 /* Load additional pages provided by shell extensions */
1859
1860 for (i = 0; i != sizeof(PropPages) / sizeof(PropPages[0]); i++)
1861 {
1862 /* Override the background page if requested by a shell extension */
1863 if (PropPages[i].uiReplaceWith != 0 && hpsxa != NULL &&
1865 {
1866 /* The shell extension added one or more pages to replace a page.
1867 Don't create the built-in page anymore! */
1868 continue;
1869 }
1870
1872 }
1873
1874 if (hpsxa != NULL)
1876
1877 if (nPage != 0 && nPage <= psh.nPages)
1878 psh.nStartPage = nPage;
1879
1880 ret = (LONG)(PropertySheet(&psh) != -1);
1881
1882 if (hpsxa != NULL)
1884
1885 return ret;
1886}
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: advmon.c:12
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
Definition: propsheet.c:15
#define CPL_STARTWPARMSW
Definition: cpl.h:21
#define IDC_CPLICON_1
Definition: resource.h:4
#define IDS_CPLNAME_1
Definition: resource.h:6
#define MAX_CPL_PAGES
Definition: main.h:47
WORD idDlg
Definition: mouse.c:1816
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: mouse.c:1798
UINT uiReplaceWith
Definition: mouse.c:1818
DLGPROC DlgProc
Definition: mouse.c:1817
static const struct @222 PropPages[]
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PropertySheet
Definition: prsht.h:400
#define PSH_USEICONID
Definition: prsht.h:42
#define REGSTR_PATH_CONTROLSFOLDER
Definition: regstr.h:76
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2390
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
Definition: shellord.c:2359
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:2213
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
Definition: shellord.c:2243
uint16_t * PWSTR
Definition: typedefs.h:56
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ 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}
@ HWPD_STANDARDLIST
Definition: main.h:24
HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)

◆ 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,
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}
TCHAR szCursorName[MAX_PATH]
Definition: mouse.c:115
INT cxCursor
Definition: mouse.c:69
ULONG_PTR itemData
Definition: winuser.h:3096
LONG right
Definition: windef.h:308
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define ODS_SELECTED
Definition: winuser.h:2548
#define COLOR_WINDOW
Definition: winuser.h:921
#define COLOR_WINDOWTEXT
Definition: winuser.h:924
#define COLOR_HIGHLIGHT
Definition: winuser.h:929
BOOL WINAPI DrawIcon(_In_ HDC, _In_ int, _In_ int, _In_ HICON)
Definition: cursoricon.c:2070
#define DT_SINGLELINE
Definition: winuser.h:540
#define DrawText
Definition: winuser.h:5783
#define DT_LEFT
Definition: winuser.h:534
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:930
#define DT_VCENTER
Definition: winuser.h:543
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define ODS_FOCUS
Definition: winuser.h:2552

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);
1440 }
1441
1442 if (pOptionData->bSnapToDefaultButton)
1443 {
1444 hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_SNAP_TO);
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);
1468 }
1469
1470 if (pOptionData->bMouseSonar)
1471 {
1472 hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_SHOW_POINTER);
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:
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 IntToPtr(i)
Definition: basetsd.h:89
#define DEFAULT_MOUSE_THRESHOLD2
Definition: mouse.c:41
#define DEFAULT_MOUSE_ACCELERATION
Definition: mouse.c:39
struct _OPTION_DATA * POPTION_DATA
#define DEFAULT_MOUSE_SPEED
Definition: mouse.c:38
#define DEFAULT_MOUSE_THRESHOLD1
Definition: mouse.c:40
#define IDC_SLIDER_MOUSE_SPEED
Definition: resource.h:73
#define IDC_SLIDER_POINTER_TRAIL
Definition: resource.h:79
#define IDC_CHECK_SHOW_POINTER
Definition: resource.h:75
#define IDC_CHECK_POINTER_TRAIL
Definition: resource.h:77
#define IDC_CHECK_POINTER_PRECISION
Definition: resource.h:78
#define IDC_TEXT_TRAIL_LONG
Definition: resource.h:107
#define IDC_TEXT_TRAIL_SHORT
Definition: resource.h:106
#define IDC_CHECK_SNAP_TO
Definition: resource.h:74
#define IDC_CHECK_HIDE_POINTER
Definition: resource.h:76
INT nThreshold1
Definition: mouse.c:76
INT nAcceleration
Definition: mouse.c:78
INT nThreshold2
Definition: mouse.c:77
BOOL bSnapToDefaultButton
Definition: mouse.c:89
BOOL bOrigMouseSonar
Definition: mouse.c:99
BOOL bOrigSnapToDefaultButton
Definition: mouse.c:90
UINT uMouseTrails
Definition: mouse.c:92
UINT uOrigMouseTrails
Definition: mouse.c:93
MOUSE_ACCEL OrigMouseAccel
Definition: mouse.c:87
ULONG ulOrigMouseSpeed
Definition: mouse.c:84
ULONG ulMouseSpeed
Definition: mouse.c:83
BOOL bMouseSonar
Definition: mouse.c:98
BOOL bMouseVanish
Definition: mouse.c:95
BOOL bOrigMouseVanish
Definition: mouse.c:96
MOUSE_ACCEL MouseAccel
Definition: mouse.c:86
uint32_t ULONG
Definition: typedefs.h:59
#define SPI_GETMOUSE
Definition: winuser.h:1358
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SPI_SETMOUSE
Definition: winuser.h:1359

◆ 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
1232 return TRUE;
1233 else
1234 return FALSE;
1235
1236 case WM_MEASUREITEM:
1238 break;
1239
1240 case WM_DRAWITEM:
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 _POINTER_DATA * PPOINTER_DATA
static BOOL BrowseCursor(HWND hwndDlg)
Definition: mouse.c:827
static VOID OnDrawItem(UINT idCtl, LPDRAWITEMSTRUCT lpdis, PPOINTER_DATA pPointerData)
Definition: mouse.c:943
static BOOL SaveCursorScheme(HWND hwndDlg)
Definition: mouse.c:696
static VOID LoadInitialCursorScheme(HWND hwndDlg)
Definition: mouse.c:1031
static BOOL EnumerateCursorSchemes(HWND hwndDlg)
Definition: mouse.c:462
static VOID LoadNewCursorScheme(HWND hwndDlg)
Definition: mouse.c:999
static BOOL ApplyCursorScheme(HWND hwndDlg)
Definition: mouse.c:1127
static BOOL DeleteUserCursorScheme(HWND hwndDlg)
Definition: mouse.c:607
#define IDC_BUTTON_BROWSE_CURSOR
Definition: resource.h:92
#define IDC_CHECK_CURSOR_SHADOW
Definition: resource.h:83
#define IDC_BUTTON_SAVEAS_SCHEME
Definition: resource.h:93
#define IDC_IMAGE_CURRENT_CURSOR
Definition: resource.h:98
#define IDC_BUTTON_USE_DEFAULT_CURSOR
Definition: resource.h:91
BOOL bCursorShadow
Definition: mouse.c:66
BOOL bOrigCursorShadow
Definition: mouse.c:67
INT cyCursor
Definition: mouse.c:70
struct tagMEASUREITEMSTRUCT * LPMEASUREITEMSTRUCT
#define LBN_DBLCLK
Definition: winuser.h:2074
#define WM_DRAWITEM
Definition: winuser.h:1648
#define WM_MEASUREITEM
Definition: winuser.h:1649
#define LBN_SELCHANGE
Definition: winuser.h:2078
#define CBN_SELENDOK
Definition: winuser.h:1984
#define SM_CYCURSOR
Definition: winuser.h:978
#define SM_CXCURSOR
Definition: winuser.h:977

◆ 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}
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define ICON_BIG
Definition: tnclass.cpp:51
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

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_ADDSTRING
Definition: winuser.h:2034
#define LB_RESETCONTENT
Definition: winuser.h:2058
#define LB_SETCURSEL
Definition: winuser.h:2066
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

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}

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}
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
static INT_PTR CALLBACK SaveSchemeProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:660
#define IDS_OVERWRITE_TEXT
Definition: resource.h:62
#define IDS_OVERWRITE_TITLE
Definition: resource.h:61
#define IDD_CURSOR_SCHEME_SAVEAS
Definition: resource.h:32
#define _tcscmp
Definition: tchar.h:1424
#define CB_GETCOUNT
Definition: winuser.h:1945

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 IDC_EDIT_SCHEME_NAME
Definition: resource.h:94
#define WM_GETTEXT
Definition: winuser.h:1621
#define WM_SETTEXT
Definition: winuser.h:1620

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);
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);
1718
1719 /* Set the default scroll lines value */
1720 if (bInit != FALSE)
1722 }
1723}
#define DEFAULT_WHEEL_SCROLL_LINES
Definition: mouse.c:44
#define IDC_UPDOWN_WHEEL_SCROLL_LINES
Definition: resource.h:71
#define IDC_EDIT_WHEEL_SCROLL_LINES
Definition: resource.h:70
#define IDC_RADIO_WHEEL_SCROLL_LINES
Definition: resource.h:69
#define IDC_RADIO_WHEEL_SCROLL_PAGE
Definition: resource.h:72
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
#define WHEEL_PAGESCROLL
Definition: zmouse.h:26

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}
struct _WHEEL_DATA * PWHEEL_DATA
static VOID ShowDialogWheelControls(HWND hwndDlg, UINT uWheelScrollLines, BOOL bInit)
Definition: mouse.c:1687
#define UDM_SETRANGE
Definition: commctrl.h:2146
UINT uWheelScrollLines
Definition: mouse.c:105
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
#define EN_CHANGE
Definition: winuser.h:2025
#define SPI_SETWHEELSCROLLLINES
Definition: zmouse.h:30

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_HELP
Definition: resource.h:3
#define IDS_NO
Definition: resource.h:17
#define IDS_NWPEN
Definition: resource.h:46
#define IDS_CROSSHAIR
Definition: resource.h:44
#define IDS_WAIT
Definition: resource.h:43
#define IDS_SIZENS
Definition: resource.h:48
#define IDS_UPARROW
Definition: resource.h:53
#define IDS_SIZENWSE
Definition: resource.h:50
#define IDS_IBEAM
Definition: resource.h:45
#define IDS_SIZENESW
Definition: resource.h:51
#define IDS_SIZEWE
Definition: resource.h:49
#define IDS_SIZEALL
Definition: resource.h:52
#define IDS_APPSTARTING
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().

◆ 

const struct { ... } PropPages[]
Initial value:
=
{
}
#define CPLPAGE_MOUSE_BUTTONS
Definition: cplext.h:4
#define CPLPAGE_MOUSE_WHEEL
Definition: cplext.h:6
#define CPLPAGE_MOUSE_PTRMOTION
Definition: cplext.h:5
static INT_PTR CALLBACK WheelProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:1727
static INT_PTR CALLBACK MouseHardwareProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:156
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
static INT_PTR CALLBACK OptionProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:1382
#define IDD_PAGE_WHEEL
Definition: resource.h:28
#define IDD_PAGE_OPTION
Definition: resource.h:27
#define IDD_PAGE_BUTTON
Definition: resource.h:25
#define IDD_PAGE_POINTER
Definition: resource.h:26
#define IDD_HARDWARE
Definition: resource.h:30

Referenced by MouseApplet().

◆ uiReplaceWith

UINT uiReplaceWith

Definition at line 1818 of file mouse.c.

Referenced by MouseApplet().