📄 commctrl.h
字号:
typedef struct _HD_LAYOUT
{
RECT FAR* prc;
WINDOWPOS FAR* pwpos;
} HD_LAYOUT;
// BOOL Header_Layout(HWND hwndHD, HD_LAYOUT FAR* playout);
//
#define HDM_LAYOUT (HDM_FIRST + 5)
#define Header_Layout(hwndHD, playout) \
(BOOL)SendMessage((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout))
#define HHT_NOWHERE 0x0001
#define HHT_ONHEADER 0x0002
#define HHT_ONDIVIDER 0x0004
#define HHT_ONDIVOPEN 0x0008
#define HHT_ABOVE 0x0100
#define HHT_BELOW 0x0200
#define HHT_TORIGHT 0x0400
#define HHT_TOLEFT 0x0800
typedef struct _HD_HITTESTINFO
{
POINT pt; // in: client coords
UINT flags; // out: HHT_ flags
int iItem; // out: item
} HD_HITTESTINFO;
#define HDM_HITTEST (HDM_FIRST + 6)
// Header Notifications
//
// All header notifications are via the WM_NOTIFY message.
// lParam of WM_NOTIFY points to a HD_NOTIFY structure for
// all of the following notifications.
// *pitem contains item being changed. pitem->mask indicates
// which fields are valid (others have indeterminate state)
//
#define HDN_ITEMCHANGING (HDN_FIRST-0)
#define HDN_ITEMCHANGED (HDN_FIRST-1)
// Item has been clicked or doubleclicked (HDS_BUTTONS only)
// iButton contains button id: 0=left, 1=right, 2=middle.
//
#define HDN_ITEMCLICK (HDN_FIRST-2)
#define HDN_ITEMDBLCLICK (HDN_FIRST-3)
// Divider area has been clicked or doubleclicked (HDS_DIVIDERTRACK only)
// iButton contains button id: 0=left, 1=right, 2=middle.
//
#define HDN_DIVIDERDBLCLICK (HDN_FIRST-5)
// Begin/end divider tracking (HDS_DIVIDERTRACK only)
// Return TRUE from HDN_BEGINTRACK notification to prevent tracking.
//
#define HDN_BEGINTRACK (HDN_FIRST-6)
#define HDN_ENDTRACK (HDN_FIRST-7)
// HDN_DRAG: cxy field contains new height/width, which may be < 0.
// Changing this value will affect the tracked height/width (allowing
// for gridding, pinning, etc).
//
// Return TRUE to cancel tracking.
//
#define HDN_TRACK (HDN_FIRST-8)
typedef struct _HD_NOTIFY
{
NMHDR hdr;
int iItem;
int iButton; // *CLICK notifications: 0=left, 1=right, 2=middle
HD_ITEM FAR* pitem; // May be NULL
} HD_NOTIFY;
#ifndef NOTOOLBAR
#ifdef _WIN32
#define TOOLBARCLASSNAME "ToolbarWindow32"
#else
#define TOOLBARCLASSNAME "ToolbarWindow"
#endif
typedef struct _TBBUTTON {
int iBitmap; /* index into bitmap of this button's picture */
int idCommand; /* WM_COMMAND menu ID that this button sends */
BYTE fsState; /* button's state */
BYTE fsStyle; /* button's style */
#ifdef _WIN32
BYTE bReserved[2]; /* Realign to DWORD */
#endif
DWORD dwData; /* app defined data */
int iString; /* index into string list */
} TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
typedef const TBBUTTON FAR* LPCTBBUTTON;
typedef struct _COLORMAP {
COLORREF from;
COLORREF to;
} COLORMAP, FAR* LPCOLORMAP;
WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps,
HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons,
int iNumButtons, int dxButton, int dyButton,
int dxBitmap, int dyBitmap, UINT uStructSize);
WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, int idBitmap,
UINT wFlags, LPCOLORMAP lpColorMap,
int iNumMaps);
#define CMB_MASKED 0x02 /* create image/mask pair in bitmap */
/*REVIEW: TBSTATE_* should be TBF_* (for Flags) */
#define TBSTATE_CHECKED 0x01 /* radio button is checked */
#define TBSTATE_PRESSED 0x02 /* button is being depressed (any style) */
#define TBSTATE_ENABLED 0x04 /* button is enabled */
#define TBSTATE_HIDDEN 0x08 /* button is hidden */
#define TBSTATE_INDETERMINATE 0x10 /* button is indeterminate */
#define TBSTATE_WRAP 0x20 /* there is a line break after this button */
/* (needs to be endabled, too) */
#define TBSTYLE_BUTTON 0x00 /* this entry is button */
#define TBSTYLE_SEP 0x01 /* this entry is a separator */
#define TBSTYLE_CHECK 0x02 /* this is a check button (it stays down) */
#define TBSTYLE_GROUP 0x04 /* this is a check button (it stays down) */
#define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK) /* this group is a member of a group radio group */
/* TOOLBAR window styles (not button, not trackbar) */
#define TBSTYLE_TOOLTIPS 0x0100 /* make/use a tooltips control */
#define TBSTYLE_WRAPABLE 0x0200 /* wrappable */
#define TBSTYLE_ALTDRAG 0x0400 /* use ALT for drag/drop customize instead of SHIFT */
#define TB_ENABLEBUTTON (WM_USER + 1)
#define TB_CHECKBUTTON (WM_USER + 2)
#define TB_PRESSBUTTON (WM_USER + 3)
#define TB_HIDEBUTTON (WM_USER + 4)
#define TB_INDETERMINATE (WM_USER + 5)
#define TB_ISBUTTONENABLED (WM_USER + 9)
#define TB_ISBUTTONCHECKED (WM_USER + 10)
#define TB_ISBUTTONPRESSED (WM_USER + 11)
#define TB_ISBUTTONHIDDEN (WM_USER + 12)
#define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
#define TB_SETSTATE (WM_USER + 17)
#define TB_GETSTATE (WM_USER + 18)
#define TB_ADDBITMAP (WM_USER + 19)
#ifdef _WIN32
typedef struct {
HINSTANCE hInst; // module handle or NULL, or HINST_COMMCTRL
UINT nID; // if hInst == NULL, HBITMAP, else ID
} TBADDBITMAP, *LPTBADDBITMAP;
#define HINST_COMMCTRL ((HINSTANCE)-1)
#define IDB_STD_SMALL_COLOR 0
#define IDB_STD_LARGE_COLOR 1
#define IDB_VIEW_SMALL_COLOR 4
#define IDB_VIEW_LARGE_COLOR 5
// icon indexes for standard bitmap
#define STD_CUT 0
#define STD_COPY 1
#define STD_PASTE 2
#define STD_UNDO 3
#define STD_REDOW 4
#define STD_DELETE 5
#define STD_FILENEW 6
#define STD_FILEOPEN 7
#define STD_FILESAVE 8
#define STD_PRINTPRE 9
#define STD_PROPERTIES 10
#define STD_HELP 11
#define STD_FIND 12
#define STD_REPLACE 13
#define STD_PRINT 14
// icon indexes for standard view bitmap
#define VIEW_LARGEICONS 0
#define VIEW_SMALLICONS 1
#define VIEW_LIST 2
#define VIEW_DETAILS 3
#define VIEW_SORTNAME 4
#define VIEW_SORTSIZE 5
#define VIEW_SORTDATE 6
#define VIEW_SORTTYPE 7
#define VIEW_PARENTFOLDER 8
#define VIEW_NETCONNECT 9
#define VIEW_NETDISCONNECT 10
#define VIEW_NEWFOLDER 11
#endif
#define TB_ADDBUTTONS (WM_USER + 20)
#define TB_INSERTBUTTON (WM_USER + 21)
#define TB_DELETEBUTTON (WM_USER + 22)
#define TB_GETBUTTON (WM_USER + 23)
#define TB_BUTTONCOUNT (WM_USER + 24)
#define TB_COMMANDTOINDEX (WM_USER + 25)
#ifdef _WIN32
typedef struct {
HKEY hkr;
LPCSTR pszSubKey;
LPCSTR pszValueName;
} TBSAVEPARAMS;
// wParam: BOOL (TRUE -> save state, FALSE -> restore
// lParam: pointer to TBSAVERESTOREPARAMS
#endif
#define TB_SAVERESTORE (WM_USER + 26)
#define TB_CUSTOMIZE (WM_USER + 27)
#define TB_ADDSTRING (WM_USER + 28)
#define TB_GETITEMRECT (WM_USER + 29)
#define TB_BUTTONSTRUCTSIZE (WM_USER + 30)
#define TB_SETBUTTONSIZE (WM_USER + 31)
#define TB_SETBITMAPSIZE (WM_USER + 32)
#define TB_AUTOSIZE (WM_USER + 33)
#define TB_GETTOOLTIPS (WM_USER + 35)
#define TB_SETTOOLTIPS (WM_USER + 36)
#define TB_SETPARENT (WM_USER + 37)
#define TB_SETROWS (WM_USER + 39)
#define TB_GETROWS (WM_USER + 40)
#define TB_SETCMDID (WM_USER + 42)
#define TB_CHANGEBITMAP (WM_USER + 43)
#define TB_GETBITMAP (WM_USER + 44)
#define TB_GETBUTTONTEXT (WM_USER + 45)
#define TB_REPLACEBITMAP (WM_USER + 46)
typedef struct {
HINSTANCE hInstOld;
UINT nIDOld;
HINSTANCE hInstNew;
UINT nIDNew;
int nButtons;
} TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
#ifdef _WIN32
#define TBBF_LARGE 0x0001
// returns TBBF_ flags
#define TB_GETBITMAPFLAGS (WM_USER + 41)
#define TBN_GETBUTTONINFO (TBN_FIRST-0)
#define TBN_BEGINDRAG (TBN_FIRST-1)
#define TBN_ENDDRAG (TBN_FIRST-2)
#define TBN_BEGINADJUST (TBN_FIRST-3)
#define TBN_ENDADJUST (TBN_FIRST-4)
#define TBN_RESET (TBN_FIRST-5)
#define TBN_QUERYINSERT (TBN_FIRST-6)
#define TBN_QUERYDELETE (TBN_FIRST-7)
#define TBN_TOOLBARCHANGE (TBN_FIRST-8)
#define TBN_CUSTHELP (TBN_FIRST-9)
typedef struct {
NMHDR hdr;
int iItem;
TBBUTTON tbButton;
int cchText;
LPSTR pszText;
} TBNOTIFY, FAR *LPTBNOTIFY;
#endif
#endif /* NOTOOLBAR */
/*//////////////////////////////////////////////////////////////////////*/
#ifndef NOTOOLTIPS
#ifdef _WIN32
#define TOOLTIPS_CLASS "tooltips_class32"
#else
#define TOOLTIPS_CLASS "tooltips_class"
#endif
typedef struct {
UINT cbSize;
UINT uFlags;
HWND hwnd;
UINT uId;
RECT rect;
HINSTANCE hinst;
LPSTR lpszText;
LPARAM lParam;
} TOOLINFO, NEAR *PTOOLINFO, FAR *LPTOOLINFO;
#define TTS_ALWAYSTIP 0x01 // check over inactive windows as well
#define TTS_NOPREFIX 0x02
#define TTF_IDISHWND 0x0001
#define TTF_CENTERTIP 0x0002
#define TTF_RTLREADING 0x0004
#define TTF_SUBCLASS 0x0010
#define TTF_TRACK 0x0020
#define TTF_ABSOLUTE 0x0080
#define TTF_TRANSPARENT 0x0100
#define TTF_DI_SETITEM 0x8000 // valid only on the TTN_NEEDTEXT callback
#define TTDT_AUTOMATIC 0
#define TTDT_RESHOW 1
#define TTDT_AUTOPOP 2
#define TTDT_INITIAL 3
#define TTM_ACTIVATE (WM_USER + 1) // wparam = BOOL (true or false = activate or deactivate)
#define TTM_SETDELAYTIME (WM_USER + 3)
#define TTM_ADDTOOL (WM_USER + 4)
#define TTM_DELTOOL (WM_USER + 5)
#define TTM_NEWTOOLRECT (WM_USER + 6)
#define TTM_RELAYEVENT (WM_USER + 7)
// lParam has TOOLINFO with hwnd and wid. this gets filled in
#define TTM_GETTOOLINFO (WM_USER + 8)
// lParam has TOOLINFO
#define TTM_SETTOOLINFO (WM_USER + 9)
// returns true or false for found, not found.
// fills in LPHITTESTINFO->ti
#define TTM_HITTEST (WM_USER +10)
#define TTM_GETTEXT (WM_USER +11)
#define TTM_UPDATETIPTEXT (WM_USER +12)
#define TTM_GETTOOLCOUNT (WM_USER +13)
#define TTM_ENUMTOOLS (WM_USER +14)
#define TTM_GETCURRENTTOOL (WM_USER + 15)
#define TTM_WINDOWFROMPOINT (WM_USER + 16)
#define TTM_TRACKACTIVATE (WM_USER + 17) // wParam = TRUE/FALSE start end lparam = LPTOOLINFO
#define TTM_TRACKPOSITION (WM_USER + 18) // lParam = dwPos
#define TTM_SETTIPBKCOLOR (WM_USER + 19)
#define TTM_SETTIPTEXTCOLOR (WM_USER + 20)
#define TTM_GETDELAYTIME (WM_USER + 21)
#define TTM_GETTIPBKCOLOR (WM_USER + 22)
#define TTM_GETTIPTEXTCOLOR (WM_USER + 23)
typedef struct _TT_HITTESTINFO {
HWND hwnd;
POINT pt;
TOOLINFO ti;
} TTHITTESTINFO, FAR * LPHITTESTINFO;
// WM_NOTIFY message sent to parent window to get tooltip text
// if LPSTR_TEXTCALLBACK is set on any tips
#define TTN_NEEDTEXT (TTN_FIRST - 0)
#define TTN_SHOW (TTN_FIRST - 1)
#define TTN_POP (TTN_FIRST - 2)
// WM_NOTIFY structure sent if TTF_QUERYFORTIP is set
// the host can
// 1) fill in the szText,
// 2) point lpszText to their own text
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -