ReactOS  0.4.14-dev-114-gc8cbd56
mouse.c
Go to the documentation of this file.
1 /*
2  * ReactOS
3  * Copyright (C) 2004, 2007 ReactOS Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 /*
20  * PROJECT: ReactOS Main Control Panel
21  * FILE: dll/cpl/main/mouse.c
22  * PURPOSE: Mouse Control Panel
23  * PROGRAMMER: Eric Kohl
24  * Johannes Anderwald
25  */
26 
27 // TODO:
28 // Add missing icons
29 
30 #include "main.h"
31 
32 #include <commdlg.h>
33 #include <cplext.h>
34 #include <tchar.h>
35 
36 #define DEFAULT_DOUBLE_CLICK_SPEED 500
37 #define DEFAULT_CLICK_LOCK_TIME 2200
38 #define DEFAULT_MOUSE_SPEED 10
39 #define DEFAULT_MOUSE_ACCELERATION 1
40 #define DEFAULT_MOUSE_THRESHOLD1 6
41 #define DEFAULT_MOUSE_THRESHOLD2 10
42 #define MIN_DOUBLE_CLICK_SPEED 200
43 #define MAX_DOUBLE_CLICK_SPEED 900
44 #define DEFAULT_WHEEL_SCROLL_LINES 3
45 
46 typedef struct _BUTTON_DATA
47 {
50  ULONG g_DoubleClickSpeed; // = DEFAULT_DOUBLE_CLICK_SPEED;
53  DWORD g_ClickLockTime; // = DEFAULT_CLICK_LOCK_TIME;
54 
57 
62 
63 
64 typedef struct _POINTER_DATA
65 {
68 
72 
73 
74 typedef struct _MOUSE_ACCEL
75 {
79 } MOUSE_ACCEL;
80 
81 typedef struct _OPTION_DATA
82 {
85 
88 
91 
94 
97 
101 
102 
103 typedef struct _WHEEL_DATA
104 {
107 
108 
109 typedef struct _CURSOR_DATA
110 {
118 
119 
121 {{IDS_ARROW, 100/*OCR_NORMAL*/, _T("Arrow"), 0, _T(""), _T("")},
122  {IDS_HELP, 112/*OCR_HELP*/, _T("Help"), 0, _T(""), _T("")},
123  {IDS_APPSTARTING, 111/*OCR_APPSTARTING*/, _T("AppStarting"), 0, _T(""), _T("")},
124  {IDS_WAIT, 102/*OCR_WAIT*/, _T("Wait"), 0, _T(""), _T("")},
125  {IDS_CROSSHAIR, 103/*OCR_CROSS*/, _T("Crosshair"), 0, _T(""), _T("")},
126  {IDS_IBEAM, 101/*OCR_IBEAM*/, _T("IBeam"), 0, _T(""), _T("")},
127  {IDS_NWPEN, 113/*OCR_NWPEN*/, _T("NWPen"), 0, _T(""), _T("")},
128  {IDS_NO, 110/*OCR_NO*/, _T("No"), 0, _T(""), _T("")},
129  {IDS_SIZENS, 108/*OCR_SIZENS*/, _T("SizeNS"), 0, _T(""), _T("")},
130  {IDS_SIZEWE, 107/*OCR_SIZEWE*/, _T("SizeWE"), 0, _T(""), _T("")},
131  {IDS_SIZENWSE, 105/*OCR_SIZENWSE*/, _T("SizeNWSE"), 0, _T(""), _T("")},
132  {IDS_SIZENESW, 106/*OCR_SIZENESW*/, _T("SizeNESW"), 0, _T(""), _T("")},
133  {IDS_SIZEALL, 109/*OCR_SIZEALL*/, _T("SizeAll"), 0, _T(""), _T("")},
134  {IDS_UPARROW, 104/*OCR_UP*/, _T("UpArrow"), 0, _T(""), _T("")},
135  {IDS_HAND, 114/*OCR_HAND*/, _T("Hand"), 0, _T(""), _T("")}};
136 
137 
138 #if 0
139 static VOID
140 DebugMsg(LPTSTR fmt, ...)
141 {
142  TCHAR szBuffer[2048];
143  va_list marker;
144 
145  va_start(marker, fmt);
146  _vstprintf(szBuffer, fmt, marker);
147  va_end(marker);
148 
149  MessageBox(NULL, szBuffer, _T("Debug message"), MB_OK);
150 }
151 #endif
152 
153 
154 /* Property page dialog callback */
155 static INT_PTR CALLBACK
157  IN UINT uMsg,
158  IN WPARAM wParam,
159  IN LPARAM lParam)
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 }
180 
181 
182 static INT_PTR CALLBACK
184  IN UINT uMsg,
185  IN WPARAM wParam,
186  IN LPARAM lParam)
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 }
230 
231 
232 static INT_PTR CALLBACK
234  IN UINT uMsg,
235  IN WPARAM wParam,
236  IN LPARAM lParam)
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 
252  pButtonData->g_SwapMouseButtons = GetSystemMetrics(SM_SWAPBUTTON);
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 */
262  pButtonData->hButtonLeft = LoadImage(hApplet, MAKEINTRESOURCE(IDI_MOUSE_LEFT), IMAGE_ICON, 48, 48, LR_DEFAULTCOLOR);
263  pButtonData->hButtonRight = LoadImage(hApplet, MAKEINTRESOURCE(IDI_MOUSE_RIGHT), IMAGE_ICON, 48, 48, LR_DEFAULTCOLOR);
264 
265  /* Load folder icons */
267  pButtonData->hIcon2 = LoadImage(hApplet, MAKEINTRESOURCE(IDI_FOLDER_OPEN), IMAGE_ICON, 48, 48, LR_DEFAULTCOLOR);
268 
269  if (pButtonData->g_SwapMouseButtons)
270  {
272  SendDlgItemMessage(hwndDlg, IDC_IMAGE_SWAP_MOUSE, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pButtonData->hButtonRight);
273  }
274  else
275  {
276  SendDlgItemMessage(hwndDlg, IDC_IMAGE_SWAP_MOUSE, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pButtonData->hButtonLeft);
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;
316  SendDlgItemMessage(hwndDlg, IDC_IMAGE_SWAP_MOUSE, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pButtonData->hButtonLeft);
317  }
318  else if (lResult == BST_UNCHECKED)
319  {
320  pButtonData->g_SwapMouseButtons = TRUE;
322  SendDlgItemMessage(hwndDlg, IDC_IMAGE_SWAP_MOUSE, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pButtonData->hButtonRight);
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;
368  SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_OrigSwapMouseButtons, NULL, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
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 */
383  SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_OrigSwapMouseButtons, NULL, 0);
384 
385  /* Reset double click speed setting */
386  SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_OrigDoubleClickSpeed, NULL, 0);
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);
406  SetDoubleClickTime(pButtonData->g_DoubleClickSpeed);
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);
413  SetDoubleClickTime(pButtonData->g_DoubleClickSpeed);
414  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
415  break;
416  }
417  }
418  break;
419  }
420 
421  return FALSE;
422 }
423 
424 
425 static VOID
426 CompressPath(LPTSTR lpShortPath, LPTSTR lpPath)
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 }
459 
460 
461 static BOOL
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 }
572 
573 
574 static VOID
575 RefreshCursorList(HWND hwndDlg, BOOL bInit)
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 }
604 
605 
606 static BOOL
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 }
657 
658 
659 static INT_PTR CALLBACK
661  IN UINT uMsg,
662  IN WPARAM wParam,
663  IN LPARAM lParam)
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 }
693 
694 
695 static BOOL
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 }
824 
825 
826 static BOOL
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 }
865 
866 
867 static VOID
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 }
918 
919 
920 static VOID
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 }
940 
941 
942 static VOID
944  LPDRAWITEMSTRUCT lpdis,
945  PPOINTER_DATA pPointerData)
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 }
996 
997 
998 static VOID
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 }
1028 
1029 
1030 static VOID
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 }
1124 
1125 
1126 static BOOL
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 }
1196 
1197 
1198 static INT_PTR CALLBACK
1200  IN UINT uMsg,
1201  IN WPARAM wParam,
1202  IN LPARAM lParam)
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 }
1379 
1380 
1381 static INT_PTR CALLBACK
1383  IN UINT uMsg,
1384  IN WPARAM wParam,
1385  IN LPARAM lParam)
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  {
1407  pOptionData->MouseAccel.nAcceleration = DEFAULT_MOUSE_ACCELERATION;
1408  pOptionData->MouseAccel.nThreshold1 = DEFAULT_MOUSE_THRESHOLD1;
1409  pOptionData->MouseAccel.nThreshold2 = DEFAULT_MOUSE_THRESHOLD2;
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  {
1583  SystemParametersInfo(SPI_SETMOUSE, 0, &pOptionData->MouseAccel, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
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 }
1684 
1685 
1686 static VOID
1687 ShowDialogWheelControls(HWND hwndDlg, UINT uWheelScrollLines, BOOL bInit)
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 }
1724 
1725 
1726 static INT_PTR CALLBACK
1728  IN UINT uMsg,
1729  IN WPARAM wParam,
1730  IN LPARAM lParam)
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  {
1750  SetDlgItemInt(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES, pWheelData->uWheelScrollLines, FALSE);
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  {
1762  pWheelData->uWheelScrollLines = GetDlgItemInt(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES, NULL, FALSE);
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  {
1776  pWheelData->uWheelScrollLines = GetDlgItemInt(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES, NULL, FALSE);
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  {
1787  SystemParametersInfo(SPI_SETWHEELSCROLLLINES, pWheelData->uWheelScrollLines,
1789  return TRUE;
1790  }
1791  break;
1792  }
1793 
1794  return FALSE;
1795 }
1796 
1797 static int CALLBACK
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 }
1813 
1814 static const struct
1815 {
1819 } PropPages[] =
1820 {
1822  { IDD_PAGE_POINTER, PointerProc, 0 },
1826 };
1827 
1828 LONG APIENTRY
1829 MouseApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
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 }
1883 
1884 /* EOF */
static VOID LoadCursorScheme(LPTSTR lpName, BOOL bSystem)
Definition: mouse.c:868
#define RegQueryValueEx
Definition: winreg.h:524
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define LB_SETCURSEL
Definition: winuser.h:2045
struct tagMEASUREITEMSTRUCT * LPMEASUREITEMSTRUCT
#define OFN_EXPLORER
Definition: commdlg.h:104
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:1755
#define DEFAULT_MOUSE_ACCELERATION
Definition: mouse.c:39
#define TB_THUMBTRACK
Definition: commctrl.h:2050
LPTSTR lpValueName
Definition: mouse.c:113
BOOL bSnapToDefaultButton
Definition: mouse.c:89
#define CB_SETITEMDATA
Definition: winuser.h:1948
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _BUTTON_DATA BUTTON_DATA
#define IDS_REMOVE_TEXT
Definition: resource.h:58
#define MAKEINTRESOURCE
Definition: winuser.h:591
HICON hButtonLeft
Definition: mouse.c:55
#define IN
Definition: typedefs.h:38
#define IDS_REMOVE_TITLE
Definition: resource.h:57
static BOOL DeleteUserCursorScheme(HWND hwndDlg)
Definition: mouse.c:607
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define IDI_MOUSE_RIGHT
Definition: resource.h:11
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define TB_PAGEDOWN
Definition: commctrl.h:2048
DWORD g_ClickLockTime
Definition: mouse.c:53
#define IDOK
Definition: winuser.h:824
#define COLOR_HIGHLIGHT
Definition: winuser.h:916
#define LR_SHARED
Definition: winuser.h:1090
HICON hIcon1
Definition: mouse.c:58
#define IMAGE_ICON
Definition: winuser.h:212
#define IDD_PAGE_WHEEL
Definition: resource.h:26
static VOID LoadNewCursorScheme(HWND hwndDlg)
Definition: mouse.c:999
#define SPI_SETMOUSEBUTTONSWAP
Definition: winuser.h:1364
#define ERROR_SUCCESS
Definition: deptool.c:10
#define IDS_SIZEALL
Definition: resource.h:50
#define DEFAULT_MOUSE_THRESHOLD2
Definition: mouse.c:41
BOOL WINAPI SetDoubleClickTime(_In_ UINT)
GLint x0
Definition: linetemp.h:95
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define LB_ADDSTRING
Definition: winuser.h:2013
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
struct _PSHNOTIFY * LPPSHNOTIFY
HWND hwndOwner
Definition: commdlg.h:330
TCHAR szCursorPath[MAX_PATH]
Definition: mouse.c:116
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define KEY_READ
Definition: nt_native.h:1023
int _tcscmp(const _TCHAR *s1, const _TCHAR *s2)
Definition: tcscmp.h:8
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CB_GETLBTEXT
Definition: winuser.h:1934
INT nAcceleration
Definition: mouse.c:78
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:1577
#define LR_LOADFROMFILE
Definition: winuser.h:1082
ULONG ulOrigMouseSpeed
Definition: mouse.c:84
#define IDC_RADIO_WHEEL_SCROLL_LINES
Definition: resource.h:67
#define CB_GETITEMDATA
Definition: winuser.h:1932
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HICON hIcon2
Definition: mouse.c:59
#define IDI_FOLDER_CLOSED
Definition: resource.h:9
#define IMAGE_CURSOR
Definition: winuser.h:213
#define WM_GETTEXT
Definition: winuser.h:1600
#define IDS_NONE
Definition: resource.h:122
INT nThreshold2
Definition: mouse.c:77
#define REGSTR_PATH_CONTROLSFOLDER
Definition: regstr.h:76
#define ExpandEnvironmentStrings
Definition: winbase.h:3598
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
#define SPI_SETWHEELSCROLLLINES
Definition: zmouse.h:30
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT)
#define IDD_PAGE_BUTTON
Definition: resource.h:23
UINT uMouseTrails
Definition: mouse.c:92
#define INT
Definition: polytest.cpp:20
#define _vstprintf
Definition: tchar.h:540
#define IDC_COMBO_CURSOR_SCHEME
Definition: resource.h:79
#define IDC_SLIDER_CLICK_LOCK
Definition: resource.h:94
#define CALLBACK
Definition: compat.h:27
_In_ DWORD nLength
Definition: wincon.h:461
_In_ LPCSTR lpName
Definition: winbase.h:2736
#define TBM_SETRANGE
Definition: commctrl.h:2009
#define SM_CYCURSOR
Definition: winuser.h:965
CURSOR_DATA g_CursorData[]
Definition: mouse.c:120
#define SystemParametersInfo
Definition: winuser.h:5759
struct _OPTION_DATA * POPTION_DATA
LONG top
Definition: windef.h:292
ULONG_PTR itemData
Definition: winuser.h:3067
OPENFILENAME ofn
Definition: main.cpp:37
#define IDC_SWAP_MOUSE_BUTTONS
Definition: resource.h:63
#define ODS_FOCUS
Definition: winuser.h:2524
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
#define ZeroMemory
Definition: winbase.h:1642
#define SPI_SETMOUSE
Definition: winuser.h:1338
GLuint buffer
Definition: glext.h:5915
#define TBM_SETPOS
Definition: commctrl.h:2008
#define IDC_IMAGE_DOUBLE_CLICK_SPEED
Definition: resource.h:83
#define _tcsdup
Definition: tchar.h:625
HINSTANCE hApplet
Definition: access.c:17
#define IDC_CHECK_POINTER_TRAIL
Definition: resource.h:75
#define IDS_SYSTEM_SCHEME
Definition: resource.h:54
UINT uiReplaceWith
Definition: mouse.c:1818
UINT_PTR WPARAM
Definition: windef.h:207
LONG APIENTRY MouseApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: mouse.c:1829
#define SendDlgItemMessage
Definition: winuser.h:5743
#define IDC_BUTTON_SAVEAS_SCHEME
Definition: resource.h:91
#define PSN_APPLY
Definition: prsht.h:117
LONG left
Definition: windef.h:291
#define IDS_UPARROW
Definition: resource.h:51
HICON HCURSOR
Definition: windef.h:284
#define IDC_CHECK_HIDE_POINTER
Definition: resource.h:74
static VOID OnDrawItem(UINT idCtl, LPDRAWITEMSTRUCT lpdis, PPOINTER_DATA pPointerData)
Definition: mouse.c:943
int32_t INT_PTR
Definition: typedefs.h:62
static BOOL BrowseCursor(HWND hwndDlg)
Definition: mouse.c:827
#define PSH_USECALLBACK
Definition: prsht.h:48
UINT uOrigMouseTrails
Definition: mouse.c:93
#define IDS_WAIT
Definition: resource.h:41
LONG right
Definition: windef.h:293
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: mouse.c:1798
#define IDS_IBEAM
Definition: resource.h:43
#define LBN_SELCHANGE
Definition: winuser.h:2057
BOOL bOrigSnapToDefaultButton
Definition: mouse.c:90
#define COLOR_WINDOW
Definition: winuser.h:908
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
#define GetOpenFileName
Definition: commdlg.h:665
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1925
#define IDC_CHECK_POINTER_PRECISION
Definition: resource.h:76
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define CPLPAGE_MOUSE_BUTTONS
Definition: cplext.h:4
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define IDS_SIZENESW
Definition: resource.h:49
#define DrawText
Definition: winuser.h:5672
#define TB_PAGEUP
Definition: commctrl.h:2047
UINT uDefaultCursorId
Definition: mouse.c:112
struct _MOUSE_ACCEL MOUSE_ACCEL
DWORD nMaxFile
Definition: commdlg.h:337
#define ICON_SMALL
Definition: tnclass.cpp:48
#define TB_LINEDOWN
Definition: commctrl.h:2046
#define IDC_BUTTON_BROWSE_CURSOR
Definition: resource.h:90
#define IDS_NWPEN
Definition: resource.h:44
#define STN_DBLCLK
Definition: winuser.h:2077
static BOOL SaveCursorScheme(HWND hwndDlg)
Definition: mouse.c:696
#define CPLPAGE_MOUSE_WHEEL
Definition: cplext.h:6
UINT code
Definition: winuser.h:3133
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
#define MAX_CPL_PAGES
Definition: main.h:47
static INT_PTR CALLBACK PointerProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:1199
NMHDR hdr
Definition: prsht.h:312
#define TB_BOTTOM
Definition: commctrl.h:2052
#define IDS_BROWSE_FILTER
Definition: resource.h:55
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:2037
struct _BUTTON_DATA * PBUTTON_DATA
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
struct _POINTER_DATA POINTER_DATA
unsigned char * LPBYTE
Definition: typedefs.h:52
BOOL bOrigMouseSonar
Definition: mouse.c:99
#define va_end(ap)
Definition: acmsvcex.h:90
#define IDS_SIZENWSE
Definition: resource.h:48
#define PSH_USEICONID
Definition: prsht.h:42
static INT_PTR CALLBACK ClickLockProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:183
#define MB_YESNO
Definition: winuser.h:811
#define DT_LEFT
Definition: winuser.h:534
static const WCHAR szText[]
Definition: dialog.c:139
#define LB_ERR
Definition: winuser.h:2407
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL bClicked
Definition: mouse.c:60
#define CBN_SELENDOK
Definition: winuser.h:1963
static INT_PTR CALLBACK ButtonProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:233
long LONG
Definition: pedump.c:60
#define TBM_GETPOS
Definition: commctrl.h:2003
#define IDC_SLIDER_DOUBLE_CLICK_SPEED
Definition: resource.h:64
INT cyCursor
Definition: mouse.c:70
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
MOUSE_ACCEL OrigMouseAccel
Definition: mouse.c:87
ULONG g_SwapMouseButtons
Definition: mouse.c:48
#define SPI_GETMOUSE
Definition: winuser.h:1337
#define CB_ADDSTRING
Definition: winuser.h:1918
#define IDS_SIZEWE
Definition: resource.h:47
#define MAKELONG(a, b)
Definition: typedefs.h:248
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
WORD idDlg
Definition: mouse.c:1816
#define PROPSHEETHEADER
Definition: prsht.h:374
#define MB_ICONQUESTION
Definition: winuser.h:783
static VOID ShowDialogWheelControls(HWND hwndDlg, UINT uWheelScrollLines, BOOL bInit)
Definition: mouse.c:1687
#define CPLPAGE_MOUSE_PTRMOTION
Definition: cplext.h:5
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_TEXT_TRAIL_LONG
Definition: resource.h:105
LPTSTR szFilter
Definition: mplay32.c:30
int marker
Definition: jpeglib.h:1027
char * va_list
Definition: acmsvcex.h:78
#define IDS_NO
Definition: resource.h:17
#define BM_GETCHECK
Definition: winuser.h:1900
#define UDM_SETRANGE
Definition: commctrl.h:2113
struct _WHEEL_DATA WHEEL_DATA
GLuint index
Definition: glext.h:6031
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
#define DT_VCENTER
Definition: winuser.h:543
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:917
#define IDC_CHECK_SHOW_POINTER
Definition: resource.h:73
#define WM_SETTEXT
Definition: winuser.h:1599
#define CB_RESETCONTENT
Definition: winuser.h:1941
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
_TCHAR * _tcschr(const _TCHAR *s, _XINT c)
Definition: tcschr.h:4
#define UlongToPtr(u)
Definition: config.h:106
#define CB_ERR
Definition: winuser.h:2410
struct _POINTER_DATA * PPOINTER_DATA
#define IDS_CPLNAME_1
Definition: resource.h:6
#define IDC_SLIDER_MOUSE_SPEED
Definition: resource.h:71
#define WM_DESTROY
Definition: winuser.h:1591
#define IDI_LOOK_KEY
Definition: resource.h:21
#define IDC_CHECK_SNAP_TO
Definition: resource.h:72
#define IntToPtr(i)
Definition: basetsd.h:89
#define _tcsstr
Definition: xmlstorage.h:199
static TCHAR szTempPath[MAX_PATH]
Definition: CImage.cpp:25
#define IDS_OVERWRITE_TEXT
Definition: resource.h:60
static BOOL EnumerateCursorSchemes(HWND hwndDlg)
Definition: mouse.c:462
BOOL bCursorShadow
Definition: mouse.c:66
char TCHAR
Definition: xmlstorage.h:189
#define DEFAULT_MOUSE_SPEED
Definition: mouse.c:38
#define RegDeleteValue
Definition: winreg.h:508
#define BM_SETCHECK
Definition: winuser.h:1903
#define _T(x)
Definition: vfdio.h:22
_TCHAR * _tcsncat(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncat.h:5
#define IDC_IMAGE_SWAP_MOUSE
Definition: resource.h:82
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition: cursoricon.c:2654
#define IDC_EDIT_SCHEME_NAME
Definition: resource.h:92
#define GetProcessHeap()
Definition: compat.h:395
#define IDC_BUTTON_CLICK_LOCK
Definition: resource.h:66
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
struct _CURSOR_DATA CURSOR_DATA
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SM_CXCURSOR
Definition: winuser.h:964
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
#define IDS_APPSTARTING
Definition: resource.h:40
INT cxCursor
Definition: mouse.c:69
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
static VOID LoadInitialCursorScheme(HWND hwndDlg)
Definition: mouse.c:1031
#define IDS_SIZENS
Definition: resource.h:46
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
static VOID RefreshCursorList(HWND hwndDlg, BOOL bInit)
Definition: mouse.c:575
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
#define IDD_HARDWARE
Definition: resource.h:28
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned short WORD
Definition: ntddk_ex.h:93
#define IDI_MOUSE_LEFT
Definition: resource.h:10
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
#define IDC_LISTBOX_CURSOR
Definition: resource.h:78
#define WM_MEASUREITEM
Definition: winuser.h:1628
BOOL bOrigMouseVanish
Definition: mouse.c:96
#define LBN_DBLCLK
Definition: winuser.h:2053
#define IDS_OVERWRITE_TITLE
Definition: resource.h:59
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define IDC_BUTTON_DELETE_SCHEME
Definition: resource.h:80
ULONG g_OrigSwapMouseButtons
Definition: mouse.c:49
#define TB_LINEUP
Definition: commctrl.h:2045
#define TB_ENDTRACK
Definition: commctrl.h:2053
DLGPROC DlgProc
Definition: mouse.c:1817
BOOL bOrigCursorShadow
Definition: mouse.c:67
#define IDC_BUTTON_USE_DEFAULT_CURSOR
Definition: resource.h:89
struct _OPTION_DATA OPTION_DATA
#define DialogBoxParam
Definition: winuser.h:5665
int ret
#define TB_TOP
Definition: commctrl.h:2051
static INT_PTR CALLBACK OptionProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:1382
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
#define index(s, c)
Definition: various.h:29
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
Definition: propsheet.c:15
#define DWLP_USER
Definition: winuser.h:866
#define IDC_CHECK_CLICK_LOCK
Definition: resource.h:65
#define MB_ICONERROR
Definition: winuser.h:781
#define IDC_UPDOWN_WHEEL_SCROLL_LINES
Definition: resource.h:69
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define MessageBox
Definition: winuser.h:5723
#define IDS_ARROW
Definition: resource.h:38
#define CB_SETCURSEL
Definition: winuser.h:1943
#define WM_COMMAND
Definition: winuser.h:1722
UINT uWheelScrollLines
Definition: mouse.c:105
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: advmon.c:13
static INT_PTR CALLBACK WheelProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:1727
#define BST_UNCHECKED
Definition: winuser.h:199
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1363
UINT uStringId
Definition: mouse.c:111
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2870
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define DEFAULT_MOUSE_THRESHOLD1
Definition: mouse.c:40
HICON hButtonRight
Definition: mouse.c:56
#define _stprintf
Definition: utility.h:124
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
#define DT_SINGLELINE
Definition: winuser.h:540
HWND WINAPI GetParent(_In_ HWND)
struct _WHEEL_DATA * PWHEEL_DATA
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static VOID CompressPath(LPTSTR lpShortPath, LPTSTR lpPath)
Definition: mouse.c:426
#define RegOpenKeyEx
Definition: winreg.h:520
BOOL g_ClickLockEnabled
Definition: mouse.c:52
#define TEXT(s)
Definition: k32.h:26
BOOL WINAPI DrawIcon(_In_ HDC, _In_ int, _In_ int, _In_ HICON)
Definition: cursoricon.c:1987
struct _CURSOR_DATA * PCURSOR_DATA
_In_ BOOL bEnable
Definition: winddi.h:3426
#define IDD_PAGE_POINTER
Definition: resource.h:24
#define PSCB_INITIALIZED
Definition: prsht.h:75
static BOOL ApplyCursorScheme(HWND hwndDlg)
Definition: mouse.c:1127
static const struct @211 PropPages[]
#define IDS_HAND
Definition: resource.h:52
#define WHEEL_PAGESCROLL
Definition: zmouse.h:26
LPSTR lpstrFile
Definition: commdlg.h:336
HICON hIcon
Definition: msconfig.c:44
#define PSN_RESET
Definition: prsht.h:118
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDI_FOLDER_OPEN
Definition: resource.h:8
#define DEFAULT_WHEEL_SCROLL_LINES
Definition: mouse.c:44
#define IDS_HELP
Definition: resource.h:3
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IDD_CURSOR_SCHEME_SAVEAS
Definition: resource.h:30
LPCSTR lpstrFilter
Definition: commdlg.h:332
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define LB_GETCURSEL
Definition: winuser.h:2021
unsigned int UINT
Definition: ndis.h:50
#define WM_HSCROLL
Definition: winuser.h:1725
static VOID ReloadCurrentCursorScheme(VOID)
Definition: mouse.c:921
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define MB_OK
Definition: winuser.h:784
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
Definition: shellord.c:1724
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define STM_SETIMAGE
Definition: winuser.h:2075
#define IDC_IMAGE_CURRENT_CURSOR
Definition: resource.h:96
static INT_PTR CALLBACK SaveSchemeProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: mouse.c:660
#define BST_CHECKED
Definition: winuser.h:197
BOOL bMouseSonar
Definition: mouse.c:98
#define WM_DRAWITEM
Definition: winuser.h:1627
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
#define IDC_CHECK_CURSOR_SHADOW
Definition: resource.h:81
#define SM_SWAPBUTTON
Definition: winuser.h:974
LPCSTR lpstrTitle
Definition: commdlg.h:341
UINT WINAPI GetDoubleClickTime(void)
Definition: ntwrapper.h:314
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3232
#define ODS_SELECTED
Definition: winuser.h:2520
#define SendMessage
Definition: winuser.h:5744
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
#define PropertySheet
Definition: prsht.h:382
#define IDC_CPLICON_1
Definition: resource.h:4
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
TCHAR szCursorName[MAX_PATH]
Definition: mouse.c:115
#define HIWORD(l)
Definition: typedefs.h:246
BOOL bMouseVanish
Definition: mouse.c:95
unsigned int ULONG
Definition: retypes.h:1
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define GetEnvironmentVariable
Definition: winbase.h:3638
#define IDD_CLICK_LOCK
Definition: resource.h:31
#define IDC_EDIT_WHEEL_SCROLL_LINES
Definition: resource.h:68
#define LoadImage
Definition: winuser.h:5716
#define CB_GETCOUNT
Definition: winuser.h:1924
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDNO
Definition: winuser.h:830
#define GetWindowLongPtr
Definition: treelist.c:73
DWORD nFilterIndex
Definition: commdlg.h:335
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
Definition: shellord.c:1607
#define IDC_SLIDER_POINTER_TRAIL
Definition: resource.h:77
#define CB_DELETESTRING
Definition: winuser.h:1919
#define IDCANCEL
Definition: winuser.h:825
INT nThreshold1
Definition: mouse.c:76
LONG_PTR LRESULT
Definition: windef.h:209
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
ULONG g_OrigDoubleClickSpeed
Definition: mouse.c:51
#define memset(x, y, z)
Definition: compat.h:39
#define REG_DWORD
Definition: sdbapi.c:596
#define IDS_BROWSE_TITLE
Definition: resource.h:56
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
Definition: dsound.c:943
int _tcsncmp(const _TCHAR *s1, const _TCHAR *s2, size_t n)
Definition: tcsncmp.h:9
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RegEnumValue
Definition: winreg.h:511
#define IDC_TEXT_TRAIL_SHORT
Definition: resource.h:104
#define RegSetValueEx
Definition: winreg.h:533
#define LoadString
Definition: winuser.h:5720
ULONG g_DoubleClickSpeed
Definition: mouse.c:50
HCURSOR hCursor
Definition: mouse.c:114
#define WM_NOTIFY
Definition: richedit.h:61
#define APIENTRY
Definition: api.h:79
#define IDS_CROSSHAIR
Definition: resource.h:42
MOUSE_ACCEL MouseAccel
Definition: mouse.c:86
#define ICON_BIG
Definition: tnclass.cpp:51
#define IDC_RADIO_WHEEL_SCROLL_PAGE
Definition: resource.h:70
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
ULONG ulMouseSpeed
Definition: mouse.c:83
DWORD Flags
Definition: commdlg.h:342
#define REG_SZ
Definition: layer.c:22
#define EN_CHANGE
Definition: winuser.h:2004
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922