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.

124 lines
3.6 KiB

  1. //===========================================================================
  2. // DICPUTIL.H
  3. //===========================================================================
  4. //===========================================================================
  5. // (C) Copyright 1997 Microsoft Corp. All rights reserved.
  6. //
  7. // You have a royalty-free right to use, modify, reproduce and
  8. // distribute the Sample Files (and/or any modified version) in
  9. // any way you find useful, provided that you agree that
  10. // Microsoft has no warranty obligations or liability for any
  11. // Sample Application Files which are modified.
  12. //===========================================================================
  13. #ifndef _DICPUTIL_H
  14. #define _DICPUTIL_H
  15. // Max supported defines!
  16. #define MAX_BUTTONS 32
  17. #define MAX_AXIS 8
  18. #define MAX_POVS 4
  19. // State flag defines!!!
  20. // State flags for axis
  21. #define HAS_X 0x0001
  22. #define HAS_Y 0x0002
  23. #define HAS_Z 0x0004
  24. #define HAS_RX 0x0008
  25. #define HAS_RY 0x0010
  26. #define HAS_RZ 0x0020
  27. #define HAS_SLIDER0 0x0040
  28. #define HAS_SLIDER1 0x0080
  29. // State flags for buttons
  30. #define HAS_BUTTON1 0x00000001
  31. #define HAS_BUTTON2 0x00000002
  32. #define HAS_BUTTON3 0x00000004
  33. #define HAS_BUTTON4 0x00000008
  34. #define HAS_BUTTON5 0x00000010
  35. #define HAS_BUTTON6 0x00000020
  36. #define HAS_BUTTON7 0x00000040
  37. #define HAS_BUTTON8 0x00000080
  38. #define HAS_BUTTON9 0x00000100
  39. #define HAS_BUTTON10 0x00000200
  40. #define HAS_BUTTON11 0x00000400
  41. #define HAS_BUTTON12 0x00000800
  42. #define HAS_BUTTON13 0x00001000
  43. #define HAS_BUTTON14 0x00002000
  44. #define HAS_BUTTON15 0x00004000
  45. #define HAS_BUTTON16 0x00008000
  46. #define HAS_BUTTON17 0x00010000
  47. #define HAS_BUTTON18 0x00020000
  48. #define HAS_BUTTON19 0x00040000
  49. #define HAS_BUTTON20 0x00080000
  50. #define HAS_BUTTON21 0x00100000
  51. #define HAS_BUTTON22 0x00200000
  52. #define HAS_BUTTON23 0x00400000
  53. #define HAS_BUTTON24 0x00800000
  54. #define HAS_BUTTON25 0x01000000
  55. #define HAS_BUTTON26 0x02000000
  56. #define HAS_BUTTON27 0x04000000
  57. #define HAS_BUTTON28 0x08000000
  58. #define HAS_BUTTON29 0x10000000
  59. #define HAS_BUTTON30 0x20000000
  60. #define HAS_BUTTON31 0x40000000
  61. #define HAS_BUTTON32 0x80000000
  62. // State flags for POVs
  63. #define HAS_POV1 0x0001
  64. #define HAS_POV2 0x0002
  65. #define HAS_POV3 0x0004
  66. #define HAS_POV4 0x0008
  67. //---------------------------------------------------------------------------
  68. // prototypes
  69. HRESULT DIUtilPollJoystick(LPDIRECTINPUTDEVICE2 pdiDevice2, LPDIJOYSTATE pdijs);
  70. // helper functions
  71. void GetMyRanges(LPDIRECTINPUTDEVICE2 lpdiDevice2, LPMYJOYRANGE lpMyRanges, BYTE nAxis);
  72. void SetMyRanges(LPDIRECTINPUTDEVICE2 lpdiDevice2, LPMYJOYRANGE lpMyRanges, BYTE nAxis);
  73. void SetMyPOVRanges(LPDIRECTINPUTDEVICE2 pdiDevice2);
  74. //BOOL GetDeviceRanges( LPMYJOYRANGE lpMyRanges, LPDIRECTINPUTDEVICE2 pdiDevice2, BYTE nAxis);
  75. void OnHelp(LPARAM lParam);
  76. void OnContextMenu(WPARAM wParam);
  77. BOOL GetHelpFileName(LPTSTR lpszHelpFileName, short* nSize);
  78. //BOOL CALLBACK DIEnumDeviceObjectsProc( LPCDIDEVICEOBJECTINSTANCE_DX3 lpddoi, LPVOID pvStateFlags );
  79. HRESULT InitDInput(HWND hWnd, CDIGameCntrlPropSheet_X *pdiCpl);
  80. void EnumDeviceObjects(LPDIRECTINPUTDEVICE2 lpdiDevice2, STATEFLAGS *pStateFlags);
  81. void SetTitle( HWND hDlg );
  82. BOOL Error(HWND hWnd, short nTitleID, short nMsgID);
  83. void CenterDialog(HWND hWnd);
  84. void PostDlgItemEnableWindow(HWND hDlg, USHORT nItem, BOOL bEnabled);
  85. void PostEnableWindow(HWND hCtrl, BOOL bEnabled);
  86. void CopyRange( LPJOYRANGE lpjr, LPMYJOYRANGE lpmyjr );
  87. //---------------------------------------------------------------------------
  88. #endif _DICPUTIL_H