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.

85 lines
1.8 KiB

  1. #if !defined(__Button_h__INCLUDED)
  2. #define __Button_h__INCLUDED
  3. /////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Button Control
  6. //
  7. /////////////////////////////////////////////////////////////////////////////
  8. //
  9. // Button states
  10. //
  11. #define BST_CHECKMASK 0x0003
  12. #define BST_INCLICK 0x0010
  13. #define BST_CAPTURED 0x0020
  14. #define BST_MOUSE 0x0040
  15. #define BST_DONTCLICK 0x0080
  16. #define BST_INBMCLICK 0x0100
  17. #define PBF_PUSHABLE 0x0001
  18. #define PBF_DEFAULT 0x0002
  19. //
  20. // BNDrawText codes
  21. //
  22. #define DBT_TEXT 0x0001
  23. #define DBT_FOCUS 0x0002
  24. #define BS_PUSHBOX 0x0000000AL
  25. #define BS_TYPEMASK 0x0000000FL
  26. #define BS_IMAGEMASK 0x000000C0L
  27. #define BS_HORZMASK 0x00000300L
  28. #define BS_VERTMASK 0x00000C00L
  29. #define BS_ALIGNMASK 0x00000F00L
  30. //
  31. // Button macros
  32. //
  33. #define ISBSTEXTOROD(ulStyle) \
  34. (((ulStyle & BS_BITMAP) == 0) && ((ulStyle & BS_ICON) == 0))
  35. #define BUTTONSTATE(pbutn) \
  36. (pbutn->buttonState)
  37. //
  38. // Instance data pointer access functions
  39. //
  40. #define Button_GetPtr(hwnd) \
  41. (PBUTN)GetWindowPtr(hwnd, 0)
  42. #define Button_SetPtr(hwnd, p) \
  43. (PBUTN)SetWindowPtr(hwnd, 0, p)
  44. //
  45. // Button data structure
  46. //
  47. typedef struct tagBUTN
  48. {
  49. CCONTROLINFO ci;
  50. UINT buttonState; // Leave this a word for compatibility with SetWindowWord( 0L )
  51. HANDLE hFont;
  52. HANDLE hImage;
  53. UINT fPaintKbdCuesOnly : 1;
  54. RECT rcText;
  55. RECT rcIcon;
  56. HIMAGELIST himl;
  57. UINT uAlign;
  58. HTHEME hTheme; // Handle to the theme manager
  59. PWW pww; // RO pointer into the pwnd to ExStyle, Style, State, State2
  60. } BUTN, *PBUTN;
  61. //
  62. // Button WndProc Prototype
  63. //
  64. extern LRESULT Button_WndProc(
  65. HWND hwnd,
  66. UINT uMsg,
  67. WPARAM wParam,
  68. LPARAM lParam);
  69. #endif // __Button_h__INCLUDED