📄 extensions.h
字号:
#define Toolbar_HideButton(hwnd, idButton, fShow) \
(BOOL)SendMessage((hwnd),TB_HIDEBUTTON,(WPARAM)(int)(idButton),(LPARAM)(BOOL)(fShow))
#define Toolbar_Indeterminate(hwnd, idButton, fIndeterminate) \
(BOOL)SendMessage((hwnd),TB_INDETERMINATE,(WPARAM)(int)(idButton),(LPARAM)(BOOL)(fIndeterminate))
#define Toolbar_InsertButton(hwnd, iButton, lpButton) \
(BOOL)SendMessage((hwnd),TB_INSERTBUTTON,(WPARAM)(UINT)(iButton),(LPARAM)(LPCTBBUTTON)(lpButton))
#define Toolbar_IsButtonChecked(hwnd, idButton) \
(int)SendMessage((hwnd),TB_ISBUTTONCHECKED,(WPARAM)(int)(idButton),(LPARAM)0)
#define Toolbar_IsButtonEnabled(hwnd, idButton) \
(int)SendMessage((hwnd),TB_ISBUTTONENABLED,(WPARAM)(int)(idButton),(LPARAM)0)
#define Toolbar_IsButtonHidden(hwnd, idButton) \
(int)SendMessage((hwnd),TB_ISBUTTONHIDDEN,(WPARAM)(int)(idButton),(LPARAM)0)
#define Toolbar_IsButtonIndeterminate(hwnd, idButton) \
(int)SendMessage((hwnd),TB_ISBUTTONINDETERMINATE,(WPARAM)(int)(idButton),(LPARAM)0)
#define Toolbar_IsButtonPressed(hwnd, idButton) \
(int)SendMessage((hwnd),TB_ISBUTTONPRESSED,(WPARAM)(int)(idButton),(LPARAM)0)
#define Toolbar_PressButton(hwnd, idButton, fPress) \
(BOOL)SendMessage((hwnd),TB_PRESSBUTTON,(WPARAM)(int)(idButton),(LPARAM)(BOOL)(fPress))
#define Toolbar_SaveRestore(hwnd, fSave, ptbsp) \
(void)SendMessage((hwnd),TB_SAVERESTORE,(WPARAM)(BOOL)(fSave),(LPARAM)(const TBSAVEPARAMS*)(ptbsp))
#define Toolbar_SetBitmapSize(hwnd, cx, cy) \
(BOOL)SendMessage((hwnd),TB_SETBITMAPSIZE,(WPARAM)0,MAKELPARAM((cx), (cy)))
#define Toolbar_SetButtonSize(hwnd, cx, cy) \
(BOOL)SendMessage((hwnd),TB_SETBUTTONSIZE,(WPARAM)0,MAKELPARAM((cx), (cy)))
#define Toolbar_SetCmdID(hwnd, iButton, idButton) \
(BOOL)SendMessage((hwnd),TB_SETCMDID,(WPARAM)(UINT)(iButton),(LPARAM)(int)(idButton))
#define Toolbar_SetParent(hwnd, hwndParent) \
(void)SendMessage((hwnd),TB_SETPARENT,(WPARAM)(HWND)(hwndParent),(LPARAM)0)
#define Toolbar_SetRows(hwnd, cRows, fLarger, lprc) \
(void)SendMessage((hwnd),TB_SETROWS,(WPARAM)MAKELONG((UINT)(cRows), (BOOL)(fLarger)),(LPARAM)(LPRECT)lprc)
#define Toolbar_SetState(hwnd, idButton, fState) \
(BOOL)SendMessage((hwnd),TB_SETSTATE,(WPARAM)(int)(idButton),(LPARAM)(UINT)(fState))
#define Toolbar_SetToolTips(hwnd, hwndToolTip) \
(void)SendMessage((hwnd),TB_SETTOOLTIPS,(WPARAM)(HWND)(hwndToolTip,(LPARAM)0)
#define Progress_SetRange(hwnd, low, high) \
(LRESULT)SendMessage((hwnd), PBM_SETRANGE, (WPARAM) 0, (LPARAM)MAKELONG((low), (high)))
#define Progress_SetStep(hwnd, delta) \
(int)SendMessage((hwnd), PBM_SETSTEP, (WPARAM)(delta), 0)
#define Progress_StepIt(hwnd) \
(int)SendMessage((hwnd), PBM_STEPIT, 0, 0)
#define Progress_SetPos(hwnd, pos) \
(int)SendMessage((hwnd), PBM_SETPOS, (WPARAM)(pos), 0)
#define Progress_DeltaPos(hwnd, delta) \
(int)SendMessage((hwnd), PBM_DELTAPOS, (WPARAM)(delta), 0)
#define TB_LINELEFT (TB_LINEDOWN)
#define TB_LINERIGHT (TB_LINEUP)
#define TB_PAGELEFT (TB_PAGEUP)
#define TB_PAGERIGHT (TB_PAGEDOWN)
#define TB_LEFT (TB_TOP)
#define TB_RIGHT (TB_BOTTOM)
#define Trackbar_ClearSel (hwnd, redraw) \
(void)SendMessage((hwnd), TBM_CLEARSEL, (WPARAM)(BOOL)(redraw), 0)
#define Trackbar_ClearTicks (hwnd, redraw) \
(void)SendMessage((hwnd), TBM_CLEARTICS, (WPARAM)(BOOL)(redraw), 0)
#define Trackbar_GetChannelRect (hwnd, rc) \
(void)SendMessage((hwnd), TBM_GETCHANNELRECT, 0, (LPARAM)(LPRECT)(rc))
#define Trackbar_GetLineSize (hwnd) \
(int)SendMessage((hwnd), TBM_GETLINESIZE, 0, 0)
#define Trackbar_GetNumTicks (hwnd) \
(int)SendMessage((hwnd), TBM_GETNUMTICS, 0, 0)
#define Trackbar_GetPageSize (hwnd) \
(int)SendMessage((hwnd), TBM_GETPAGESIZE, 0, 0)
#define Trackbar_GetPos (hwnd) \
(int)SendMessage((hwnd), TBM_GETPOS, 0, 0)
#define Trackbar_GetPTicks (hwnd) \
(LPINT)SendMessage((hwnd), TBM_GETPTICS, 0, 0)
#define Trackbar_GetRangeMax (hwnd) \
(int)SendMessage((hwnd), TBM_GETRANGEMAX, 0, 0)
#define Trackbar_GetRangeMin (hwnd) \
(int)SendMessage((hwnd), TBM_GETRANGEMIN, 0, 0)
#define Trackbar_GetSelEnd (hwnd) \
(int)SendMessage((hwnd), TBM_GETSELEND, 0, 0)
#define Trackbar_GetSelStart (hwnd) \
(int)SendMessage((hwnd), TBM_GETSELSTART, 0, 0)
#define Trackbar_GetThumbLength (hwnd) \
(int)SendMessage((hwnd), TBM_GETTHUMBLENGTH, 0, 0)
#define Trackbar_GetThumbRect (hwnd, rc) \
(void)SendMessage((hwnd), TBM_GETTHUMBRECT, 0, (LPARAM)(LPRECT)(rc))
#define Trackbar_GetTick (hwnd, index) \
(int)SendMessage((hwnd), TBM_GETTIC, (WPARAM)(WORD)(index), 0)
#define Trackbar_GetTickPos (hwnd, index) \
(DWORD)SendMessage((hwnd), TBM_GETTICPOS, (WPARAM)(WORD)(index), 0)
#define Trackbar_SetLineSize (hwnd, size) \
(int)SendMessage((hwnd), TBM_SETLINESIZE, 0, (LPARAM)(LONG)(size))
#define Trackbar_SetPageSize (hwnd, size) \
(int)SendMessage((hwnd), TBM_SETPAGESIZE, 0, (LPARAM)(LONG)(size))
#define Trackbar_SetPos (hwnd, moveit, pos) \
(void)SendMessage((hwnd), TBM_SETPOS, (WPARAM)(BOOL)(moveit), \
(LPARAM)(pos))
#define Trackbar_SetRange (hwnd, redraw, lo, hi) \
(void)SendMessage((hwnd), TBM_SETRANGE, \
(WPARAM)(BOOL)(redraw), \
MAKELONG((WORD)(lo), (WORD)(hi)))
#define Trackbar_SetRangeMax (hwnd, redraw, hi) \
(void)SendMessage((hwnd), TBM_SETRANGEMAX, (WPARAM)(BOOL)(redraw), \
(hi))
#define Trackbar_SetRangeMin (hwnd, redraw, lo) \
(void)SendMessage((hwnd), TBM_SETRANGEMIN, (WPARAM)(BOOL)(redraw), \
(lo))
#define Trackbar_SetSel (hwnd, redraw, lo, hi) \
(void)SendMessage((hwnd), TBM_SETSEL, (WPARAM)(BOOL)(redraw), \
MAKELONG((WORD)(lo), (WORD)(hi)))
#define Trackbar_SetSelEnd (hwnd, redraw, hi) \
(void)SendMessage((hwnd), TBM_SETSELEND, (WPARAM)(BOOL)(redraw), \
(LPARAM)(hi))
#define Trackbar_SetSelStart (hwnd, redraw, lo) \
(void)SendMessage((hwnd), TBM_SETSELSTART, (WPARAM)(BOOL)(redraw), \
(LPARAM)(lo))
#define Trackbar_SetThumbLength (hwnd, size) \
(void)SendMessage((hwnd), TBM_SETTHUMBLENGTH, (WPARAM)(UINT)size, 0)
#define Trackbar_SetTick (hwnd, pos) \
(BOOL)SendMessage((hwnd), TBM_SETTIC, 0, (LPARAM)(LONG)(pos))
#define Trackbar_SetTickFreq (hwnd, freq, offset) \
(void)SendMessage((hwnd), TBM_SETTICFREQ, (WPARAM)(freq), (LPARAM)(offset))
//
// Up/Down extensions
//
#define UpDown_GetAccel(hwnd, count, pAccels) \
(int)SendMessage((hwnd), UDM_GETACCEL, (WPARAM)(count), \
(LPARAM)(LPUDACCEL)(pAccels))
#define UpDown_GetBase(hwnd) \
(int)SendMessage((hwnd), UDM_GETBASE, 0, 0)
#define UpDown_GetBuddy(hwnd) \
(HWND)SendMessage((hwnd), UDM_GETBUDDY, 0, 0)
#define UpDown_GetPos(hwnd) \
(DWORD)SendMessage((hwnd), UDM_GETPOS, 0, 0)
#define UpDown_GetRange(hwnd) \
(DWORD)SendMessage((hwnd), UDM_GETRANGE, 0, 0)
#define UpDown_SetAccel(hwnd, count, pAccels) \
(BOOL)SendMessage((hwnd), UDM_SETACCEL, (WPARAM)(count), \
(LPARAM)(LPUDACCEL)(pAccels))
#define UpDown_SetBase(hwnd, base) \
(int)SendMessage((hwnd), UDM_SETBASE, (WPARAM)(base), 0)
#define UpDown_SetBuddy(hwnd, hBuddy) \
(HWND)SendMessage((hwnd), UDM_SETBUDDY, (WPARAM)(HWND)(hBuddy), 0)
#define UpDown_SetPos(hwnd, pos) \
(int)SendMessage((hwnd), UDM_SETPOS, (WPARAM)(int)(pos), 0)
#define UpDown_SetRange(hwnd, hi, low) \
(void)SendMessage((hwnd), UDM_SETRANGE, 0, \
MAKELONG((short)(hi), (short)(low))
#endif /* _EXTENSIONS_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -