Leaked source code of windows server 2003
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.

77 lines
2.5 KiB

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