📄 comcthlp.h
字号:
(void)SendMessage((hwnd), TB_AUTOSIZE, 0, 0L)
#define ToolBar_ButtonCount(hwnd) \
(int)SendMessage((hwnd), TB_BUTTONCOUNT, 0, 0L)
#define ToolBar_ButtonStructSize(hwnd) \
(void)SendMessage((hwnd), TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0L)
#define ToolBar_ChangeBitmap(hwnd, idButton, iBitmap) \
(BOOL)SendMessage((hwnd), TB_CHANGEBITMAP, (WPARAM) idButton, (LPARAM)iBitmap);
#define ToolBar_CheckButton(hwnd, idButton, fCheck ) \
(BOOL)SendMessage((hwnd), TB_CHECKBUTTON, (WPARAM) idButton, (LPARAM) MAKELONG(fCheck, 0))
#define ToolBar_CommandToIndex(hwnd, idButton) \
(int)SendMessage((hwnd), TB_COMMANDTOINDEX, (WPARAM) idButton, 0L)
#define ToolBar_Customize(hwnd) \
(void)SendMessage((hwnd), TB_CUSTOMIZE, 0, 0L)
#define ToolBar_DeleteButton(hwnd, idButton) \
(BOOL)SendMessage((hwnd), TB_DELETEBUTTON, (WPARAM) idButton, 0L)
#define ToolBar_EnableButton(hwnd, idButton, fEnable ) \
(BOOL)SendMessage((hwnd), TB_ENABLEBUTTON, (WPARAM) idButton, (LPARAM) MAKELONG(fEnable, 0))
#define ToolBar_GetBitmap(hwnd, idButton) \
(int)SendMessage((hwnd), TB_GETBITMAP, (WPARAM) idButton, 0L)
#define ToolBar_GetBitmapFlags(hwnd) \
(int)SendMessage((hwnd), TB_GETBITMAPFLAGS, 0, 0L)
#define ToolBar_GetButton(hwnd, idButton, lpButton) \
(BOOL)SendMessage((hwnd), TB_GETBUTTON, (WPARAM)idButton, (LPARAM)(LPTBBUTTON) lpButton)
#define ToolBar_GetButtonText(hwnd, idButton, lpszText) \
(int)SendMessage((hwnd), TB_GETBUTTONTEXT, (WPARAM) idButton, (LPARAM)(LPSTR)lpszText)
#define ToolBar_GetItemRect(hwnd, idButton, lprc) \
(BOOL)SendMessage((hwnd), TB_GETITEMRECT, (WPARAM)idButton, (LPARAM)(LPRECT)lprc)
#define ToolBar_GetRows(hwnd) \
(int)SendMessage((hwnd), TB_GETROWS, 0, 0L)
#define ToolBar_GetState(hwnd, idButton) \
(int)SendMessage((hwnd), TB_GETSTATE, (WPARAM) idButton, 0L)
#define ToolBar_GetToolTips(hwnd) \
(HWND)SendMessage((hwnd), TB_GETTOOLTIPS, 0, 0L)
#define ToolBar_HideButton(hwnd, idButton, fShow) \
(BOOL)SendMessage((hwnd), TB_HIDEBUTTON, (WPARAM)idButton, (LPARAM)MAKELONG(fShow, 0))
#define ToolBar_Indeterminate(hwnd, idButton, fIndeterminate) \
(BOOL)SendMessage((hwnd), TB_INDETERMINATE, (WPARAM)idButton, (LPARAM) MAKELONG(fIndeterminate, 0))
#define ToolBar_InsertButton(hwnd, idButton, lpButton) \
(BOOL)SendMessage((hwnd), TB_INSERTBUTTON, (WPARAM)idButton, (LPARAM)(LPTBBUTTON)lpButton)
#define ToolBar_IsButtonChecked(hwnd, idButton) \
(int)SendMessage((hwnd), TB_ISBUTTONCHECKED, (WPARAM)idButton, 0L)
#define ToolBar_IsButtonEnabled(hwnd, idButton) \
(int)SendMessage((hwnd), TB_ISBUTTONENABLED, (WPARAM) idButton, 0L)
#define ToolBar_IsButtonHidden(hwnd, idButton) \
(int)SendMessage((hwnd), TB_ISBUTTONHIDDEN, (WPARAM) idButton, 0L)
#define ToolBar_IsButtonIndeterminate(hwnd, idButton) \
(int)SendMessage((hwnd), TB_ISBUTTONINDETERMINATE, (WPARAM) idButton, 0L)
#define ToolBar_IsButtonPressed(hwnd, idButton) \
(int)SendMessage((hwnd), TB_ISBUTTONPRESSED, (WPARAM) idButton, 0L
#define ToolBar_PressButton(hwnd, idButton, fPress) \
(BOOL)SendMessage((hwnd), TB_PRESSBUTTON, (WPARAM)idButton, (LPARAM)MAKELONG(fPress, 0))
#define ToolBar_SaveRestore(hwnd, fSave, ptbsp) \
(void)SendMessage((hwnd), TB_SAVERESTORE, (WPARAM)(BOOL)fSave, (LPARAM)(TBSAVEPARAMS *)ptbsp)
#define ToolBar_SetBitmapSize(hwnd, dxBitmap, dyBitmap) \
(BOOL)SendMessage((hwnd), TB_SETBITMAPSIZE, 0, (LPARAM)MAKELONG(dxBitmap, dyBitmap))
#define ToolBar_SetButtonSize(hwnd, dxBitmap, dyBitmap) \
(BOOL)SendMessage((hwnd), TB_SETBUTTONSIZE, 0, (LPARAM)MAKELONG(dxBitmap, dyBitmap))
#define ToolBar_SetCmdID(hwnd, index, cmdId) \
(BOOL)SendMessage((hwnd), TB_SETCMDID, (WPARAM)(UINT)index, (WPARAM)(UINT)cmdId)
#define ToolBar_SetParent(hwnd, hwndParent) \
(void)SendMessage((hwnd), TB_SETPARENT, (WPARAM) (HWND) hwndParent, 0L)
#define ToolBar_SetRows(hwnd, cRows, fLarger, lprc) \
(void)SendMessage((hwnd), TB_SETROWS, (WPARAM)MAKEWPARAM(cRows, fLarger),(LPARAM)(LPRECT)lprc)
#define ToolBar_SetState(hwnd, idButton, fState) \
(BOOL)SendMessage((hwnd), TB_SETSTATE, (WPARAM)idButton, (LPARAM)MAKELONG(fState, 0))
#define ToolBar_SetToolTips(hwnd) \
(void)SendMessage((hwnd), TB_SETTOOLTIPS, (WPARAM)(HWND) hwndToolTip, 0L)
//-------------------------------------------------------------------
// Tool Tip Helper Macros
//-------------------------------------------------------------------
#define ToolTip_Activate(hwnd, fActivate) \
(void)SendMessage((hwnd), TTM_ACTIVATE, (WPARAM) (BOOL) fActivate, 0L)
#define ToolTip_AddTool(hwnd, lpti) \
(BOOL)SendMessage((hwnd), TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_DelTool(hwnd, lpti) \
(void)SendMessage((hwnd), TTM_DELTOOL, 0, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_EnumTools(hwnd, iTool, lpti) \
(BOOL)SendMessage((hwnd), TTM_ENUMTOOLS, (WPARAM) (UINT) iTool, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_GetCurrentTool(hwnd, lpti) \
(BOOL)SendMessage((hwnd), TTM_GETCURRENTTOOL, 0, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_GetText(hwnd, lpti) \
(void)SendMessage((hwnd), TTM_GETTEXT, 0, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_GetToolCount(hwnd) \
(int)SendMessage((hwnd), TTM_GETTOOLCOUNT, 0, 0L)
#define ToolTip_GetToolInfo(hwnd, lpti) \
(BOOL)SendMessage((hwnd), TTM_GETTOOLINFO, 0, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_HitText(hwnd, lphti) \
(BOOL)SendMessage((hwnd), TTM_HITTEST, 0, (LPARAM) (LPHITTESTINFO) lphti)
#define ToolTip_NewToolRect(hwnd, lpti) \
(void)SendMessage((hwnd), TTM_NEWTOOLRECT, 0, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_RelayEvent(hwnd, lpmsg) \
(void)SendMessage((hwnd), TTM_RELAYEVENT, 0, (LPARAM) (LPMSG) lpmsg)
#define ToolTip_SetDelayTime(hwnd, uFlag, iDelay) \
(void)SendMessage((hwnd), TTM_SETDELAYTIME, (WPARAM) uFlag, (LPARAM) (int) iDelay)
#define ToolTip_SetToolInfo(hwnd, lpti) \
(void)SendMessage((hwnd), TTM_SETTOOLINFO, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_UpdateTipText(hwnd, lpti) \
(void)SendMessage((hwnd), TTM_UPDATETIPTEXT, 0, (LPARAM) (LPTOOLINFO) lpti)
#define ToolTip_WindowFromPoint(hwnd, lppt) \
(HWND)SendMessage((hwnd), TTM_WINDOWFROMPOINT, 0, (POINT FAR *) lppt)
//-------------------------------------------------------------------
// Track Bar Helper Macros
//-------------------------------------------------------------------
#define TrackBar_ClearSel(hwnd, fRedraw) \
(void)SendMessage((hwnd), TBM_CLEARSEL, (WPARAM) (BOOL) fRedraw, 0L)
#define TrackBar_ClearTics(hwnd, fRedraw) \
(void)SendMessage((hwnd), TBM_CLEARTICS, (WPARAM) (BOOL) fRedraw, 0L)
#define TrackBar_GetChannelRect(hwnd, lprc) \
(void)SendMessage((hwnd), TBM_GETCHANNELRECT, 0, (LPARAM) (LPRECT) lprc)
#define TrackBar_GetLineSize(hwnd) \
(LONG)SendMessage((hwnd), TBM_GETLINESIZE, 0, 0L)
#define TrackBar_GetNumTics(hwnd) \
(LONG)SendMessage((hwnd), TBM_GETNUMTICS, 0, 0L)
#define TrackBar_GetPageSize(hwnd) \
(LONG)SendMessage((hwnd), TBM_GETPAGESIZE, 0, 0L)
#define TrackBar_GetPos(hwnd) \
(LONG)SendMessage((hwnd), TBM_GETPOS, 0, 0L)
#define TrackBar_GetPTics(hwnd) \
(LPLONG)SendMessage((hwnd), TBM_GETPTICS, 0, 0L)
#define TrackBar_GetRangeMax(hwnd) \
(LONG)SendMessage((hwnd), TBM_GETRANGEMAX, 0, 0L)
#define TrackBar_GetRangeMin(hwnd) \
(LONG)SendMessage((hwnd), TBM_GETRANGEMIN, 0, 0L)
#define TrackBar_GetSelEnd(hwnd) \
(LONG)SendMessage((hwnd), TBM_GETSELEND, 0, 0L)
#define TrackBar_GetSelStart(hwnd) \
(LONG)SendMessage((hwnd), TBM_GETSELSTART, 0, 0L)
#define TrackBar_GetThumbLength(hwnd) \
(UINT)SendMessage((hwnd), TBM_GETTHUMBLENGTH, 0, 0L)
#define TrackBar_GetThumbRect(hwnd, lprc) \
(void)SendMessage((hwnd), TBM_GETTHUMBRECT, 0, (LPARAM) (LPRECT) lprc)
#define TrackBar_GetTic(hwnd, iTic) \
(LONG)SendMessage((hwnd), TBM_GETTIC, (WPARAM) (WORD) iTic, 0L)
#define TrackBar_GetTicPos(hwnd, iTic) \
(LONG)SendMessage((hwnd), TBM_GETTICPOS, (WPARAM) (WORD) iTic, 0L)
#define TrackBar_SetLineSize(hwnd, lLineSize) \
(LONG)SendMessage((hwnd), TBM_SETLINESIZE, 0, (LONG) lLineSize)
#define TrackBar_SetPageSize(hwnd, lPageSize) \
(LONG)SendMessage((hwnd), TBM_SETPAGESIZE, 0, (LONG) lPageSize)
#define TrackBar_SetPos(hwnd, bPosition, lPosition) \
(void)SendMessage((hwnd), TBM_SETPOS, (WPARAM) (BOOL) bPosition, (LPARAM) (LONG) lPosition)
#define TrackBar_SetRange(hwnd, bRedraw, lMinimum, lMaximum) \
(void)SendMessage((hwnd), TBM_SETRANGE, (WPARAM) (BOOL) bRedraw, (LPARAM) MAKELONG(lMinimum, lMaximum))
#define TrackBar_SetRangeMax(hwnd, bRedraw, lMaximum) \
(void)SendMessage((hwnd), TBM_SETRANGEMAX, (WPARAM) bRedraw, (LPARAM) lMaximum)
#define TrackBar_SetRangeMin(hwnd, bRedraw, lMinimum) \
(void)SendMessage((hwnd), TBM_SETRANGEMIN, (WPARAM) bRedraw, (LPARAM) lMinimum)
#define TrackBar_SetSel(hwnd, bRedraw, lMinimum, lMaximum) \
(void)SendMessage((hwnd), TBM_SETSEL, (WPARAM) (BOOL) bRedraw, (LPARAM) MAKELONG(lMinimum, lMaximum))
#define TrackBar_SetSelEnd(hwnd, bRedraw, lEnd) \
(void)SendMessage((hwnd), TBM_SETSELEND, (WPARAM) (BOOL) bRedraw, (LPARAM) (LONG) lEnd)
#define TrackBar_SetSelStart(hwnd, bRedraw, lStart) \
(void)SendMessage((hwnd), TBM_SETSELSTART, (WPARAM) (BOOL) bRedraw, (LPARAM) (LONG) lStart)
#define TrackBar_SetThumbLength(hwnd, iLength) \
(void)SendMessage((hwnd), TBM_SETTHUMBLENGTH, (WPARAM) (UINT) iLength, 0L)
#define TrackBar_SetTic(hwnd, lPosition) \
(BOOL)SendMessage((hwnd), TBM_SETTIC, 0, (LPARAM) (LONG) lPosition)
#define TrackBar_SetTicFreq(hwnd, wFreq, lPosition) \
(void)SendMessage((hwnd), TBM_SETTICFREQ, (WPARAM) wFreq, (LPARAM) (LONG) lPosition)
//-------------------------------------------------------------------
// Up / Down Control Helper Macros
//-------------------------------------------------------------------
#define UpDown_GetAccel(hwnd, cAccels, paAccels) \
(int)SendMessage((hwnd), UDM_GETACCEL, (WPARAM) cAccels, (LPARAM) (LPUDACCEL) paAccels)
#define UpDown_GetBase(hwnd) \
(int)SendMessage((hwnd), UDM_GETBASE, 0, 0L)
#define UpDown_GetBuddy(hwnd) \
(HWND)SendMessage((hwnd), UDM_GETBUDDY, 0, 0L)
#define UpDown_GetPos(hwnd) \
(DWORD)SendMessage((hwnd), UDM_GETPOS, 0, 0L)
#define UpDown_GetRange(hwnd) \
(DWORD)SendMessage((hwnd), UDM_GETRANGE, 0, 0L)
#define UpDown_SetAccel(hwnd, nAccels, aAccels) \
(BOOL)SendMessage((hwnd), UDM_SETACCEL, (WPARAM) nAccels, (LPARAM) (LPUDACCEL) aAccels)
#define UpDown_SetBase(hwnd, nBase) \
(int)SendMessage((hwnd), UDM_SETBASE, (WPARAM) nBase, 0L)
#define UpDown_SetBuddy(hwnd, hwndBuddy) \
(HWND)SendMessage((hwnd), UDM_SETBUDDY, (WPARAM) (HWND) hwndBuddy, 0L)
#define UpDown_SetPos(hwnd, nPos) \
(short)SendMessage((hwnd), UDM_SETPOS, 0, (LPARAM) MAKELONG((short) nPos, 0))
#define UpDown_SetRange(hwnd, nUpper, nLower) \
(void)SendMessage((hwnd), UDM_SETRANGE, 0, (LPARAM) MAKELONG((short) nUpper, (short) nLower))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -