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.

133 lines
4.8 KiB

  1. //////////////////////////////////////////////////////////////////
  2. // File : exbtn.h ( Extended Button)
  3. // Purpose : new control for button
  4. //
  5. //
  6. // Copyright(c) 1991-1997, Microsoft Corp. All rights reserved
  7. //
  8. // History :970905 Started
  9. //////////////////////////////////////////////////////////////////
  10. #ifndef _EXTENDED_BUTTON_
  11. #define _EXTENDED_BUTTON_
  12. //----------------------------------------------------------------
  13. //Extended Button Style
  14. //----------------------------------------------------------------
  15. #define EXBS_TEXT 0x0000 // Show Text as Button Face.(Default value)
  16. #define EXBS_ICON 0x0001 // Show Icon as Button Face.
  17. #define EXBS_THINEDGE 0x0002 // Draw Thin Edge.
  18. #define EXBS_FLAT 0x0004 // Flat style drop down button.
  19. #define EXBS_TOGGLE 0x0010 // Keep push state.
  20. #define EXBS_DBLCLKS 0x0020 // Send double clicks. kwada 980402
  21. #define EXBM_GETCHECK (WM_USER + 100)
  22. #define EXBM_SETCHECK (WM_USER + 101)
  23. #define EXBM_SETICON (WM_USER + 102)
  24. #define EXBM_SETTEXT (WM_USER + 103)
  25. #define EXBM_SETSTYLE (WM_USER + 104)
  26. //----------------------------------------------------------------
  27. //Drop Down Button Notify code.
  28. //It is set to Parent window of Drop Down button as
  29. //WM_COMMAND.
  30. //----------------------------------------------------------------
  31. #define EXBN_CLICKED 0
  32. #define EXBN_ARMED 1 //Button
  33. #define EXBN_DISARMED 2
  34. #define EXBN_DOUBLECLICKED 3
  35. //////////////////////////////////////////////////////////////////
  36. // Function : EXButton_GetCheck
  37. // Type : INT
  38. // Purpose : Set button image as icon.
  39. // Args : HWND hwndCtrl: EXButton window handle.
  40. // Remarks : EXBS_ICON style must be set.
  41. // Return :
  42. //////////////////////////////////////////////////////////////////
  43. #define EXButton_GetCheck(hwndCtrl) \
  44. ((int)(DWORD)SendMessage((hwndCtrl), EXBM_GETCHECK, (WPARAM)0, (LPARAM)0))
  45. //////////////////////////////////////////////////////////////////
  46. // Function : EXButton_SetCheck
  47. // Type : INT
  48. // Purpose : Set button image as icon.
  49. // Args : HWND hwndCtrl: EXButton window handle.
  50. // : BOOL fCheck: Check state or Uncheck state.
  51. // Remarks : EXBS_TOGGLE style must be set.
  52. // Return :
  53. //////////////////////////////////////////////////////////////////
  54. #define EXButton_SetCheck(hwndCtrl, fCheck) \
  55. ((int)(DWORD)SendMessage((hwndCtrl), EXBM_SETCHECK, (WPARAM)(BOOL)fCheck, (LPARAM)0))
  56. //////////////////////////////////////////////////////////////////
  57. // Function : EXButton_SetIcon
  58. // Type : INT
  59. // Purpose : Set button image as icon.
  60. // Args : HWND hwndCtrl: EXButton window handle.
  61. // : HICON hIcon: Icon handle.
  62. // Remarks : EXBS_ICON style must be set.
  63. // Return :
  64. //////////////////////////////////////////////////////////////////
  65. #define EXButton_SetIcon(hwndCtrl, hIcon) \
  66. ((int)(DWORD)SendMessage((hwndCtrl), EXBM_SETICON, (WPARAM)hIcon, (LPARAM)0))
  67. //////////////////////////////////////////////////////////////////
  68. // Function : EXButton_SetText
  69. // Type : INT
  70. // Purpose : Set button image as icon.
  71. // Args : HWND hwndCtrl: EXButton window handle.
  72. // : LPWSTR lpsz: Unicode String pointer.
  73. // Remarks :
  74. // Return :
  75. //////////////////////////////////////////////////////////////////
  76. #define EXButton_SetText(hwndCtrl, lpsz) \
  77. ((int)(DWORD)SendMessage((hwndCtrl), EXBM_SETTEXT, (WPARAM)lpsz, (LPARAM)0))
  78. //////////////////////////////////////////////////////////////////
  79. // Function : EXButton_SetStyle
  80. // Type : INT
  81. // Purpose : Set Drop down button's style.
  82. // Args : HWND hwndCtrl: EXButton window handle.
  83. // : DWORD dwStyle: EXBS_XXXXX combination.
  84. // Remarks :
  85. // Return :
  86. //////////////////////////////////////////////////////////////////
  87. #define EXButton_SetStyle(hwndCtrl, dwStyle) \
  88. ((int)(DWORD)SendMessage((hwndCtrl), EXBM_SETSTYLE, (WPARAM)dwStyle, (LPARAM)0))
  89. //////////////////////////////////////////////////////////////////
  90. // Function : EXButton_CreateWindow
  91. // Type : HWND
  92. // Purpose : Opened API.
  93. // : Create Drop Down Button.
  94. // Args :
  95. // : HINSTANCE hInst
  96. // : HWND hwndParent
  97. // : DWORD dwStyle EXBS_XXXXX combination.
  98. // : INT wID Window ID
  99. // : INT xPos
  100. // : INT yPos
  101. // : INT width
  102. // : INT height
  103. // Return :
  104. // DATE : 970905
  105. //////////////////////////////////////////////////////////////////
  106. extern HWND EXButton_CreateWindow(HINSTANCE hInst,
  107. HWND hwndParent,
  108. DWORD dwStyle,
  109. INT wID,
  110. INT xPos,
  111. INT yPos,
  112. INT width,
  113. INT height);
  114. #ifdef UNDER_CE // In Windows CE, all window classes are process global.
  115. extern BOOL EXButton_UnregisterClass(HINSTANCE hInst);
  116. #endif // UNDER_CE
  117. #endif //_EXTENED_BUTTON_