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.

129 lines
5.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: tb.h
  7. //
  8. // Contents: Message APIs for the toolbar control
  9. //
  10. // History: 16-Aug-93 BruceFo Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #ifndef __TB_H__
  14. #define __TB_H__
  15. // void Toolbar_AddBitmap(HWND hwnd, int nButtons, HINSTANCE hBMInst, UINT nBMID);
  16. #define Toolbar_AddBitmap(hwnd, nButtons, hBMInst, nBMID) \
  17. { TBADDBITMAP _tbBM; \
  18. _tbBM.hInst = hBMInst; \
  19. _tbBM.nID = nBMID; \
  20. (int)SendMessage((hwnd),TB_ADDBITMAP,(WPARAM)(nButtons),(LPARAM)&_tbBM); \
  21. }
  22. // BOOL Toolbar_AddButtons(HWND hwnd, int nButtons, LPTBBUTTON lpButtons);
  23. #define Toolbar_AddButtons(hwnd, nButtons, lpButtons) \
  24. (BOOL)SendMessage((hwnd),TB_ADDBUTTONS,(WPARAM)(nButtons),(LPARAM)(LPTBBUTTON)(lpButtons))
  25. // int Toolbar_AddString(HWND hwnd, HINSTANCE hInst, UINT idString);
  26. #define Toolbar_AddString(hwnd, hInst, idString) \
  27. (int)SendMessage((hwnd),TB_ADDSTRING,(WPARAM)(HINSTANCE)(hInst),(LPARAM)(MAKELPARAM((idString),0)))
  28. // void Toolbar_AutoSize(HWND hwnd);
  29. #define Toolbar_AutoSize(hwnd) \
  30. (void)SendMessage((hwnd),TB_AUTOSIZE,(WPARAM)0,(LPARAM)0)
  31. // int Toolbar_ButtonCount(HWND hwnd);
  32. #define Toolbar_ButtonCount(hwnd) \
  33. (int)SendMessage((hwnd),TB_BUTTONCOUNT,(WPARAM)0,(LPARAM)0)
  34. // int Toolbar_ButtonStructSize(HWND hwnd, int cb);
  35. #define Toolbar_ButtonStructSize(hwnd, cb) \
  36. (int)SendMessage((hwnd),TB_BUTTONSTRUCTSIZE,(WPARAM)(cb),(LPARAM)0)
  37. // BOOL Toolbar_CheckButton(HWND hwnd, UINT idButton, BOOL fCheck);
  38. #define Toolbar_CheckButton(hwnd, idButton, fCheck) \
  39. (BOOL)SendMessage((hwnd),TB_CHECKBUTTON,(WPARAM)(idButton),(LPARAM)MAKELPARAM((fCheck),0))
  40. // int Toolbar_CommandToIndex(HWND hwnd, UINT idButton);
  41. #define Toolbar_CommandToIndex(hwnd, idButton) \
  42. (int)SendMessage((hwnd),TB_COMMANDTOINDEX,(WPARAM)(idButton),(LPARAM)0)
  43. // void Toolbar_Customize(HWND hwnd);
  44. #define Toolbar_Customize(hwnd) \
  45. (void)SendMessage((hwnd),TB_CUSTOMIZE,(WPARAM)0,(LPARAM)0)
  46. // BOOL Toolbar_DeleteButton(HWND hwnd, UINT idButton);
  47. #define Toolbar_DeleteButton(hwnd, idButton) \
  48. (BOOL)SendMessage((hwnd),TB_DELETEBUTTON,(WPARAM)(idButton),(LPARAM)0)
  49. // BOOL Toolbar_EnableButton(HWND hwnd, UINT idButton, BOOL fEnable);
  50. #define Toolbar_EnableButton(hwnd, idButton, fEnable) \
  51. (BOOL)SendMessage((hwnd),TB_ENABLEBUTTON,(WPARAM)(idButton),(LPARAM)MAKELPARAM((fEnable),0))
  52. // BOOL Toolbar_GetButton(HWND hwnd, UINT iButton, LPTBBUTTON lpButton);
  53. #define Toolbar_GetButton(hwnd, iButton, lpButton) \
  54. (BOOL)SendMessage((hwnd),TB_GETBUTTON,(WPARAM)(iButton),(LPARAM)(LPTBBUTTON)(lpButton))
  55. // BOOL Toolbar_GetItemRect(HWND hwnd, UINT iButton, LPRECT lpRect);
  56. #define Toolbar_GetItemRect(hwnd, iButton, lpRect) \
  57. (BOOL)SendMessage((hwnd),TB_GETITEMRECT,(WPARAM)(iButton),(LPARAM)(LPRECT)(lpRect))
  58. // int Toolbar_GetState(HWND hwnd, UINT iButton);
  59. #define Toolbar_GetState(hwnd, iButton, lpRect) \
  60. (int)SendMessage((hwnd),TB_GETSTATE,(WPARAM)(iButton),(LPARAM)0)
  61. // BOOL Toolbar_HideButton(HWND hwnd, UINT idButton, BOOL fShow);
  62. #define Toolbar_HideButton(hwnd, idButton, fShow) \
  63. (BOOL)SendMessage((hwnd),TB_HIDEBUTTON,(WPARAM)(idButton),(LPARAM)MAKELPARAM((fShow),0))
  64. // BOOL Toolbar_Indeterminate(HWND hwnd, UINT iButton, BOOL fIndeterminate);
  65. #define Toolbar_Indeterminate(hwnd, iButton, fIndeterminate) \
  66. (BOOL)SendMessage((hwnd),TB_INDETERMINATE,(WPARAM)(iButton),(LPARAM)MAKELPARAM((fIndeterminate),0))
  67. // BOOL Toolbar_InsertButton(HWND hwnd, UINT iButton, LPTBBUTTON lpButton);
  68. #define Toolbar_InsertButton(hwnd, iButton, lpButton) \
  69. (BOOL)SendMessage((hwnd),TB_INSERTBUTTON,(WPARAM)(iButton),(LPARAM)(LPTBBUTTON)(lpButton))
  70. // int Toolbar_IsButtonChecked(HWND hwnd, UINT idButton);
  71. #define Toolbar_IsButtonChecked(hwnd, idButton) \
  72. (int)SendMessage((hwnd),TB_ISBUTTONCHECKED,(WPARAM)(idButton),(LPARAM)0)
  73. // int Toolbar_IsButtonEnabled(HWND hwnd, UINT idButton);
  74. #define Toolbar_IsButtonEnabled(hwnd, idButton) \
  75. (int)SendMessage((hwnd),TB_ISBUTTONENABLED,(WPARAM)(idButton),(LPARAM)0)
  76. // int Toolbar_IsButtonHidden(HWND hwnd, UINT idButton);
  77. #define Toolbar_IsButtonHidden(hwnd, idButton) \
  78. (int)SendMessage((hwnd),TB_ISBUTTONHIDDEN,(WPARAM)(idButton),(LPARAM)0)
  79. // int Toolbar_IsButtonIndeterminate(HWND hwnd, UINT idButton);
  80. #define Toolbar_IsButtonIndeterminate(hwnd, idButton) \
  81. (int)SendMessage((hwnd),TB_ISBUTTONINDETERMINATE,(WPARAM)(idButton),(LPARAM)0)
  82. // int Toolbar_IsButtonPressed(HWND hwnd, UINT idButton);
  83. #define Toolbar_IsButtonPressed(hwnd, idButton) \
  84. (int)SendMessage((hwnd),TB_ISBUTTONPRESSED,(WPARAM)(idButton),(LPARAM)0)
  85. // BOOL Toolbar_PressButton(HWND hwnd, UINT idButton, BOOL fPress);
  86. #define Toolbar_PressButton(hwnd, idButton, fPress) \
  87. (BOOL)SendMessage((hwnd),TB_PRESSBUTTON,(WPARAM)(idButton),(LPARAM)MAKELPARAM((fPress),0))
  88. // BOOL Toolbar_SaveRestore(HWND hwnd, BOOL fSave, TBSAVEPARAMS* lpSaveRestore);
  89. #define Toolbar_SaveRestore(hwnd, fSave, lpSaveRestore) \
  90. (BOOL)SendMessage((hwnd),TB_SAVERESTORE,(WPARAM)(fSave),(LPARAM)(TBSAVEPARAMS*)(lpSaveRestore))
  91. // BOOL Toolbar_SetBitmapSize(HWND hwnd, WORD dxBitmap, WORD dyBitmap);
  92. #define Toolbar_SetBitmapSize(hwnd, dxBitmap, dyBitmap) \
  93. (BOOL)SendMessage((hwnd),TB_SETBITMAPSIZE,(WPARAM)0,(LPARAM)MAKELPARAM((dxBitmap),(dyBitmap)))
  94. // BOOL Toolbar_SetButtonSize(HWND hwnd, WORD dxButton, WORD dyButton);
  95. #define Toolbar_SetButtonSize(hwnd, dxButton, dyButton) \
  96. (BOOL)SendMessage((hwnd),TB_SETBUTTONSIZE,(WPARAM)0,(LPARAM)MAKELPARAM((dxButton),(dyButton)))
  97. // BOOL Toolbar_SetState(HWND hwnd, UINT idButton, BOOL fState);
  98. #define Toolbar_SetState(hwnd, idButton, fState) \
  99. (BOOL)SendMessage((hwnd),TB_SETSTATE,(WPARAM)(idButton),(LPARAM)MAKELPARAM((fState),0))
  100. #endif // __TB_H__