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.

192 lines
5.9 KiB

  1. /******************************************************************************
  2. Module name: Access.h
  3. Purpose: defines for all accstat
  4. ******************************************************************************/
  5. #include <windows.h>
  6. #include <windowsx.h>
  7. #include <cpl.h>
  8. //#include <shellapi.h>
  9. #include <commctrl.h>
  10. #include "acchelp.h"
  11. #include "resource.h"
  12. //////////////////////////////////////////////////////////////////////////////
  13. #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
  14. #define MEMBER_SIZE(s,m) sizeof(((s *)0)->m)
  15. // Debugging defs
  16. #if defined(DEBUG) || defined(MEMCHECK) || defined(_DEBUG)
  17. //Assert based on boolean f.
  18. #define Assert(f) assert(f)
  19. #else
  20. #define Assert(f) ((void)0)
  21. #endif
  22. //////////////////////////////////////////////////////////////////////////////
  23. extern BOOL g_SPISetValue;
  24. extern HINSTANCE g_hinst;
  25. extern BOOL g_fWinNT; // TRUE if we're running on NT and must disable
  26. // some features.
  27. extern const DWORD g_aIds[]; // array mapping control id's to help id's
  28. // This functions makes it easy to access the registry.
  29. int WINAPI RegQueryInt(int nDefault, HKEY hkey, LPTSTR lpSubKey, LPTSTR lpValueName);
  30. BOOL WINAPI RegSetInt(HKEY hkey, LPTSTR lpSubKey, LPTSTR lpValueName, int nVal);
  31. void WINAPI RegQueryStr(
  32. LPTSTR lpDefault,
  33. HKEY hkey,
  34. LPTSTR lpSubKey,
  35. LPTSTR lpValueName,
  36. LPTSTR lpszValue,
  37. DWORD cbData);
  38. BOOL RegSetStr(HKEY hkey, LPCTSTR lpSection, LPCTSTR lpKeyName, LPCTSTR lpString);
  39. DWORD WINAPI RegQueryStrDW(
  40. DWORD dwDefault,
  41. HKEY hkey,
  42. LPTSTR lpSubKey,
  43. LPTSTR lpValueName);
  44. BOOL RegSetStrDW(HKEY hkey, LPTSTR lpSection, LPCTSTR lpKeyName, DWORD dwValue);
  45. // This function takes the current state of the variables below
  46. // and updates the system settings.
  47. void WINAPI SetAccessibilitySettings (void);
  48. // These values are declared in General.c
  49. extern BOOL g_fSaveSettings;
  50. extern BOOL g_fShowWarnMsgOnFeatureActivate;
  51. extern BOOL g_fPlaySndOnFeatureActivate;
  52. // Admin options in general
  53. extern BOOL g_fCopyToLogon;
  54. extern BOOL g_fCopyToDefault;
  55. // Keyboard property page
  56. extern STICKYKEYS g_sk;
  57. extern FILTERKEYS g_fk;
  58. // g_dwLastBounceKeySetting is part of FilterKeys
  59. extern DWORD g_dwLastBounceKeySetting;
  60. extern DWORD g_nLastRepeatDelay;
  61. extern DWORD g_nLastRepeatRate;
  62. extern DWORD g_nLastWait;
  63. extern TOGGLEKEYS g_tk;
  64. extern BOOL g_fExtraKeyboardHelp;
  65. // Sound Property page
  66. extern SOUNDSENTRY g_ss;
  67. extern BOOL g_fShowSounds;
  68. // Display Property page
  69. #define BLINK 1000
  70. #define BLINK_OFF -1
  71. #define CURSORMIN 200
  72. #define CURSORMAX 1300
  73. #define CURSORSUM (CURSORMIN + CURSORMAX)
  74. #define CURSORRANGE (CURSORMAX - CURSORMIN)
  75. typedef struct CARET_SETTINGS {
  76. DWORD dwCaretBlinkRate;
  77. DWORD dwCaretWidth;
  78. DWORD dwNewCaretBlinkRate;
  79. DWORD dwNewCaretWidth;
  80. } CARET_SETTINGS;
  81. extern HIGHCONTRAST g_hc;
  82. extern CARET_SETTINGS g_cs;
  83. extern TCHAR g_szScheme[256];
  84. // Mouse Property page
  85. extern MOUSEKEYS g_mk;
  86. // General Property page
  87. extern ACCESSTIMEOUT g_ato;
  88. extern SERIALKEYS g_serk;
  89. extern TCHAR g_szActivePort[MAX_PATH];
  90. //extern TCHAR g_szPort[MAX_PATH]; // Currently reserved, should be NULL.
  91. //////////////////////////////////////////////////////////////////////////////
  92. // AccessSystemParametersInfo is actually defined in AccRare.c and is
  93. // a replacement for SysParamInfoBugFix
  94. BOOL AccessSystemParametersInfo(
  95. UINT wFlag,
  96. DWORD wParam,
  97. PVOID lParam,
  98. UINT flags);
  99. //////////////////////////////////////////////////////////////////////////////
  100. // Define strings for registry.
  101. #define GENERAL_KEY __TEXT("Control Panel\\Accessibility")
  102. #define FILTER_KEY __TEXT("Control Panel\\Accessibility\\Keyboard Response")
  103. #define HC_KEY __TEXT("Control Panel\\Accessibility\\HighContrast")
  104. #define CONTROL_KEY __TEXT("Control Panel\\Appearance\\Schemes")
  105. #define WARNING_SOUNDS __TEXT("Warning Sounds")
  106. #define SOUND_ON_ACTIVATION __TEXT("Sound on Activation")
  107. #define APPLY_GLOBALLY __TEXT("Restore Settings")
  108. #define NORMALSCHEME __TEXT("Current Normal Scheme")
  109. #define HIGHCONTRAST_SCHEME __TEXT("High Contrast Scheme")
  110. #define VOLATILE_SCHEME __TEXT("Volital HC Scheme")
  111. #define WHITEBLACK_HC __TEXT("High Contrast Black (large)")
  112. #define LAST_BOUNCE_SETTING __TEXT("Last BounceKey Setting")
  113. #define LAST_REPEAT_RATE __TEXT("Last Valid Repeat")
  114. #define LAST_REPEAT_DELAY __TEXT("Last Valid Delay")
  115. #define LAST_WAIT __TEXT("Last Valid Wait")
  116. #define CURR_HC_SCHEME __TEXT("High Contrast Scheme")
  117. #define APPEARANCE_KEY __TEXT("Control Panel\\Appearance")
  118. #define CURR_NONHC_SCHEME __TEXT("Current")
  119. #define IDSENG_BLACKWHITE_SCHEME __TEXT("High Contrast White (large)")
  120. #define IDSENG_WHITEBLACK_SCHEME __TEXT("High Contrast Black (large)")
  121. //////////////////////////////////////////////////////////////////////////////
  122. // Define prototypes
  123. INT_PTR WINAPI HighContrastDlg (HWND, UINT , WPARAM , LPARAM);
  124. INT_PTR WINAPI ToggleKeySettingsDlg (HWND, UINT, WPARAM, LPARAM);
  125. INT_PTR WINAPI StickyKeyDlg (HWND, UINT , WPARAM, LPARAM);
  126. INT_PTR WINAPI FilterKeyDlg (HWND, UINT , WPARAM, LPARAM);
  127. INT_PTR WINAPI MouseKeyDlg (HWND, UINT, WPARAM, LPARAM);
  128. INT_PTR WINAPI SerialKeyDlg (HWND, UINT, WPARAM, LPARAM);
  129. int HandleScroll (HWND hwnd, WPARAM wParam, HWND hwndScroll);
  130. DWORD SaveDefaultSettings(BOOL saveL, BOOL saveU);
  131. BOOL IsDefaultWritable(void);
  132. typedef
  133. LANGID (WINAPI *pfnGetUserDefaultUILanguage)(void);
  134. typedef
  135. LANGID (WINAPI *pfnGetSystemDefaultUILanguage)(void);
  136. BOOL IsMUI_Enabled();
  137. ///////////////////////////////// End of File /////////////////////////////////