Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.4 KiB

  1. // **************************************************************************
  2. // StickyKeys
  3. // Process the StickyKeys dialog
  4. // **************************************************************************
  5. #include "Access.h"
  6. INT_PTR WINAPI StickyKeyDlg (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
  7. BOOL fProcessed = TRUE;
  8. switch (uMsg) {
  9. case WM_INITDIALOG:
  10. CheckDlgButton(hwnd, IDC_STK_HOTKEY,
  11. (g_sk.dwFlags & SKF_HOTKEYACTIVE) ? TRUE : FALSE);
  12. CheckDlgButton(hwnd, IDC_STK_LOCK,
  13. (g_sk.dwFlags & SKF_TRISTATE) ? TRUE : FALSE);
  14. CheckDlgButton(hwnd, IDC_STK_2KEYS,
  15. (g_sk.dwFlags & SKF_TWOKEYSOFF) ? TRUE : FALSE);
  16. CheckDlgButton(hwnd, IDC_STK_SOUNDMOD,
  17. (g_sk.dwFlags & SKF_AUDIBLEFEEDBACK) ? TRUE : FALSE);
  18. CheckDlgButton(hwnd, IDC_STK_STATUS,
  19. (g_sk.dwFlags & SKF_INDICATOR) ? TRUE : FALSE);
  20. break;
  21. case WM_HELP: // F1
  22. WinHelp(((LPHELPINFO) lParam)->hItemHandle, __TEXT("access.hlp"), HELP_WM_HELP, (DWORD_PTR) (LPSTR) g_aIds);
  23. break;
  24. case WM_CONTEXTMENU:
  25. WinHelp((HWND) wParam, __TEXT("access.hlp"), HELP_CONTEXTMENU, (DWORD_PTR) (LPSTR) g_aIds);
  26. break;
  27. case WM_COMMAND:
  28. switch (GET_WM_COMMAND_ID(wParam, lParam)) {
  29. case IDC_STK_HOTKEY:
  30. g_sk.dwFlags ^= SKF_HOTKEYACTIVE;
  31. SendMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM) hwnd, 0);
  32. break;
  33. case IDC_STK_LOCK:
  34. g_sk.dwFlags ^= SKF_TRISTATE;
  35. SendMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM) hwnd, 0);
  36. break;
  37. case IDC_STK_2KEYS:
  38. g_sk.dwFlags ^= SKF_TWOKEYSOFF;
  39. SendMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM) hwnd, 0);
  40. break;
  41. case IDC_STK_SOUNDMOD:
  42. g_sk.dwFlags ^= SKF_AUDIBLEFEEDBACK;
  43. SendMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM) hwnd, 0);
  44. break;
  45. case IDC_STK_STATUS:
  46. g_sk.dwFlags ^= SKF_INDICATOR;
  47. SendMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM) hwnd, 0);
  48. break;
  49. case IDOK:
  50. case IDCANCEL:
  51. EndDialog(hwnd, GET_WM_COMMAND_ID(wParam, lParam)); break;
  52. }
  53. break;
  54. default: fProcessed = FALSE; break;
  55. }
  56. return(fProcessed);
  57. }
  58. ///////////////////////////////// End of File /////////////////////////////////