commctrl.h
资源名称:VCMenu.zip [点击查看]
上传用户:whjcdz88
上传日期:2007-01-02
资源大小:350k
文件大小:181k
源码类别:
工具条
开发平台:
Visual C++
- /*****************************************************************************
- * *
- * commctrl.h - - Interface for the Windows Common Controls *
- * *
- * Version 1.2 *
- * *
- * Copyright (c) 1991-1997, Microsoft Corp. All rights reserved. *
- * *
- *****************************************************************************/
- #ifndef _INC_COMMCTRL
- #define _INC_COMMCTRL
- #ifndef _WIN32_IE
- #define _WIN32_IE 0x0400
- #else
- #if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
- #error _WIN32_IE setting conflicts with _WIN32_WINNT setting
- #endif
- #endif
- #ifndef _HRESULT_DEFINED
- #define _HRESULT_DEFINED
- typedef LONG HRESULT;
- #endif // _HRESULT_DEFINED
- #ifndef NOUSER
- //
- // Define API decoration for direct importing of DLL references.
- //
- #ifndef WINCOMMCTRLAPI
- #if !defined(_COMCTL32_) && defined(_WIN32)
- #define WINCOMMCTRLAPI DECLSPEC_IMPORT
- #else
- #define WINCOMMCTRLAPI
- #endif
- #endif // WINCOMMCTRLAPI
- //
- // For compilers that don't support nameless unions
- //
- #ifndef DUMMYUNIONNAME
- #ifdef NONAMELESSUNION
- #define DUMMYUNIONNAME u
- #define DUMMYUNIONNAME2 u2
- #define DUMMYUNIONNAME3 u3
- #define DUMMYUNIONNAME4 u4
- #define DUMMYUNIONNAME5 u5
- #else
- #define DUMMYUNIONNAME
- #define DUMMYUNIONNAME2
- #define DUMMYUNIONNAME3
- #define DUMMYUNIONNAME4
- #define DUMMYUNIONNAME5
- #endif
- #endif // DUMMYUNIONNAME
- #ifdef _WIN32
- #include <pshpack1.h>
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- //
- // Users of this header may define any number of these constants to avoid
- // the definitions of each functional group.
- //
- // NOTOOLBAR Customizable bitmap-button toolbar control.
- // NOUPDOWN Up and Down arrow increment/decrement control.
- // NOSTATUSBAR Status bar control.
- // NOMENUHELP APIs to help manage menus, especially with a status bar.
- // NOTRACKBAR Customizable column-width tracking control.
- // NODRAGLIST APIs to make a listbox source and sink drag&drop actions.
- // NOPROGRESS Progress gas gauge.
- // NOHOTKEY HotKey control
- // NOHEADER Header bar control.
- // NOIMAGEAPIS ImageList apis.
- // NOLISTVIEW ListView control.
- // NOTREEVIEW TreeView control.
- // NOTABCONTROL Tab control.
- // NOANIMATE Animate control.
- //
- //=============================================================================
- #include <prsht.h>
- #ifndef SNDMSG
- #ifdef __cplusplus
- #ifndef _MAC
- #define SNDMSG ::SendMessage
- #else
- #define SNDMSG ::AfxSendMessage
- #endif
- #else
- #ifndef _MAC
- #define SNDMSG SendMessage
- #else
- #define SNDMSG AfxSendMessage
- #endif //_MAC
- #endif
- #endif // ifndef SNDMSG
- #ifdef _MAC
- #ifndef RC_INVOKED
- #ifndef _WLM_NOFORCE_LIBS
- #ifndef _WLMDLL
- #ifdef _DEBUG
- #pragma comment(lib, "comctld.lib")
- #else
- #pragma comment(lib, "comctl.lib")
- #endif
- #pragma comment(linker, "/macres:comctl.rsc")
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "msvcctld.lib")
- #else
- #pragma comment(lib, "msvcctl.lib")
- #endif
- #endif // _WLMDLL
- #endif // _WLM_NOFORCE_LIBS
- #endif // RC_INVOKED
- #endif //_MAC
- WINCOMMCTRLAPI void WINAPI InitCommonControls(void);
- #if (_WIN32_IE >= 0x0300)
- typedef struct tagINITCOMMONCONTROLSEX {
- DWORD dwSize; // size of this structure
- DWORD dwICC; // flags indicating which classes to be initialized
- } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
- #define ICC_LISTVIEW_CLASSES 0x00000001 // listview, header
- #define ICC_TREEVIEW_CLASSES 0x00000002 // treeview, tooltips
- #define ICC_BAR_CLASSES 0x00000004 // toolbar, statusbar, trackbar, tooltips
- #define ICC_TAB_CLASSES 0x00000008 // tab, tooltips
- #define ICC_UPDOWN_CLASS 0x00000010 // updown
- #define ICC_PROGRESS_CLASS 0x00000020 // progress
- #define ICC_HOTKEY_CLASS 0x00000040 // hotkey
- #define ICC_ANIMATE_CLASS 0x00000080 // animate
- #define ICC_WIN95_CLASSES 0x000000FF
- #define ICC_DATE_CLASSES 0x00000100 // month picker, date picker, time picker, updown
- #define ICC_USEREX_CLASSES 0x00000200 // comboex
- #define ICC_COOL_CLASSES 0x00000400 // rebar (coolbar) control
- #if (_WIN32_IE >= 0x0400)
- #define ICC_INTERNET_CLASSES 0x00000800
- #define ICC_PAGESCROLLER_CLASS 0x00001000 // page scroller
- #endif
- WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
- #endif // _WIN32_IE >= 0x0300
- #define ODT_HEADER 100
- #define ODT_TAB 101
- #define ODT_LISTVIEW 102
- //====== Ranges for control message IDs =======================================
- #define LVM_FIRST 0x1000 // ListView messages
- #define TV_FIRST 0x1100 // TreeView messages
- #define HDM_FIRST 0x1200 // Header messages
- #define TCM_FIRST 0x1300 // Tab control messages
- #if (_WIN32_IE >= 0x0400)
- #define PGM_FIRST 0x1400 // Pager control messages
- #define CCM_FIRST 0x2000 // Common control shared messages
- #define CCM_SETBKCOLOR (CCM_FIRST + 1) // lParam is bkColor
- typedef struct tagCOLORSCHEME {
- DWORD dwSize;
- COLORREF clrBtnHighlight; // highlight color
- COLORREF clrBtnShadow; // shadow color
- } COLORSCHEME, *LPCOLORSCHEME;
- #define CCM_SETCOLORSCHEME (CCM_FIRST + 2) // lParam is color scheme
- #endif
- //====== WM_NOTIFY Macros =====================================================
- #define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn)
- (fn)((hwnd), (int)(wParam), (NMHDR FAR*)(lParam))
- #define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn)
- (LRESULT)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(idFrom), (LPARAM)(NMHDR FAR*)(pnmhdr))
- //====== Generic WM_NOTIFY notification codes =================================
- #define NM_OUTOFMEMORY (NM_FIRST-1)
- #define NM_CLICK (NM_FIRST-2)
- #define NM_DBLCLK (NM_FIRST-3)
- #define NM_RETURN (NM_FIRST-4)
- #define NM_RCLICK (NM_FIRST-5)
- #define NM_RDBLCLK (NM_FIRST-6)
- #define NM_SETFOCUS (NM_FIRST-7)
- #define NM_KILLFOCUS (NM_FIRST-8)
- #if (_WIN32_IE >= 0x0300)
- #define NM_CUSTOMDRAW (NM_FIRST-12)
- #define NM_HOVER (NM_FIRST-13)
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define NM_NCHITTEST (NM_FIRST-14) // uses NMMOUSE struct
- #define NM_KEYDOWN (NM_FIRST-15)
- #define NM_RELEASEDCAPTURE (NM_FIRST-16)
- #define NM_SETCURSOR (NM_FIRST-17) // uses NMMOUSE struct
- #endif
- #if (_WIN32_IE >= 0x0400)
- //====== Generic WM_NOTIFY notification structures ============================
- typedef struct tagNMMOUSE {
- NMHDR hdr;
- DWORD dwItemSpec;
- DWORD dwItemData;
- POINT pt;
- DWORD dwHitInfo; // any specifics about where on the item or control the mouse is
- } NMMOUSE, FAR* LPNMMOUSE;
- typedef NMMOUSE NMCLICK;
- typedef LPNMMOUSE LPNMCLICK;
- // Generic structure to request an object of a specific type.
- typedef struct tagNMOBJECTNOTIFY {
- NMHDR hdr;
- int iItem;
- #ifdef __IID_DEFINED__
- const IID *piid;
- #else
- const void *piid;
- #endif
- void *pObject;
- HRESULT hResult;
- DWORD dwFlags; // control specific flags (hints as to where in iItem it hit)
- } NMOBJECTNOTIFY, *LPNMOBJECTNOTIFY;
- // Generic structure for a key
- typedef struct tagNMKEY
- {
- NMHDR hdr;
- WORD wVKey;
- UINT flags;
- } NMKEY, FAR *LPNMKEY;
- #endif // _WIN32_IE >= 0x0400
- //====== WM_NOTIFY codes (NMHDR.code values) ==================================
- #define NM_FIRST (0U- 0U) // generic to all controls
- #define NM_LAST (0U- 99U)
- #define LVN_FIRST (0U-100U) // listview
- #define LVN_LAST (0U-199U)
- #define HDN_FIRST (0U-300U) // header
- #define HDN_LAST (0U-399U)
- #define TVN_FIRST (0U-400U) // treeview
- #define TVN_LAST (0U-499U)
- #define TTN_FIRST (0U-520U) // tooltips
- #define TTN_LAST (0U-549U)
- #define TCN_FIRST (0U-550U) // tab control
- #define TCN_LAST (0U-580U)
- // Shell reserved (0U-580U) - (0U-589U)
- #define CDN_FIRST (0U-601U) // common dialog (new)
- #define CDN_LAST (0U-699U)
- #define TBN_FIRST (0U-700U) // toolbar
- #define TBN_LAST (0U-720U)
- #define UDN_FIRST (0U-721) // updown
- #define UDN_LAST (0U-740)
- #if (_WIN32_IE >= 0x0300)
- #define MCN_FIRST (0U-750U) // monthcal
- #define MCN_LAST (0U-759U)
- #define DTN_FIRST (0U-760U) // datetimepick
- #define DTN_LAST (0U-799U)
- #define CBEN_FIRST (0U-800U) // combo box ex
- #define CBEN_LAST (0U-830U)
- #define RBN_FIRST (0U-831U) // rebar
- #define RBN_LAST (0U-859U)
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define IPN_FIRST (0U-860U) // internet address
- #define IPN_LAST (0U-879U) // internet address
- #define SBN_FIRST (0U-880U) // status bar
- #define SBN_LAST (0U-899U)
- #define PGN_FIRST (0U-900U) // Pager Control
- #define PGN_LAST (0U-950U)
- #endif
- #define MSGF_COMMCTRL_BEGINDRAG 0x4200
- #define MSGF_COMMCTRL_SIZEHEADER 0x4201
- #define MSGF_COMMCTRL_DRAGSELECT 0x4202
- #define MSGF_COMMCTRL_TOOLBARCUST 0x4203
- #if (_WIN32_IE >= 0x0300)
- //==================== CUSTOM DRAW ==========================================
- // custom draw return flags
- // values under 0x00010000 are reserved for global custom draw values.
- // above that are for specific controls
- #define CDRF_DODEFAULT 0x00000000
- #define CDRF_NEWFONT 0x00000002
- #define CDRF_SKIPDEFAULT 0x00000004
- #define CDRF_NOTIFYPOSTPAINT 0x00000010
- #define CDRF_NOTIFYITEMDRAW 0x00000020
- #if (_WIN32_IE >= 0x0400)
- #define CDRF_NOTIFYSUBITEMDRAW 0x00000020 // flags are the same, we can distinguish by context
- #endif
- #define CDRF_NOTIFYPOSTERASE 0x00000040
- // drawstage flags
- // values under 0x00010000 are reserved for global custom draw values.
- // above that are for specific controls
- #define CDDS_PREPAINT 0x00000001
- #define CDDS_POSTPAINT 0x00000002
- #define CDDS_PREERASE 0x00000003
- #define CDDS_POSTERASE 0x00000004
- // the 0x000010000 bit means it's individual item specific
- #define CDDS_ITEM 0x00010000
- #define CDDS_ITEMPREPAINT (CDDS_ITEM | CDDS_PREPAINT)
- #define CDDS_ITEMPOSTPAINT (CDDS_ITEM | CDDS_POSTPAINT)
- #define CDDS_ITEMPREERASE (CDDS_ITEM | CDDS_PREERASE)
- #define CDDS_ITEMPOSTERASE (CDDS_ITEM | CDDS_POSTERASE)
- #if (_WIN32_IE >= 0x0400)
- #define CDDS_SUBITEM 0x00020000
- #endif
- // itemState flags
- #define CDIS_SELECTED 0x0001
- #define CDIS_GRAYED 0x0002
- #define CDIS_DISABLED 0x0004
- #define CDIS_CHECKED 0x0008
- #define CDIS_FOCUS 0x0010
- #define CDIS_DEFAULT 0x0020
- #define CDIS_HOT 0x0040
- #define CDIS_MARKED 0x0080
- typedef struct tagNMCUSTOMDRAWINFO
- {
- NMHDR hdr;
- DWORD dwDrawStage;
- HDC hdc;
- RECT rc;
- DWORD dwItemSpec; // this is control specific, but it's how to specify an item. valid only with CDDS_ITEM bit set
- UINT uItemState;
- LPARAM lItemlParam;
- } NMCUSTOMDRAW, FAR * LPNMCUSTOMDRAW;
- // for tooltips
- typedef struct tagNMTTCUSTOMDRAW
- {
- NMCUSTOMDRAW nmcd;
- UINT uDrawFlags;
- } NMTTCUSTOMDRAW, FAR * LPNMTTCUSTOMDRAW;
- #endif // _WIN32_IE >= 0x0300
- //====== IMAGE APIS ===========================================================
- #ifndef NOIMAGEAPIS
- #define CLR_NONE 0xFFFFFFFFL
- #define CLR_DEFAULT 0xFF000000L
- struct _IMAGELIST;
- typedef struct _IMAGELIST NEAR* HIMAGELIST;
- #if (_WIN32_IE >= 0x0300)
- typedef struct _IMAGELISTDRAWPARAMS {
- DWORD cbSize;
- HIMAGELIST himl;
- int i;
- HDC hdcDst;
- int x;
- int y;
- int cx;
- int cy;
- int xBitmap; // x offest from the upperleft of bitmap
- int yBitmap; // y offset from the upperleft of bitmap
- COLORREF rgbBk;
- COLORREF rgbFg;
- UINT fStyle;
- DWORD dwRop;
- } IMAGELISTDRAWPARAMS, FAR * LPIMAGELISTDRAWPARAMS;
- #endif // _WIN32_IE >= 0x0300
- #define ILC_MASK 0x0001
- #define ILC_COLOR 0x0000
- #define ILC_COLORDDB 0x00FE
- #define ILC_COLOR4 0x0004
- #define ILC_COLOR8 0x0008
- #define ILC_COLOR16 0x0010
- #define ILC_COLOR24 0x0018
- #define ILC_COLOR32 0x0020
- #define ILC_PALETTE 0x0800 // (no longer supported...never worked anyway)
- WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_Destroy(HIMAGELIST himl);
- WINCOMMCTRLAPI int WINAPI ImageList_GetImageCount(HIMAGELIST himl);
- #if (_WIN32_IE >= 0x0300)
- WINCOMMCTRLAPI BOOL WINAPI ImageList_SetImageCount(HIMAGELIST himl, UINT uNewCount);
- #endif
- WINCOMMCTRLAPI int WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask);
- WINCOMMCTRLAPI int WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, int i, HICON hicon);
- WINCOMMCTRLAPI COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk);
- WINCOMMCTRLAPI COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST himl);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl, int iImage, int iOverlay);
- #define ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon)
- #define ILD_NORMAL 0x0000
- #define ILD_TRANSPARENT 0x0001
- #define ILD_MASK 0x0010
- #define ILD_IMAGE 0x0020
- #if (_WIN32_IE >= 0x0300)
- #define ILD_ROP 0x0040
- #endif
- #define ILD_BLEND25 0x0002
- #define ILD_BLEND50 0x0004
- #define ILD_OVERLAYMASK 0x0F00
- #define INDEXTOOVERLAYMASK(i) ((i) << 8)
- #define ILD_SELECTED ILD_BLEND50
- #define ILD_FOCUS ILD_BLEND25
- #define ILD_BLEND ILD_BLEND50
- #define CLR_HILIGHT CLR_DEFAULT
- WINCOMMCTRLAPI BOOL WINAPI ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle);
- #ifdef _WIN32
- WINCOMMCTRLAPI BOOL WINAPI ImageList_Replace(HIMAGELIST himl, int i, HBITMAP hbmImage, HBITMAP hbmMask);
- WINCOMMCTRLAPI int WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
- #if (_WIN32_IE >= 0x0300)
- WINCOMMCTRLAPI BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS* pimldp);
- #endif
- WINCOMMCTRLAPI BOOL WINAPI ImageList_Remove(HIMAGELIST himl, int i);
- WINCOMMCTRLAPI HICON WINAPI ImageList_GetIcon(HIMAGELIST himl, int i, UINT flags);
- WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
- WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
- #ifdef UNICODE
- #define ImageList_LoadImage ImageList_LoadImageW
- #else
- #define ImageList_LoadImage ImageList_LoadImageA
- #endif
- #if (_WIN32_IE >= 0x0300)
- #define ILCF_MOVE (0x00000000)
- #define ILCF_SWAP (0x00000001)
- WINCOMMCTRLAPI BOOL WINAPI ImageList_Copy(HIMAGELIST himlDst, int iDst, HIMAGELIST himlSrc, int iSrc, UINT uFlags);
- #endif
- WINCOMMCTRLAPI BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, int iTrack, int dxHotspot, int dyHotspot);
- WINCOMMCTRLAPI void WINAPI ImageList_EndDrag();
- WINCOMMCTRLAPI BOOL WINAPI ImageList_DragEnter(HWND hwndLock, int x, int y);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_DragLeave(HWND hwndLock);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_DragMove(int x, int y);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag, int iDrag, int dxHotspot, int dyHotspot);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_DragShowNolock(BOOL fShow);
- WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_GetDragImage(POINT FAR* ppt,POINT FAR* pptHotspot);
- #define ImageList_RemoveAll(himl) ImageList_Remove(himl, -1)
- #define ImageList_ExtractIcon(hi, himl, i) ImageList_GetIcon(himl, i, 0)
- #define ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask) ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0)
- #ifdef __IStream_INTERFACE_DEFINED__
- WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM pstm);
- #endif
- typedef struct _IMAGEINFO
- {
- HBITMAP hbmImage;
- HBITMAP hbmMask;
- int Unused1;
- int Unused2;
- RECT rcImage;
- } IMAGEINFO, FAR *LPIMAGEINFO;
- WINCOMMCTRLAPI BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, int FAR *cx, int FAR *cy);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl, int cx, int cy);
- WINCOMMCTRLAPI BOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl, int i, IMAGEINFO FAR* pImageInfo);
- WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy);
- #if (_WIN32_IE >= 0x0400)
- WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himl);
- #endif
- #endif
- #endif
- //====== HEADER CONTROL =======================================================
- #ifndef NOHEADER
- #ifdef _WIN32
- #define WC_HEADERA "SysHeader32"
- #define WC_HEADERW L"SysHeader32"
- #ifdef UNICODE
- #define WC_HEADER WC_HEADERW
- #else
- #define WC_HEADER WC_HEADERA
- #endif
- #else
- #define WC_HEADER "SysHeader"
- #endif
- // begin_r_commctrl
- #define HDS_HORZ 0x0000
- #define HDS_BUTTONS 0x0002
- #if (_WIN32_IE >= 0x0300)
- #define HDS_HOTTRACK 0x0004
- #endif
- #define HDS_HIDDEN 0x0008
- #if (_WIN32_IE >= 0x0300)
- #define HDS_DRAGDROP 0x0040
- #define HDS_FULLDRAG 0x0080
- #endif
- // end_r_commctrl
- #if (_WIN32_IE >= 0x0300)
- #define HD_ITEMA HDITEMA
- #define HD_ITEMW HDITEMW
- #else
- #define HDITEMW HD_ITEMW
- #define HDITEMA HD_ITEMA
- #endif
- #define HD_ITEM HDITEM
- typedef struct _HD_ITEMA
- {
- UINT mask;
- int cxy;
- LPSTR pszText;
- HBITMAP hbm;
- int cchTextMax;
- int fmt;
- LPARAM lParam;
- #if (_WIN32_IE >= 0x0300)
- int iImage; // index of bitmap in ImageList
- int iOrder; // where to draw this item
- #endif
- } HDITEMA, FAR * LPHDITEMA;
- typedef struct _HD_ITEMW
- {
- UINT mask;
- int cxy;
- LPWSTR pszText;
- HBITMAP hbm;
- int cchTextMax;
- int fmt;
- LPARAM lParam;
- #if (_WIN32_IE >= 0x0300)
- int iImage; // index of bitmap in ImageList
- int iOrder;
- #endif
- } HDITEMW, FAR * LPHDITEMW;
- #ifdef UNICODE
- #define HDITEM HDITEMW
- #define LPHDITEM LPHDITEMW
- #else
- #define HDITEM HDITEMA
- #define LPHDITEM LPHDITEMW
- #endif
- #define HDI_WIDTH 0x0001
- #define HDI_HEIGHT HDI_WIDTH
- #define HDI_TEXT 0x0002
- #define HDI_FORMAT 0x0004
- #define HDI_LPARAM 0x0008
- #define HDI_BITMAP 0x0010
- #if (_WIN32_IE >= 0x0300)
- #define HDI_IMAGE 0x0020
- #define HDI_DI_SETITEM 0x0040
- #define HDI_ORDER 0x0080
- #endif
- #define HDF_LEFT 0
- #define HDF_RIGHT 1
- #define HDF_CENTER 2
- #define HDF_JUSTIFYMASK 0x0003
- #define HDF_RTLREADING 4
- #define HDF_OWNERDRAW 0x8000
- #define HDF_STRING 0x4000
- #define HDF_BITMAP 0x2000
- #if (_WIN32_IE >= 0x0300)
- #define HDF_BITMAP_ON_RIGHT 0x1000
- #define HDF_IMAGE 0x0800
- #endif
- #define HDM_GETITEMCOUNT (HDM_FIRST + 0)
- #define Header_GetItemCount(hwndHD)
- (int)SNDMSG((hwndHD), HDM_GETITEMCOUNT, 0, 0L)
- #define HDM_INSERTITEMA (HDM_FIRST + 1)
- #define HDM_INSERTITEMW (HDM_FIRST + 10)
- #ifdef UNICODE
- #define HDM_INSERTITEM HDM_INSERTITEMW
- #else
- #define HDM_INSERTITEM HDM_INSERTITEMA
- #endif
- #define Header_InsertItem(hwndHD, i, phdi)
- (int)SNDMSG((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
- #define HDM_DELETEITEM (HDM_FIRST + 2)
- #define Header_DeleteItem(hwndHD, i)
- (BOOL)SNDMSG((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(i), 0L)
- #define HDM_GETITEMA (HDM_FIRST + 3)
- #define HDM_GETITEMW (HDM_FIRST + 11)
- #ifdef UNICODE
- #define HDM_GETITEM HDM_GETITEMW
- #else
- #define HDM_GETITEM HDM_GETITEMA
- #endif
- #define Header_GetItem(hwndHD, i, phdi)
- (BOOL)SNDMSG((hwndHD), HDM_GETITEM, (WPARAM)(int)(i), (LPARAM)(HD_ITEM FAR*)(phdi))
- #define HDM_SETITEMA (HDM_FIRST + 4)
- #define HDM_SETITEMW (HDM_FIRST + 12)
- #ifdef UNICODE
- #define HDM_SETITEM HDM_SETITEMW
- #else
- #define HDM_SETITEM HDM_SETITEMA
- #endif
- #define Header_SetItem(hwndHD, i, phdi)
- (BOOL)SNDMSG((hwndHD), HDM_SETITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
- #if (_WIN32_IE >= 0x0300)
- #define HD_LAYOUT HDLAYOUT
- #else
- #define HDLAYOUT HD_LAYOUT
- #endif
- typedef struct _HD_LAYOUT
- {
- RECT FAR* prc;
- WINDOWPOS FAR* pwpos;
- } HDLAYOUT, FAR *LPHDLAYOUT;
- #define HDM_LAYOUT (HDM_FIRST + 5)
- #define Header_Layout(hwndHD, playout)
- (BOOL)SNDMSG((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
- #if (_WIN32_IE >= 0x0300)
- #define HD_HITTESTINFO HDHITTESTINFO
- #else
- #define HDHITTESTINFO HD_HITTESTINFO
- #endif
- typedef struct _HD_HITTESTINFO
- {
- POINT pt;
- UINT flags;
- int iItem;
- } HDHITTESTINFO, FAR *LPHDHITTESTINFO;
- #define HDM_HITTEST (HDM_FIRST + 6)
- #if (_WIN32_IE >= 0x0300)
- #define HDM_GETITEMRECT (HDM_FIRST + 7)
- #define Header_GetItemRect(hwnd, iItem, lprc)
- (BOOL)SNDMSG((hwnd), HDM_GETITEMRECT, (WPARAM)iItem, (LPARAM)lprc)
- #define HDM_SETIMAGELIST (HDM_FIRST + 8)
- #define Header_SetImageList(hwnd, himl)
- (HIMAGELIST)SNDMSG((hwnd), HDM_SETIMAGELIST, 0, (LPARAM)himl)
- #define HDM_GETIMAGELIST (HDM_FIRST + 9)
- #define Header_GetImageList(hwnd)
- (HIMAGELIST)SNDMSG((hwnd), HDM_GETIMAGELIST, 0, 0)
- #define HDM_ORDERTOINDEX (HDM_FIRST + 15)
- #define Header_OrderToIndex(hwnd, i)
- (int)SNDMSG((hwnd), HDM_ORDERTOINDEX, (WPARAM)i, 0)
- #define HDM_CREATEDRAGIMAGE (HDM_FIRST + 16) // wparam = which item (by index)
- #define Header_CreateDragImage(hwnd, i)
- (HIMAGELIST)SNDMSG((hwnd), HDM_CREATEDRAGIMAGE, (WPARAM)i, 0)
- #define HDM_GETORDERARRAY (HDM_FIRST + 17)
- #define Header_GetOrderArray(hwnd, iCount, lpi)
- (BOOL)SNDMSG((hwnd), HDM_GETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
- #define HDM_SETORDERARRAY (HDM_FIRST + 18)
- #define Header_SetOrderArray(hwnd, iCount, lpi)
- (BOOL)SNDMSG((hwnd), HDM_SETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
- // lparam = int array of size HDM_GETITEMCOUNT
- // the array specifies the order that all items should be displayed.
- // e.g. { 2, 0, 1}
- // says the index 2 item should be shown in the 0ths position
- // index 0 should be shown in the 1st position
- // index 1 should be shown in the 2nd position
- #define HDM_SETHOTDIVIDER (HDM_FIRST + 19)
- #define Header_SetHotDivider(hwnd, fPos, dw)
- (int)SNDMSG((hwnd), HDM_SETHOTDIVIDER, (WPARAM)fPos, (LPARAM)dw)
- // convenience message for external dragdrop
- // wParam = BOOL specifying whether the lParam is a dwPos of the cursor
- // position or the index of which divider to hotlight
- // lParam = depends on wParam (-1 and wParm = FALSE turns off hotlight)
- #endif // _WIN32_IE >= 0x0300
- #define HDN_ITEMCHANGINGA (HDN_FIRST-0)
- #define HDN_ITEMCHANGINGW (HDN_FIRST-20)
- #define HDN_ITEMCHANGEDA (HDN_FIRST-1)
- #define HDN_ITEMCHANGEDW (HDN_FIRST-21)
- #define HDN_ITEMCLICKA (HDN_FIRST-2)
- #define HDN_ITEMCLICKW (HDN_FIRST-22)
- #define HDN_ITEMDBLCLICKA (HDN_FIRST-3)
- #define HDN_ITEMDBLCLICKW (HDN_FIRST-23)
- #define HDN_DIVIDERDBLCLICKA (HDN_FIRST-5)
- #define HDN_DIVIDERDBLCLICKW (HDN_FIRST-25)
- #define HDN_BEGINTRACKA (HDN_FIRST-6)
- #define HDN_BEGINTRACKW (HDN_FIRST-26)
- #define HDN_ENDTRACKA (HDN_FIRST-7)
- #define HDN_ENDTRACKW (HDN_FIRST-27)
- #define HDN_TRACKA (HDN_FIRST-8)
- #define HDN_TRACKW (HDN_FIRST-28)
- #if (_WIN32_IE >= 0x0300)
- #define HDN_GETDISPINFOA (HDN_FIRST-9)
- #define HDN_GETDISPINFOW (HDN_FIRST-29)
- #define HDN_BEGINDRAG (HDN_FIRST-10)
- #define HDN_ENDDRAG (HDN_FIRST-11)
- #endif
- #ifdef UNICODE
- #define HDN_ITEMCHANGING HDN_ITEMCHANGINGW
- #define HDN_ITEMCHANGED HDN_ITEMCHANGEDW
- #define HDN_ITEMCLICK HDN_ITEMCLICKW
- #define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW
- #define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW
- #define HDN_BEGINTRACK HDN_BEGINTRACKW
- #define HDN_ENDTRACK HDN_ENDTRACKW
- #define HDN_TRACK HDN_TRACKW
- #if (_WIN32_IE >= 0x0300)
- #define HDN_GETDISPINFO HDN_GETDISPINFOW
- #endif
- #else
- #define HDN_ITEMCHANGING HDN_ITEMCHANGINGA
- #define HDN_ITEMCHANGED HDN_ITEMCHANGEDA
- #define HDN_ITEMCLICK HDN_ITEMCLICKA
- #define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA
- #define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA
- #define HDN_BEGINTRACK HDN_BEGINTRACKA
- #define HDN_ENDTRACK HDN_ENDTRACKA
- #define HDN_TRACK HDN_TRACKA
- #if (_WIN32_IE >= 0x0300)
- #define HDN_GETDISPINFO HDN_GETDISPINFOA
- #endif
- #endif
- #if (_WIN32_IE >= 0x0300)
- #define HD_NOTIFYA NMHEADERA
- #define HD_NOTIFYW NMHEADERW
- #else
- #define tagNMHEADERA _HD_NOTIFY
- #define NMHEADERA HD_NOTIFYA
- #define tagHMHEADERW _HD_NOTIFYW
- #define NMHEADERW HD_NOTIFYW
- #endif
- #define HD_NOTIFY NMHEADER
- typedef struct tagNMHEADERA
- {
- NMHDR hdr;
- int iItem;
- int iButton;
- HDITEMA FAR* pitem;
- } NMHEADERA, FAR* LPNMHEADERA;
- typedef struct tagNMHEADERW
- {
- NMHDR hdr;
- int iItem;
- int iButton;
- HDITEMW FAR* pitem;
- } NMHEADERW, FAR* LPNMHEADERW;
- #ifdef UNICODE
- #define NMHEADER NMHEADERW
- #define LPNMHEADER LPNMHEADERW
- #else
- #define NMHEADER NMHEADERA
- #define LPNMHEADER LPNMHEADERA
- #endif
- typedef struct tagNMHDDISPINFOW
- {
- NMHDR hdr;
- int iItem;
- UINT mask;
- LPWSTR pszText;
- int cchTextMax;
- int iImage;
- LPARAM lParam;
- } NMHDDISPINFOW, FAR* LPNMHDDISPINFOW;
- typedef struct tagNMHDDISPINFOA
- {
- NMHDR hdr;
- int iItem;
- UINT mask;
- LPSTR pszText;
- int cchTextMax;
- int iImage;
- LPARAM lParam;
- } NMHDDISPINFOA, FAR* LPNMHDDISPINFOA;
- #ifdef UNICODE
- #define NMHDDISPINFO NMHDDISPINFOW
- #define LPNMHDDISPINFO LPNMHDDISPINFOW
- #else
- #define NMHDDISPINFO NMHDDISPINFOA
- #define LPNMHDDISPINFO LPNMHDDISPINFOA
- #endif
- #endif // NOHEADER
- //====== TOOLBAR CONTROL ======================================================
- #ifndef NOTOOLBAR
- #ifdef _WIN32
- #define TOOLBARCLASSNAMEW L"ToolbarWindow32"
- #define TOOLBARCLASSNAMEA "ToolbarWindow32"
- #ifdef UNICODE
- #define TOOLBARCLASSNAME TOOLBARCLASSNAMEW
- #else
- #define TOOLBARCLASSNAME TOOLBARCLASSNAMEA
- #endif
- #else
- #define TOOLBARCLASSNAME "ToolbarWindow"
- #endif
- typedef struct _TBBUTTON {
- int iBitmap;
- int idCommand;
- BYTE fsState;
- BYTE fsStyle;
- #ifdef _WIN32
- BYTE bReserved[2];
- #endif
- DWORD dwData;
- int iString;
- } 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
- #define TBSTATE_CHECKED 0x01
- #define TBSTATE_PRESSED 0x02
- #define TBSTATE_ENABLED 0x04
- #define TBSTATE_HIDDEN 0x08
- #define TBSTATE_INDETERMINATE 0x10
- #define TBSTATE_WRAP 0x20
- #if (_WIN32_IE >= 0x0300)
- #define TBSTATE_ELLIPSES 0x40
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define TBSTATE_MARKED 0x80
- #endif
- #define TBSTYLE_BUTTON 0x0000
- #define TBSTYLE_SEP 0x0001
- #define TBSTYLE_CHECK 0x0002
- #define TBSTYLE_GROUP 0x0004
- #define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK)
- #if (_WIN32_IE >= 0x0300)
- #define TBSTYLE_DROPDOWN 0x0008
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define TBSTYLE_AUTOSIZE 0x0010 // automatically calculate the cx of the button
- #define TBSTYLE_NOPREFIX 0x0020 // if this button should not have accel prefix
- #endif
- #define TBSTYLE_TOOLTIPS 0x0100
- #define TBSTYLE_WRAPABLE 0x0200
- #define TBSTYLE_ALTDRAG 0x0400
- #if (_WIN32_IE >= 0x0300)
- #define TBSTYLE_FLAT 0x0800
- #define TBSTYLE_LIST 0x1000
- #define TBSTYLE_CUSTOMERASE 0x2000
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define TBSTYLE_REGISTERDROP 0x4000
- #define TBSTYLE_TRANSPARENT 0x8000
- #define TBSTYLE_EX_DRAWDDARROWS 0x00000001
- #endif
- #if (_WIN32_IE >= 0x0400)
- // Custom Draw Struture
- typedef struct tagTBCD {
- HBRUSH hbrMonoDither;
- HBRUSH hbrLines; // For drawing lines on buttons
- HPEN hpenLines; // For drawing lines on buttons
- COLORREF clrText; // Color of text
- COLORREF clrMark; // Color of text bk when marked. (only if TBSTATE_MARKED)
- COLORREF clrTextHighlight; // Color of text when highlighted
- COLORREF clrBtnFace; // Background of the button
- COLORREF clrBtnHighlight; // 3D highlight
- COLORREF clrHighlightHotTrack; // In conjunction with fHighlightHotTrack
- // will cause button to highlight like a menu
- RECT rcText; // Rect for text
- int nStringBkMode;
- int nHLStringBkMode;
- BOOL fNoEdges; // No edges
- BOOL fHighlightHotTrack; // Color of the bk of the button when hottracked
- BOOL fNoOffset; // Don't offset button if pressed
- BOOL fNoMark; // Don't draw default highlight of image/text for TBSTATE_MARKED
- } TBCD, * LPTBCD;
- #endif
- #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)
- #if (_WIN32_IE >= 0x0400)
- #define TB_MARKBUTTON (WM_USER + 6)
- #endif
- #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)
- #if (_WIN32_IE >= 0x0400)
- #define TB_ISBUTTONHIGHLIGHTED (WM_USER + 14)
- #endif
- #define TB_SETSTATE (WM_USER + 17)
- #define TB_GETSTATE (WM_USER + 18)
- #define TB_ADDBITMAP (WM_USER + 19)
- #ifdef _WIN32
- typedef struct tagTBADDBITMAP {
- HINSTANCE hInst;
- UINT nID;
- } 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
- #if (_WIN32_IE >= 0x0300)
- #define IDB_HIST_SMALL_COLOR 8
- #define IDB_HIST_LARGE_COLOR 9
- #endif
- // 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
- #if (_WIN32_IE >= 0x0400)
- #define VIEW_VIEWMENU 12
- #endif
- #if (_WIN32_IE >= 0x0300)
- #define HIST_BACK 0
- #define HIST_FORWARD 1
- #define HIST_FAVORITES 2
- #define HIST_ADDTOFAVORITES 3
- #define HIST_VIEWTREE 4
- #endif
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define TB_ADDBUTTONSA (WM_USER + 20)
- #define TB_INSERTBUTTONA (WM_USER + 21)
- #else
- #define TB_ADDBUTTONS (WM_USER + 20)
- #define TB_INSERTBUTTON (WM_USER + 21)
- #endif
- #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 tagTBSAVEPARAMSA {
- HKEY hkr;
- LPCSTR pszSubKey;
- LPCSTR pszValueName;
- } TBSAVEPARAMSA, FAR* LPTBSAVEPARAMSA;
- typedef struct tagTBSAVEPARAMSW {
- HKEY hkr;
- LPCWSTR pszSubKey;
- LPCWSTR pszValueName;
- } TBSAVEPARAMSW, FAR *LPTBSAVEPARAMW;
- #ifdef UNICODE
- #define TBSAVEPARAMS TBSAVEPARAMSW
- #define LPTBSAVEPARAMS LPTBSAVEPARAMSW
- #else
- #define TBSAVEPARAMS TBSAVEPARAMSA
- #define LPTBSAVEPARAMS LPTBSAVEPARAMSA
- #endif
- #endif // _WIN32
- #define TB_SAVERESTOREA (WM_USER + 26)
- #define TB_SAVERESTOREW (WM_USER + 76)
- #define TB_CUSTOMIZE (WM_USER + 27)
- #define TB_ADDSTRINGA (WM_USER + 28)
- #define TB_ADDSTRINGW (WM_USER + 77)
- #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_GETBUTTONTEXTA (WM_USER + 45)
- #define TB_GETBUTTONTEXTW (WM_USER + 75)
- #define TB_REPLACEBITMAP (WM_USER + 46)
- #if (_WIN32_IE >= 0x0300)
- #define TB_SETINDENT (WM_USER + 47)
- #define TB_SETIMAGELIST (WM_USER + 48)
- #define TB_GETIMAGELIST (WM_USER + 49)
- #define TB_LOADIMAGES (WM_USER + 50)
- #define TB_GETRECT (WM_USER + 51) // wParam is the Cmd instead of index
- #define TB_SETHOTIMAGELIST (WM_USER + 52)
- #define TB_GETHOTIMAGELIST (WM_USER + 53)
- #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
- #define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
- #define TB_SETSTYLE (WM_USER + 56)
- #define TB_GETSTYLE (WM_USER + 57)
- #define TB_GETBUTTONSIZE (WM_USER + 58)
- #define TB_SETBUTTONWIDTH (WM_USER + 59)
- #define TB_SETMAXTEXTROWS (WM_USER + 60)
- #define TB_GETTEXTROWS (WM_USER + 61)
- #endif // _WIN32_IE >= 0x0300
- #define TB_SETCOLORSCHEME CCM_SETCOLORSCHEME // lParam is color scheme
- #ifdef UNICODE
- #define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW
- #define TB_SAVERESTORE TB_SAVERESTOREW
- #define TB_ADDSTRING TB_ADDSTRINGW
- #else
- #define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA
- #define TB_SAVERESTORE TB_SAVERESTOREA
- #define TB_ADDSTRING TB_ADDSTRINGA
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define TB_GETOBJECT (WM_USER + 62) // wParam == IID, lParam void **ppv
- #define TB_GETHOTITEM (WM_USER + 71)
- #define TB_SETHOTITEM (WM_USER + 72) // wParam == iHotItem
- #define TB_SETANCHORHIGHLIGHT (WM_USER + 73) // wParam == TRUE/FALSE
- #define TB_GETANCHORHIGHLIGHT (WM_USER + 74)
- #define TB_MAPACCELERATOR (WM_USER + 78) // wParam == ch, lParam int * pidBtn
- typedef struct {
- int iButton;
- DWORD dwFlags;
- } TBINSERTMARK, * LPTBINSERTMARK;
- #define TBIMHT_AFTER 0x00000001 // TRUE = insert After iButton, otherwise before
- #define TBIMHT_BACKGROUND 0x00000002 // TRUE iff missed buttons completely
- #define TB_GETINSERTMARK (WM_USER + 79) // lParam == LPTBINSERTMARK
- #define TB_SETINSERTMARK (WM_USER + 80) // lParam == LPTBINSERTMARK
- #define TB_INSERTMARKHITTEST (WM_USER + 81) // wParam == LPPOINT lParam == LPTBINSERTMARK
- #define TB_MOVEBUTTON (WM_USER + 82)
- #define TB_GETMAXSIZE (WM_USER + 83) // lParam == LPSIZE
- #define TB_SETEXTENDEDSTYLE (WM_USER + 84) // For TBSTYLE_EX_*
- #define TB_GETEXTENDEDSTYLE (WM_USER + 85) // For TBSTYLE_EX_*
- #endif // _WIN32_IE >= 0x0400
- typedef struct {
- HINSTANCE hInstOld;
- UINT nIDOld;
- HINSTANCE hInstNew;
- UINT nIDNew;
- int nButtons;
- } TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
- #ifdef _WIN32
- #define TBBF_LARGE 0x0001
- #define TB_GETBITMAPFLAGS (WM_USER + 41)
- #if (_WIN32_IE >= 0x0400)
- #define TBIF_IMAGE 0x00000001
- #define TBIF_TEXT 0x00000002
- #define TBIF_STATE 0x00000004
- #define TBIF_STYLE 0x00000008
- #define TBIF_LPARAM 0x00000010
- #define TBIF_COMMAND 0x00000020
- #define TBIF_SIZE 0x00000040
- typedef struct {
- UINT cbSize;
- DWORD dwMask;
- int idCommand;
- int iImage;
- BYTE fsState;
- BYTE fsStyle;
- WORD cx;
- DWORD lParam;
- LPSTR pszText;
- int cchText;
- } TBBUTTONINFOA, *LPTBBUTTONINFOA;
- typedef struct {
- UINT cbSize;
- DWORD dwMask;
- int idCommand;
- int iImage;
- BYTE fsState;
- BYTE fsStyle;
- WORD cx;
- DWORD lParam;
- LPWSTR pszText;
- int cchText;
- } TBBUTTONINFOW, *LPTBBUTTONINFOW;
- #ifdef UNICODE
- #define TBBUTTONINFO TBBUTTONINFOW
- #define LPTBBUTTONINFO LPTBBUTTONINFOW
- #else
- #define TBBUTTONINFO TBBUTTONINFOA
- #define LPTBBUTTONINFO LPTBBUTTONINFOA
- #endif
- // BUTTONINFO APIs do NOT support the string pool.
- #define TB_GETBUTTONINFOW (WM_USER + 63)
- #define TB_SETBUTTONINFOW (WM_USER + 64)
- #define TB_GETBUTTONINFOA (WM_USER + 65)
- #define TB_SETBUTTONINFOA (WM_USER + 66)
- #ifdef UNICODE
- #define TB_GETBUTTONINFO TB_GETBUTTONINFOW
- #define TB_SETBUTTONINFO TB_SETBUTTONINFOW
- #else
- #define TB_GETBUTTONINFO TB_GETBUTTONINFOA
- #define TB_SETBUTTONINFO TB_SETBUTTONINFOA
- #endif
- #define TB_INSERTBUTTONW (WM_USER + 67)
- #define TB_ADDBUTTONSW (WM_USER + 68)
- #define TB_HITTEST (WM_USER + 69)
- // New post Win95/NT4 for InsertButton and AddButton. if iString member
- // is a pointer to a string, it will be handled as a string like listview
- // (although LPSTR_TEXTCALLBACK is not supported).
- #ifdef UNICODE
- #define TB_INSERTBUTTON TB_INSERTBUTTONW
- #define TB_ADDBUTTONS TB_ADDBUTTONSW
- #else
- #define TB_INSERTBUTTON TB_INSERTBUTTONA
- #define TB_ADDBUTTONS TB_ADDBUTTONSA
- #endif
- #define TB_SETDRAWTEXTFLAGS (WM_USER + 70) // wParam == mask lParam == bit values
- #endif // _WIN32_IE >= 0x0400
- #define TBN_GETBUTTONINFOA (TBN_FIRST-0)
- #define TBN_GETBUTTONINFOW (TBN_FIRST-20)
- #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)
- #if (_WIN32_IE >= 0x0300)
- #define TBN_DROPDOWN (TBN_FIRST - 10)
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define TBN_GETOBJECT (TBN_FIRST - 12)
- // Structure for TBN_HOTITEMCHANGE notification
- //
- typedef struct tagNMTBHOTITEM
- {
- NMHDR hdr;
- int idOld;
- int idNew;
- DWORD dwFlags; // HICF_*
- } NMTBHOTITEM, * LPNMTBHOTITEM;
- // Hot item change flags
- #define HICF_OTHER 0x00000000
- #define HICF_MOUSE 0x00000001 // Triggered by mouse
- #define HICF_ARROWKEYS 0x00000002 // Triggered by arrow keys
- #define HICF_ACCELERATOR 0x00000004 // Triggered by accelerator
- #define HICF_DROPDOWN 0x00000008 // Button dropped down
- #define HICF_ENTERING 0x00000010 // idOld is invalid
- #define HICF_LEAVING 0x00000020 // idNew is invalid
- #define HICF_RESELECT 0x00000040 // hot item reselected
- #define TBN_HOTITEMCHANGE (TBN_FIRST - 13)
- #define TBN_DRAGOUT (TBN_FIRST - 14) // this is sent when the user clicks down on a button then drags off the button
- #define TBN_DELETINGBUTTON (TBN_FIRST - 15) // uses TBNOTIFY
- #define TBN_GETDISPINFOA (TBN_FIRST - 16) // This is sent when the toolbar needs some display information
- #define TBN_GETDISPINFOW (TBN_FIRST - 17) // This is sent when the toolbar needs some display information
- #define TBNF_IMAGE 0x00000001
- #define TBNF_TEXT 0x00000002
- #define TBNF_DI_SETITEM 0x10000000
- typedef struct {
- NMHDR hdr;
- DWORD dwMask; // [in] Specifies the values requested .[out] Client ask the data to be set for future use
- int idCommand; // [in] id of button we're requesting info for
- DWORD lParam; // [in] lParam of button
- int iImage; // [out] image index
- LPSTR pszText; // [out] new text for item
- int cchText; // [in] size of buffer pointed to by pszText
- } NMTBDISPINFOA, *LPNMTBDISPINFOA;
- typedef struct {
- NMHDR hdr;
- DWORD dwMask; //[in] Specifies the values requested .[out] Client ask the data to be set for future use
- int idCommand; // [in] id of button we're requesting info for
- DWORD lParam; // [in] lParam of button
- int iImage; // [out] image index
- LPWSTR pszText; // [out] new text for item
- int cchText; // [in] size of buffer pointed to by pszText
- } NMTBDISPINFOW, *LPNMTBDISPINFOW;
- #ifdef UNICODE
- #define TBN_GETDISPINFO TBN_GETDISPINFOW
- #define NMTBDISPINFO NMTBDISPINFOW
- #define LPNMTBDISPINFO LPNMTBDISPINFOW
- #else
- #define TBN_GETDISPINFO TBN_GETDISPINFOA
- #define NMTBDISPINFO NMTBDISPINFOA
- #define LPNMTBDISPINFO LPNMTBDISPINFOA
- #endif
- // Return codes for TBN_DROPDOWN
- #define TBDDRET_DEFAULT 0
- #define TBDDRET_NODEFAULT 1
- #define TBDDRET_TREATPRESSED 2 // Treat as a standard press button
- #endif
- #ifdef UNICODE
- #define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW
- #else
- #define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA
- #endif
- #if (_WIN32_IE >= 0x0300)
- #define TBNOTIFYA NMTOOLBARA
- #define TBNOTIFYW NMTOOLBARW
- #define LPTBNOTIFYA LPNMTOOLBARA
- #define LPTBNOTIFYW LPNMTOOLBARW
- #else
- #define tagNMTOOLBARA tagTBNOTIFYA
- #define NMTOOLBARA TBNOTIFYA
- #define LPNMTOOLBARA LPTBNOTIFYA
- #define tagNMTOOLBARW tagTBNOTIFYW
- #define NMTOOLBARW TBNOTIFYW
- #define LPNMTOOLBARW LPTBNOTIFYW
- #endif
- #define TBNOTIFY NMTOOLBAR
- #define LPTBNOTIFY LPNMTOOLBAR
- typedef struct tagNMTOOLBARA {
- #if (_WIN32_IE >= 0x0300)
- NMHDR hdr;
- #endif
- int iItem;
- TBBUTTON tbButton;
- int cchText;
- LPSTR pszText;
- } NMTOOLBARA, FAR* LPNMTOOLBARA;
- typedef struct tagNMTOOLBARW {
- #if (_WIN32_IE >= 0x0300)
- NMHDR hdr;
- #endif
- int iItem;
- TBBUTTON tbButton;
- int cchText;
- LPWSTR pszText;
- } NMTOOLBARW, FAR* LPNMTOOLBARW;
- #ifdef UNICODE
- #define NMTOOLBAR NMTOOLBARW
- #define LPNMTOOLBAR LPNMTOOLBARW
- #else
- #define NMTOOLBAR NMTOOLBARA
- #define LPNMTOOLBAR LPNMTOOLBARA
- #endif
- #endif
- #endif // NOTOOLBAR
- #if (_WIN32_IE >= 0x0300)
- //====== REBAR CONTROL ========================================================
- #ifndef NOREBAR
- #ifdef _WIN32
- #define REBARCLASSNAMEW L"ReBarWindow32"
- #define REBARCLASSNAMEA "ReBarWindow32"
- #ifdef UNICODE
- #define REBARCLASSNAME REBARCLASSNAMEW
- #else
- #define REBARCLASSNAME REBARCLASSNAMEA
- #endif
- #else
- #define REBARCLASSNAME "ReBarWindow"
- #endif
- #define RBIM_IMAGELIST 0x00000001
- #if (_WIN32_IE >= 0x0400)
- #define RBS_TOOLTIPS 0x0100
- #define RBS_VARHEIGHT 0x0200
- #define RBS_BANDBORDERS 0x0400
- #define RBS_FIXEDORDER 0x0800
- #define RBS_REGISTERDROP 0x1000
- #define RBS_AUTOSIZE 0x2000
- #define RBS_VERTICALGRIPPER 0x4000 // this always has the vertical gripper (default for horizontal mode)
- #define RBS_DBLCLKTOGGLE 0x8000
- #else
- #define RBS_TOOLTIPS 0x00000100
- #define RBS_VARHEIGHT 0x00000200
- #define RBS_BANDBORDERS 0x00000400
- #define RBS_FIXEDORDER 0x00000800
- #endif // _WIN32_IE >= 0x0400
- typedef struct tagREBARINFO
- {
- UINT cbSize;
- UINT fMask;
- #ifndef NOIMAGEAPIS
- HIMAGELIST himl;
- #else
- HANDLE himl;
- #endif
- } REBARINFO, FAR *LPREBARINFO;
- #define RBBS_BREAK 0x00000001 // break to new line
- #define RBBS_FIXEDSIZE 0x00000002 // band can't be sized
- #define RBBS_CHILDEDGE 0x00000004 // edge around top & bottom of child window
- #define RBBS_HIDDEN 0x00000008 // don't show
- #define RBBS_NOVERT 0x00000010 // don't show when vertical
- #define RBBS_FIXEDBMP 0x00000020 // bitmap doesn't move during band resize
- #if (_WIN32_IE >= 0x0400)
- #define RBBS_VARIABLEHEIGHT 0x00000040 // allow autosizing of this child vertically
- #define RBBS_GRIPPERALWAYS 0x00000080 // always show the gripper
- #define RBBS_NOGRIPPER 0x00000100 // never show the gripper
- #endif
- #define RBBIM_STYLE 0x00000001
- #define RBBIM_COLORS 0x00000002
- #define RBBIM_TEXT 0x00000004
- #define RBBIM_IMAGE 0x00000008
- #define RBBIM_CHILD 0x00000010
- #define RBBIM_CHILDSIZE 0x00000020
- #define RBBIM_SIZE 0x00000040
- #define RBBIM_BACKGROUND 0x00000080
- #define RBBIM_ID 0x00000100
- #if (_WIN32_IE >= 0x0400)
- #define RBBIM_IDEALSIZE 0x00000200
- #define RBBIM_LPARAM 0x00000400
- #define RBBIM_HEADERSIZE 0x00000800 // control the size of the header
- #endif
- typedef struct tagREBARBANDINFOA
- {
- UINT cbSize;
- UINT fMask;
- UINT fStyle;
- COLORREF clrFore;
- COLORREF clrBack;
- LPSTR lpText;
- UINT cch;
- int iImage;
- HWND hwndChild;
- UINT cxMinChild;
- UINT cyMinChild;
- UINT cx;
- HBITMAP hbmBack;
- UINT wID;
- #if (_WIN32_IE >= 0x0400)
- UINT cyChild;
- UINT cyMaxChild;
- UINT cyIntegral;
- UINT cxIdeal;
- LPARAM lParam;
- UINT cxHeader;
- #endif
- } REBARBANDINFOA, FAR *LPREBARBANDINFOA;
- typedef REBARBANDINFOA CONST FAR *LPCREBARBANDINFOA;
- typedef struct tagREBARBANDINFOW
- {
- UINT cbSize;
- UINT fMask;
- UINT fStyle;
- COLORREF clrFore;
- COLORREF clrBack;
- LPWSTR lpText;
- UINT cch;
- int iImage;
- HWND hwndChild;
- UINT cxMinChild;
- UINT cyMinChild;
- UINT cx;
- HBITMAP hbmBack;
- UINT wID;
- #if (_WIN32_IE >= 0x0400)
- UINT cyChild;
- UINT cyMaxChild;
- UINT cyIntegral;
- UINT cxIdeal;
- LPARAM lParam;
- UINT cxHeader;
- #endif
- } REBARBANDINFOW, FAR *LPREBARBANDINFOW;
- typedef REBARBANDINFOW CONST FAR *LPCREBARBANDINFOW;
- #ifdef UNICODE
- #define REBARBANDINFO REBARBANDINFOW
- #define LPREBARBANDINFO LPREBARBANDINFOW
- #define LPCREBARBANDINFO LPCREBARBANDINFOW
- #else
- #define REBARBANDINFO REBARBANDINFOA
- #define LPREBARBANDINFO LPREBARBANDINFOA
- #define LPCREBARBANDINFO LPCREBARBANDINFOA
- #endif
- #define RB_INSERTBANDA (WM_USER + 1)
- #define RB_DELETEBAND (WM_USER + 2)
- #define RB_GETBARINFO (WM_USER + 3)
- #define RB_SETBARINFO (WM_USER + 4)
- #if (_WIN32_IE < 0x0400)
- #define RB_GETBANDINFO (WM_USER + 5)
- #endif
- #define RB_SETBANDINFOA (WM_USER + 6)
- #define RB_SETPARENT (WM_USER + 7)
- #if (_WIN32_IE >= 0x0400)
- #define RB_HITTEST (WM_USER + 8)
- #define RB_GETRECT (WM_USER + 9)
- #endif
- #define RB_INSERTBANDW (WM_USER + 10)
- #define RB_SETBANDINFOW (WM_USER + 11)
- #define RB_GETBANDCOUNT (WM_USER + 12)
- #define RB_GETROWCOUNT (WM_USER + 13)
- #define RB_GETROWHEIGHT (WM_USER + 14)
- #if (_WIN32_IE >= 0x0400)
- #define RB_IDTOINDEX (WM_USER + 16) // wParam == id
- #define RB_GETTOOLTIPS (WM_USER + 17)
- #define RB_SETTOOLTIPS (WM_USER + 18)
- #define RB_SETBKCOLOR (WM_USER + 19) // sets the default BK color
- #define RB_GETBKCOLOR (WM_USER + 20) // defaults to CLR_NONE
- #define RB_SETTEXTCOLOR (WM_USER + 21)
- #define RB_GETTEXTCOLOR (WM_USER + 22) // defaults to 0x00000000
- #define RB_SIZETORECT (WM_USER + 23) // resize the rebar/break bands and such to this rect (lparam)
- #endif // _WIN32_IE >= 0x0400
- #define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME // lParama is color scheme
- #ifdef UNICODE
- #define RB_INSERTBAND RB_INSERTBANDW
- #define RB_SETBANDINFO RB_SETBANDINFOW
- #else
- #define RB_INSERTBAND RB_INSERTBANDA
- #define RB_SETBANDINFO RB_SETBANDINFOA
- #endif
- #if (_WIN32_IE >= 0x0400)
- // for manual drag control
- // lparam == cursor pos
- // -1 means do it yourself.
- // -2 means use what you had saved before
- #define RB_BEGINDRAG (WM_USER + 24)
- #define RB_ENDDRAG (WM_USER + 25)
- #define RB_DRAGMOVE (WM_USER + 26)
- #define RB_GETBARHEIGHT (WM_USER + 27)
- #define RB_GETBANDINFOW (WM_USER + 28)
- #define RB_GETBANDINFOA (WM_USER + 29)
- #ifdef UNICODE
- #define RB_GETBANDINFO RB_GETBANDINFOW
- #else
- #define RB_GETBANDINFO RB_GETBANDINFOA
- #endif
- #define RB_MINIMIZEBAND (WM_USER + 30)
- #define RB_MAXIMIZEBAND (WM_USER + 31)
- #define RB_GETDROPTARGET (WM_USER + 32)
- #define RB_GETBANDBORDERS (WM_USER + 34) // returns in lparam = lprc the amount of edges added to band wparam
- #define RB_SHOWBAND (WM_USER + 35) // show/hide band
- #define RB_SETPALETTE (WM_USER + 37)
- #define RB_GETPALETTE (WM_USER + 38)
- #define RB_MOVEBAND (WM_USER + 39)
- #endif // _WIN32_IE >= 0x0400
- #define RBN_HEIGHTCHANGE (RBN_FIRST - 0)
- #if (_WIN32_IE >= 0x0400)
- #define RBN_GETOBJECT (RBN_FIRST - 1)
- #define RBN_LAYOUTCHANGED (RBN_FIRST - 2)
- #define RBN_AUTOSIZE (RBN_FIRST - 3)
- #define RBN_BEGINDRAG (RBN_FIRST - 4)
- #define RBN_ENDDRAG (RBN_FIRST - 5)
- #define RBN_DELETINGBAND (RBN_FIRST - 6) // Uses NMREBAR
- #define RBN_DELETEDBAND (RBN_FIRST - 7) // Uses NMREBAR
- #define RBN_CHILDSIZE (RBN_FIRST - 8)
- typedef struct tagNMREBARCHILDSIZE
- {
- NMHDR hdr;
- UINT uBand;
- UINT wID;
- RECT rcChild;
- RECT rcBand;
- } NMREBARCHILDSIZE, *LPNMREBARCHILDSIZE;
- typedef struct tagNMREBAR
- {
- NMHDR hdr;
- DWORD dwMask; // RBNM_*
- UINT uBand;
- UINT fStyle;
- UINT wID;
- LPARAM lParam;
- } NMREBAR, *LPNMREBAR;
- // Mask flags for NMREBAR
- #define RBNM_ID 0x00000001
- #define RBNM_STYLE 0x00000002
- #define RBNM_LPARAM 0x00000004
- typedef struct tagNMRBAUTOSIZE
- {
- NMHDR hdr;
- BOOL fChanged;
- RECT rcTarget;
- RECT rcActual;
- } NMRBAUTOSIZE, *LPNMRBAUTOSIZE;
- #define RBHT_NOWHERE 0x0001
- #define RBHT_CAPTION 0x0002
- #define RBHT_CLIENT 0x0003
- #define RBHT_GRABBER 0x0004
- typedef struct _RB_HITTESTINFO
- {
- POINT pt;
- UINT flags;
- int iBand;
- } RBHITTESTINFO, FAR *LPRBHITTESTINFO;
- #endif // _WIN32_IE >= 0x0400
- #endif // NOREBAR
- #endif // _WIN32_IE >= 0x0300
- //====== TOOLTIPS CONTROL =====================================================
- #ifndef NOTOOLTIPS
- #ifdef _WIN32
- #define TOOLTIPS_CLASSW L"tooltips_class32"
- #define TOOLTIPS_CLASSA "tooltips_class32"
- #ifdef UNICODE
- #define TOOLTIPS_CLASS TOOLTIPS_CLASSW
- #else
- #define TOOLTIPS_CLASS TOOLTIPS_CLASSA
- #endif
- #else
- #define TOOLTIPS_CLASS "tooltips_class"
- #endif
- #if (_WIN32_IE >= 0x0300)
- #define LPTOOLINFOA LPTTTOOLINFOA
- #define LPTOOLINFOW LPTTTOOLINFOW
- #define TOOLINFOA TTTOOLINFOA
- #define TOOLINFOW TTTOOLINFOW
- #else
- #define TTTOOLINFOA TOOLINFOA
- #define LPTTTOOLINFOA LPTOOLINFOA
- #define TTTOOLINFOW TOOLINFOW
- #define LPTTTOOLINFOW LPTOOLINFOW
- #endif
- #define LPTOOLINFO LPTTTOOLINFO
- #define TOOLINFO TTTOOLINFO
- typedef struct tagTOOLINFOA {
- UINT cbSize;
- UINT uFlags;
- HWND hwnd;
- UINT uId;
- RECT rect;
- HINSTANCE hinst;
- LPSTR lpszText;
- #if (_WIN32_IE >= 0x0300)
- LPARAM lParam;
- #endif
- } TTTOOLINFOA, NEAR *PTOOLINFOA, FAR *LPTTTOOLINFOA;
- typedef struct tagTOOLINFOW {
- UINT cbSize;
- UINT uFlags;
- HWND hwnd;
- UINT uId;
- RECT rect;
- HINSTANCE hinst;
- LPWSTR lpszText;
- #if (_WIN32_IE >= 0x0300)
- LPARAM lParam;
- #endif
- } TTTOOLINFOW, NEAR *PTOOLINFOW, FAR* LPTTTOOLINFOW;
- #ifdef UNICODE
- #define TTTOOLINFO TTTOOLINFOW
- #define PTOOLINFO PTOOLINFOW
- #define LPTTTOOLINFO LPTTTOOLINFOW
- #else
- #define PTOOLINFO PTOOLINFOA
- #define TTTOOLINFO TTTOOLINFOA
- #define LPTTTOOLINFO LPTTTOOLINFOA
- #endif
- // begin_r_commctrl
- #define TTS_ALWAYSTIP 0x01
- #define TTS_NOPREFIX 0x02
- // end_r_commctrl
- #define TTF_IDISHWND 0x0001
- // Use this to center around trackpoint in trackmode
- // -OR- to center around tool in normal mode.
- // Use TTF_ABSOLUTE to place the tip exactly at the track coords when
- // in tracking mode. TTF_ABSOLUTE can be used in conjunction with TTF_CENTERTIP
- // to center the tip absolutely about the track point.
- #define TTF_CENTERTIP 0x0002
- #define TTF_RTLREADING 0x0004
- #if (_WIN32_IE >= 0x0300)
- #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
- #endif // _WIN32_IE >= 0x0300
- #define TTDT_AUTOMATIC 0
- #define TTDT_RESHOW 1
- #define TTDT_AUTOPOP 2
- #define TTDT_INITIAL 3
- #define TTM_ACTIVATE (WM_USER + 1)
- #define TTM_SETDELAYTIME (WM_USER + 3)
- #define TTM_ADDTOOLA (WM_USER + 4)
- #define TTM_ADDTOOLW (WM_USER + 50)
- #define TTM_DELTOOLA (WM_USER + 5)
- #define TTM_DELTOOLW (WM_USER + 51)
- #define TTM_NEWTOOLRECTA (WM_USER + 6)
- #define TTM_NEWTOOLRECTW (WM_USER + 52)
- #define TTM_RELAYEVENT (WM_USER + 7)
- #define TTM_GETTOOLINFOA (WM_USER + 8)
- #define TTM_GETTOOLINFOW (WM_USER + 53)
- #define TTM_SETTOOLINFOA (WM_USER + 9)
- #define TTM_SETTOOLINFOW (WM_USER + 54)
- #define TTM_HITTESTA (WM_USER +10)
- #define TTM_HITTESTW (WM_USER +55)
- #define TTM_GETTEXTA (WM_USER +11)
- #define TTM_GETTEXTW (WM_USER +56)
- #define TTM_UPDATETIPTEXTA (WM_USER +12)
- #define TTM_UPDATETIPTEXTW (WM_USER +57)
- #define TTM_GETTOOLCOUNT (WM_USER +13)
- #define TTM_ENUMTOOLSA (WM_USER +14)
- #define TTM_ENUMTOOLSW (WM_USER +58)
- #define TTM_GETCURRENTTOOLA (WM_USER + 15)
- #define TTM_GETCURRENTTOOLW (WM_USER + 59)
- #define TTM_WINDOWFROMPOINT (WM_USER + 16)
- #if (_WIN32_IE >= 0x0300)
- #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)
- #define TTM_SETMAXTIPWIDTH (WM_USER + 24)
- #define TTM_GETMAXTIPWIDTH (WM_USER + 25)
- #define TTM_SETMARGIN (WM_USER + 26) // lParam = lprc
- #define TTM_GETMARGIN (WM_USER + 27) // lParam = lprc
- #define TTM_POP (WM_USER + 28)
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define TTM_UPDATE (WM_USER + 29)
- #endif
- #ifdef UNICODE
- #define TTM_ADDTOOL TTM_ADDTOOLW
- #define TTM_DELTOOL TTM_DELTOOLW
- #define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW
- #define TTM_GETTOOLINFO TTM_GETTOOLINFOW
- #define TTM_SETTOOLINFO TTM_SETTOOLINFOW
- #define TTM_HITTEST TTM_HITTESTW
- #define TTM_GETTEXT TTM_GETTEXTW
- #define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW
- #define TTM_ENUMTOOLS TTM_ENUMTOOLSW
- #define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW
- #else
- #define TTM_ADDTOOL TTM_ADDTOOLA
- #define TTM_DELTOOL TTM_DELTOOLA
- #define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA
- #define TTM_GETTOOLINFO TTM_GETTOOLINFOA
- #define TTM_SETTOOLINFO TTM_SETTOOLINFOA
- #define TTM_HITTEST TTM_HITTESTA
- #define TTM_GETTEXT TTM_GETTEXTA
- #define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA
- #define TTM_ENUMTOOLS TTM_ENUMTOOLSA
- #define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA
- #endif
- #if (_WIN32_IE >= 0x0300)
- #define LPHITTESTINFOW LPTTHITTESTINFOW
- #define LPHITTESTINFOA LPTTHITTESTINFOA
- #else
- #define LPTTHITTESTINFOA LPHITTESTINFOA
- #define LPTTHITTESTINFOW LPHITTESTINFOW
- #endif
- #define LPHITTESTINFO LPTTHITTESTINFO
- typedef struct _TT_HITTESTINFOA {
- HWND hwnd;
- POINT pt;
- TTTOOLINFOA ti;
- } TTHITTESTINFOA, FAR * LPTTHITTESTINFOA;
- typedef struct _TT_HITTESTINFOW {
- HWND hwnd;
- POINT pt;
- TTTOOLINFOW ti;
- } TTHITTESTINFOW, FAR * LPTTHITTESTINFOW;
- #ifdef UNICODE
- #define TTHITTESTINFO TTHITTESTINFOW
- #define LPTTHITTESTINFO LPTTHITTESTINFOW
- #else
- #define TTHITTESTINFO TTHITTESTINFOA
- #define LPTTHITTESTINFO LPTTHITTESTINFOA
- #endif
- #define TTN_GETDISPINFOA (TTN_FIRST - 0)
- #define TTN_GETDISPINFOW (TTN_FIRST - 10)
- #define TTN_SHOW (TTN_FIRST - 1)
- #define TTN_POP (TTN_FIRST - 2)
- #ifdef UNICODE
- #define TTN_GETDISPINFO TTN_GETDISPINFOW
- #else
- #define TTN_GETDISPINFO TTN_GETDISPINFOA
- #endif
- #define TTN_NEEDTEXT TTN_GETDISPINFO
- #define TTN_NEEDTEXTA TTN_GETDISPINFOA
- #define TTN_NEEDTEXTW TTN_GETDISPINFOW
- #if (_WIN32_IE >= 0x0300)
- #define TOOLTIPTEXTW NMTTDISPINFOW
- #define TOOLTIPTEXTA NMTTDISPINFOA
- #define LPTOOLTIPTEXTA LPNMTTDISPINFOA
- #define LPTOOLTIPTEXTW LPNMTTDISPINFOW
- #else
- #define tagNMTTDISPINFOA tagTOOLTIPTEXTA
- #define NMTTDISPINFOA TOOLTIPTEXTA
- #define LPNMTTDISPINFOA LPTOOLTIPTEXTA
- #define tagNMTTDISPINFOW tagTOOLTIPTEXTW
- #define NMTTDISPINFOW TOOLTIPTEXTW
- #define LPNMTTDISPINFOW LPTOOLTIPTEXTW
- #endif
- #define TOOLTIPTEXT NMTTDISPINFO
- #define LPTOOLTIPTEXT LPNMTTDISPINFO
- typedef struct tagNMTTDISPIFNOA {
- NMHDR hdr;
- LPSTR lpszText;
- char szText[80];
- HINSTANCE hinst;
- UINT uFlags;
- #if (_WIN32_IE >= 0x0300)
- LPARAM lParam;
- #endif
- } NMTTDISPINFOA, FAR *LPNMTTDISPINFOA;
- typedef struct tagNMTTDISPINFOW {
- NMHDR hdr;
- LPWSTR lpszText;
- WCHAR szText[80];
- HINSTANCE hinst;
- UINT uFlags;
- #if (_WIN32_IE >= 0x0300)
- LPARAM lParam;
- #endif
- } NMTTDISPINFOW, FAR *LPNMTTDISPINFOW;
- #ifdef UNICODE
- #define NMTTDISPINFO NMTTDISPINFOW
- #define LPNMTTDISPINFO LPNMTTDISPINFOW
- #else
- #define NMTTDISPINFO NMTTDISPINFOA
- #define LPNMTTDISPINFO LPNMTTDISPINFOA
- #endif
- #endif // NOTOOLTIPS
- //====== STATUS BAR CONTROL ===================================================
- #ifndef NOSTATUSBAR
- // begin_r_commctrl
- #define SBARS_SIZEGRIP 0x0100
- // end_r_commctrl
- WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR pszText, UINT uFlags);
- WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR pszText, UINT uFlags);
- WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID);
- WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID);
- #ifdef UNICODE
- #define CreateStatusWindow CreateStatusWindowW
- #define DrawStatusText DrawStatusTextW
- #else
- #define CreateStatusWindow CreateStatusWindowA
- #define DrawStatusText DrawStatusTextA
- #endif
- #ifdef _WIN32
- #define STATUSCLASSNAMEW L"msctls_statusbar32"
- #define STATUSCLASSNAMEA "msctls_statusbar32"
- #ifdef UNICODE
- #define STATUSCLASSNAME STATUSCLASSNAMEW
- #else
- #define STATUSCLASSNAME STATUSCLASSNAMEA
- #endif
- #else
- #define STATUSCLASSNAME "msctls_statusbar"
- #endif
- #define SB_SETTEXTA (WM_USER+1)
- #define SB_SETTEXTW (WM_USER+11)
- #define SB_GETTEXTA (WM_USER+2)
- #define SB_GETTEXTW (WM_USER+13)
- #define SB_GETTEXTLENGTHA (WM_USER+3)
- #define SB_GETTEXTLENGTHW (WM_USER+12)
- #ifdef UNICODE
- #define SB_GETTEXT SB_GETTEXTW
- #define SB_SETTEXT SB_SETTEXTW
- #define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW
- #if (_WIN32_IE >= 0x0400)
- #define SB_SETTIPTEXT SB_SETTIPTEXTW
- #define SB_GETTIPTEXT SB_GETTIPTEXTW
- #endif
- #else
- #define SB_GETTEXT SB_GETTEXTA
- #define SB_SETTEXT SB_SETTEXTA
- #define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA
- #if (_WIN32_IE >= 0x0400)
- #define SB_SETTIPTEXT SB_SETTIPTEXTA
- #define SB_GETTIPTEXT SB_GETTIPTEXTA
- #endif
- #endif
- #define SB_SETPARTS (WM_USER+4)
- #define SB_GETPARTS (WM_USER+6)
- #define SB_GETBORDERS (WM_USER+7)
- #define SB_SETMINHEIGHT (WM_USER+8)
- #define SB_SIMPLE (WM_USER+9)
- #define SB_GETRECT (WM_USER+10)
- #if (_WIN32_IE >= 0x0300)
- #define SB_ISSIMPLE (WM_USER+14)
- #endif
- #if (_WIN32_IE >= 0x0400)
- #define SB_SETICON (WM_USER+15)
- #define SB_SETTIPTEXTA (WM_USER+16)
- #define SB_SETTIPTEXTW (WM_USER+17)
- #define SB_GETTIPTEXTA (WM_USER+18)
- #define SB_GETTIPTEXTW (WM_USER+19)
- #endif
- #define SBT_OWNERDRAW 0x1000
- #define SBT_NOBORDERS 0x0100
- #define SBT_POPOUT 0x0200
- #define SBT_RTLREADING 0x0400
- #if (_WIN32_IE >= 0x0400)
- #define SBT_TOOLTIPS 0x0800
- #endif
- #define SB_SETBKCOLOR CCM_SETBKCOLOR // lParam = bkColor
- /// status bar notifications
- #if (_WIN32_IE >= 0x0400)
- #define SBN_SIMPLEMODECHANGE (SBN_FIRST - 0)
- #endif
- #endif // NOSTATUSBAR
- //====== MENU HELP ============================================================
- #ifndef NOMENUHELP
- WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT FAR *lpwIDs);
- WINCOMMCTRLAPI BOOL WINAPI ShowHideMenuCtl(HWND hWnd, UINT uFlags, LPINT lpInfo);
- WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo);
- #define MINSYSCOMMAND SC_SIZE
- #endif
- //====== TRACKBAR CONTROL =====================================================
- #ifndef NOTRACKBAR
- #ifdef _WIN32
- #define TRACKBAR_CLASSA "msctls_trackbar32"
- #define TRACKBAR_CLASSW L"msctls_trackbar32"
- #ifdef UNICODE
- #define TRACKBAR_CLASS TRACKBAR_CLASSW
- #else
- #define TRACKBAR_CLASS TRACKBAR_CLASSA
- #endif
- #else
- #define TRACKBAR_CLASS "msctls_trackbar"
- #endif
- // begin_r_commctrl
- #define TBS_AUTOTICKS 0x0001
- #define TBS_VERT 0x0002
- #define TBS_HORZ 0x0000
- #define TBS_TOP 0x0004
- #define TBS_BOTTOM 0x0000
- #define TBS_LEFT 0x0004
- #define TBS_RIGHT 0x0000
- #define TBS_BOTH 0x0008
- #define TBS_NOTICKS 0x0010
- #define TBS_ENABLESELRANGE 0x0020
- #define TBS_FIXEDLENGTH 0x0040
- #define TBS_NOTHUMB 0x0080
- #if (_WIN32_IE >= 0x0300)
- #define TBS_TOOLTIPS 0x0100
- #endif
- // end_r_commctrl
- #define TBM_GETPOS (WM_USER)
- #define TBM_GETRANGEMIN (WM_USER+1)
- #define TBM_GETRANGEMAX (WM_USER+2)
- #define TBM_GETTIC (WM_USER+3)
- #define TBM_SETTIC (WM_USER+4)
- #define TBM_SETPOS (WM_USER+5)
- #define TBM_SETRANGE (WM_USER+6)
- #define TBM_SETRANGEMIN (WM_USER+7)
- #define TBM_SETRANGEMAX (WM_USER+8)
- #define TBM_CLEARTICS (WM_USER+9)
- #define TBM_SETSEL (WM_USER+10)
- #define TBM_SETSELSTART (WM_USER+11)
- #define TBM_SETSELEND (WM_USER+12)
- #define TBM_GETPTICS (WM_USER+14)
- #define TBM_GETTICPOS (WM_USER+15)
- #define TBM_GETNUMTICS (WM_USER+16)
- #define TBM_GETSELSTART (WM_USER+17)
- #define TBM_GETSELEND (WM_USER+18)
- #define TBM_CLEARSEL (WM_USER+19)
- #define TBM_SETTICFREQ (WM_USER+20)
- #define TBM_SETPAGESIZE (WM_USER+21)
- #define TBM_GETPAGESIZE (WM_USER+22)
- #define TBM_SETLINESIZE (WM_USER+23)
- #define TBM_GETLINESIZE (WM_USER+24)
- #define TBM_GETTHUMBRECT (WM_USER+25)
- #define TBM_GETCHANNELRECT (WM_USER+26)
- #define TBM_SETTHUMBLENGTH (WM_USER+27)
- #define TBM_GETTHUMBLENGTH (WM_USER+28)
- #if (_WIN32_IE >= 0x0300)
- #define TBM_SETTOOLTIPS (WM_USER+29)
- #define TBM_GETTOOLTIPS (WM_USER+30)
- #define TBM_SETTIPSIDE (WM_USER+31)
- // TrackBar Tip Side flags
- #define TBTS_TOP 0
- #define TBTS_LEFT 1
- #define TBTS_BOTTOM 2
- #define TBTS_RIGHT 3
- #define TBM_SETBUDDY (WM_USER+32) // wparam = BOOL fLeft; (or right)
- #define TBM_GETBUDDY (WM_USER+33) // wparam = BOOL fLeft; (or right)
- #endif
- #define TB_LINEUP 0
- #define TB_LINEDOWN 1
- #define TB_PAGEUP 2
- #define TB_PAGEDOWN 3
- #define TB_THUMBPOSITION 4
- #define TB_THUMBTRACK 5
- #define TB_TOP 6
- #define TB_BOTTOM 7
- #define TB_ENDTRACK 8
- #if (_WIN32_IE >= 0x0300)
- // custom draw item specs
- #define TBCD_TICS 0x0001
- #define TBCD_THUMB 0x0002
- #define TBCD_CHANNEL 0x0003
- #endif
- #endif // trackbar
- //====== DRAG LIST CONTROL ====================================================
- #ifndef NODRAGLIST
- typedef struct tagDRAGLISTINFO {
- UINT uNotification;
- HWND hWnd;
- POINT ptCursor;
- } DRAGLISTINFO, FAR *LPDRAGLISTINFO;
- #define DL_BEGINDRAG (WM_USER+133)
- #define DL_DRAGGING (WM_USER+134)
- #define DL_DROPPED (WM_USER+135)
- #define DL_CANCELDRAG (WM_USER+136)
- #define DL_CURSORSET 0
- #define DL_STOPCURSOR 1
- #define DL_COPYCURSOR 2
- #define DL_MOVECURSOR 3
- #define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg")
- WINCOMMCTRLAPI BOOL WINAPI MakeDragList(HWND hLB);
- WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent, HWND hLB, int nItem);
- WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB, POINT pt, BOOL bAutoScroll);
- #endif
- //====== UPDOWN CONTROL =======================================================
- #ifndef NOUPDOWN
- #ifdef _WIN32
- #define UPDOWN_CLASSA "msctls_updown32"
- #define UPDOWN_CLASSW L"msctls_updown32"
- #ifdef UNICODE
- #define UPDOWN_CLASS UPDOWN_CLASSW
- #else
- #define UPDOWN_CLASS UPDOWN_CLASSA
- #endif
- #else
- #define UPDOWN_CLASS "msctls_updown"
- #endif
- typedef struct _UDACCEL {
- UINT nSec;
- UINT nInc;
- } UDACCEL, FAR *LPUDACCEL;
- #define UD_MAXVAL 0x7fff
- #define UD_MINVAL (-UD_MAXVAL)
- // begin_r_commctrl
- #define UDS_WRAP 0x0001
- #define UDS_SETBUDDYINT 0x0002
- #define UDS_ALIGNRIGHT 0x0004
- #define UDS_ALIGNLEFT 0x0008
- #define UDS_AUTOBUDDY 0x0010
- #define UDS_ARROWKEYS 0x0020
- #define UDS_HORZ 0x0040
- #define UDS_NOTHOUSANDS 0x0080
- #if (_WIN32_IE >= 0x0300)
- #define UDS_HOTTRACK 0x0100
- #endif
- // end_r_commctrl
- #define UDM_SETRANGE (WM_USER+101)
- #define UDM_GETRANGE (WM_USER+102)
- #define UDM_SETPOS (WM_USER+103)
- #define UDM_GETPOS (WM_USER+104)
- #define UDM_SETBUDDY (WM_USER+105)
- #define UDM_GETBUDDY (WM_USER+106)
- #define UDM_SETACCEL (WM_USER+107)
- #define UDM_GETACCEL (WM_USER+108)
- #define UDM_SETBASE (WM_USER+109)
- #define UDM_GETBASE (WM_USER+110)
- #if (_WIN32_IE >= 0x0400)
- #define UDM_SETRANGE32 (WM_USER+111)
- #define UDM_GETRANGE32 (WM_USER+112) // wParam & lParam are LPINT
- #endif
- WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy,
- HWND hParent, int nID, HINSTANCE hInst,
- HWND hBuddy,
- int nUpper, int nLower, int nPos);
- #if (_WIN32_IE >= 0x0300)
- #define NM_UPDOWN NMUPDOWN
- #define LPNM_UPDOWN LPNMUPDOWN
- #else
- #define NMUPDOWN NM_UPDOWN
- #define LPNMUPDOWN LPNM_UPDOWN
- #endif
- typedef struct _NM_UPDOWN
- {
- NMHDR hdr;
- int iPos;
- int iDelta;
- } NMUPDOWN, FAR *LPNMUPDOWN;
- #define UDN_DELTAPOS (UDN_FIRST - 1)
- #endif // NOUPDOWN
- //====== PROGRESS CONTROL =====================================================
- #ifndef NOPROGRESS
- #ifdef _WIN32
- #define PROGRESS_CLASSA "msctls_progress32"
- #define PROGRESS_CLASSW L"msctls_progress32"
- #ifdef UNICODE
- #define PROGRESS_CLASS PROGRESS_CLASSW
- #else
- #define PROGRESS_CLASS PROGRESS_CLASSA
- #endif
- #else
- #define PROGRESS_CLASS "msctls_progress"
- #endif
- #if (_WIN32_IE >= 0x0300)
- #define PBS_SMOOTH 0x01
- #define PBS_VERTICAL 0x04
- #endif
- #define PBM_SETRANGE (WM_USER+1)
- #define PBM_SETPOS (WM_USER+2)
- #define PBM_DELTAPOS (WM_USER+3)
- #define PBM_SETSTEP (WM_USER+4)
- #define PBM_STEPIT (WM_USER+5)
- #if (_WIN32_IE >= 0x0300)
- #define PBM_SETRANGE32 (WM_USER+6) // lParam = high, wParam = low
- typedef struct
- {
- int iLow;
- int iHigh;
- } PBRANGE, *PPBRANGE;
- #define PBM_GETRANGE (WM_USER+7) // wParam = return (TRUE ? low : high). lParam = PPBRANGE or NULL
- #define PBM_GETPOS (WM_USER+8)
- #define PBM_SETBKCOLOR CCM_SETBKCOLOR // lParam = bkColor
- #endif // _WIN32_IE >= 0x0300
- #endif // NOPROGRESS
- //====== HOTKEY CONTROL =======================================================
- #ifndef NOHOTKEY
- #define HOTKEYF_SHIFT 0x01
- #define HOTKEYF_CONTROL 0x02
- #define HOTKEYF_ALT 0x04
- #ifdef _MAC
- #define HOTKEYF_EXT 0x80
- #else
- #define HOTKEYF_EXT 0x08
- #endif
- #define HKCOMB_NONE 0x0001
- #define HKCOMB_S 0x0002
- #define HKCOMB_C 0x0004
- #define HKCOMB_A 0x0008
- #define HKCOMB_SC 0x0010
- #define HKCOMB_SA 0x0020
- #define HKCOMB_CA 0x0040
- #define HKCOMB_SCA 0x0080
- #define HKM_SETHOTKEY (WM_USER+1)
- #define HKM_GETHOTKEY (WM_USER+2)
- #define HKM_SETRULES (WM_USER+3)
- #ifdef _WIN32
- #define HOTKEY_CLASSA "msctls_hotkey32"
- #define HOTKEY_CLASSW L"msctls_hotkey32"
- #ifdef UNICODE
- #define HOTKEY_CLASS HOTKEY_CLASSW
- #else
- #define HOTKEY_CLASS HOTKEY_CLASSA
- #endif
- #else
- #define HOTKEY_CLASS "msctls_hotkey"
- #endif
- #endif // NOHOTKEY
- // begin_r_commctrl
- //====== COMMON CONTROL STYLES ================================================
- #define CCS_TOP 0x00000001L
- #define CCS_NOMOVEY 0x00000002L
- #define CCS_BOTTOM 0x00000003L
- #define CCS_NORESIZE 0x00000004L
- #define CCS_NOPARENTALIGN 0x00000008L
- #define CCS_ADJUSTABLE 0x00000020L
- #define CCS_NODIVIDER 0x00000040L
- #if (_WIN32_IE >= 0x0300)
- #define CCS_VERT 0x00000080L
- #define CCS_LEFT (CCS_VERT | CCS_TOP)
- #define CCS_RIGHT (CCS_VERT | CCS_BOTTOM)
- #define CCS_NOMOVEX (CCS_VERT | CCS_NOMOVEY)
- #endif
- // end_r_commctrl
- //====== LISTVIEW CONTROL =====================================================
- #ifndef NOLISTVIEW
- #ifdef _WIN32
- #define WC_LISTVIEWA "SysListView32"
- #define WC_LISTVIEWW L"SysListView32"
- #ifdef UNICODE
- #define WC_LISTVIEW WC_LISTVIEWW
- #else
- #define WC_LISTVIEW WC_LISTVIEWA
- #endif
- #else
- #define WC_LISTVIEW "SysListView"
- #endif
- // begin_r_commctrl
- #define LVS_ICON 0x0000
- #define LVS_REPORT 0x0001
- #define LVS_SMALLICON 0x0002
- #define LVS_LIST 0x0003
- #define LVS_TYPEMASK 0x0003
- #define LVS_SINGLESEL 0x0004
- #define LVS_SHOWSELALWAYS 0x0008
- #define LVS_SORTASCENDING 0x0010
- #define LVS_SORTDESCENDING 0x0020
- #define LVS_SHAREIMAGELISTS 0x0040
- #define LVS_NOLABELWRAP 0x0080
- #define LVS_AUTOARRANGE 0x0100
- #define LVS_EDITLABELS 0x0200
- #if (_WIN32_IE >= 0x0300)
- #define LVS_OWNERDATA 0x1000
- #endif
- #define LVS_NOSCROLL 0x2000
- #define LVS_TYPESTYLEMASK 0xfc00
- #define LVS_ALIGNTOP 0x0000
- #define LVS_ALIGNLEFT 0x0800
- #define LVS_ALIGNMASK 0x0c00
- #define LVS_OWNERDRAWFIXED 0x0400
- #define LVS_NOCOLUMNHEADER 0x4000
- #define LVS_NOSORTHEADER 0x8000
- // end_r_commctrl
- #define LVM_GETBKCOLOR (LVM_FIRST + 0)
- #define ListView_GetBkColor(hwnd)
- (COLORREF)SNDMSG((hwnd), LVM_GETBKCOLOR, 0, 0L)
- #define LVM_SETBKCOLOR (LVM_FIRST + 1)
- #define ListView_SetBkColor(hwnd, clrBk)
- (BOOL)SNDMSG((hwnd), LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk))
- #define LVM_GETIMAGELIST (LVM_FIRST + 2)
- #define ListView_GetImageList(hwnd, iImageList)
- (HIMAGELIST)SNDMSG((hwnd), LVM_GETIMAGELIST, (WPARAM)(INT)(iImageList), 0L)
- #define LVSIL_NORMAL 0
- #define LVSIL_SMALL 1
- #define LVSIL_STATE 2
- #define LVM_SETIMAGELIST (LVM_FIRST + 3)
- #define ListView_SetImageList(hwnd, himl, iImageList)
- (HIMAGELIST)(UINT)SNDMSG((hwnd), LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(UINT)(HIMAGELIST)(himl))
- #define LVM_GETITEMCOUNT (LVM_FIRST + 4)
- #define ListView_GetItemCount(hwnd)
- (int)SNDMSG((hwnd), LVM_GETITEMCOUNT, 0, 0L)
- #define LVIF_TEXT 0x0001
- #define LVIF_IMAGE 0x0002
- #define LVIF_PARAM 0x0004
- #define LVIF_STATE 0x0008
- #if (_WIN32_IE >= 0x0300)
- #define LVIF_INDENT 0x0010
- #define LVIF_NORECOMPUTE 0x0800
- #endif
- #define LVIS_FOCUSED 0x0001
- #define LVIS_SELECTED 0x0002
- #define LVIS_CUT 0x0004
- #define LVIS_DROPHILITED 0x0008
- #define LVIS_OVERLAYMASK 0x0F00
- #define LVIS_STATEIMAGEMASK 0xF000
- #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12)
- #if (_WIN32_IE >= 0x0300)
- #define I_INDENTCALLBACK (-1)
- #define LV_ITEMA LVITEMA
- #define LV_ITEMW LVITEMW
- #else
- #define tagLVITEMA _LV_ITEMA
- #define LVITEMA LV_ITEMA
- #define tagLVITEMW _LV_ITEMW
- #define LVITEMW LV_ITEMW
- #endif
- #define LV_ITEM LVITEM
- typedef struct tagLVITEMA
- {
- UINT mask;
- int iItem;
- int iSubItem;
- UINT state;
- UINT stateMask;
- LPSTR pszText;
- int cchTextMax;
- int iImage;
- LPARAM lParam;
- #if (_WIN32_IE >= 0x0300)
- int iIndent;
- #endif
- } LVITEMA, FAR* LPLVITEMA;
- typedef struct tagLVITEMW
- {
- UINT mask;
- int iItem;
- int iSubItem;
- UINT state;
- UINT stateMask;
- LPWSTR pszText;
- int cchTextMax;
- int iImage;
- LPARAM lParam;
- #if (_WIN32_IE >= 0x0300)
- int iIndent;
- #endif
- } LVITEMW, FAR* LPLVITEMW;
- #ifdef UNICODE
- #define LVITEM LVITEMW
- #define LPLVITEM LPLVITEMW
- #else
- #define LVITEM LVITEMA
- #define LPLVITEM LPLVITEMA
- #endif
- #define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L)
- #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)
- #ifdef UNICODE
- #define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW
- #else
- #define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA
- #endif
- #define I_IMAGECALLBACK (-1)
- #define LVM_GETITEMA (LVM_FIRST + 5)
- #define LVM_GETITEMW (LVM_FIRST + 75)
- #ifdef UNICODE
- #define LVM_GETITEM LVM_GETITEMW
- #else
- #define LVM_GETITEM LVM_GETITEMA
- #endif
- #define ListView_GetItem(hwnd, pitem)
- (BOOL)SNDMSG((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM FAR*)(pitem))
- #define LVM_SETITEMA (LVM_FIRST + 6)
- #define LVM_SETITEMW (LVM_FIRST + 76)
- #ifdef UNICODE
- #define LVM_SETITEM LVM_SETITEMW
- #else
- #define LVM_SETITEM LVM_SETITEMA
- #endif
- #define ListView_SetItem(hwnd, pitem)
- (BOOL)SNDMSG((hwnd), LVM_SETITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
- #define LVM_INSERTITEMA (LVM_FIRST + 7)
- #define LVM_INSERTITEMW (LVM_FIRST + 77)
- #ifdef UNICODE
- #define LVM_INSERTITEM LVM_INSERTITEMW
- #else
- #define LVM_INSERTITEM LVM_INSERTITEMA
- #endif
- #define ListView_InsertItem(hwnd, pitem)
- (int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
- #define LVM_DELETEITEM (LVM_FIRST + 8)
- #define ListView_DeleteItem(hwnd, i)
- (BOOL)SNDMSG((hwnd), LVM_DELETEITEM, (WPARAM)(int)(i), 0L)
- #define LVM_DELETEALLITEMS (LVM_FIRST + 9)
- #define ListView_DeleteAllItems(hwnd)
- (BOOL)SNDMSG((hwnd), LVM_DELETEALLITEMS, 0, 0L)
- #define LVM_GETCALLBACKMASK (LVM_FIRST + 10)
- #define ListView_GetCallbackMask(hwnd)
- (BOOL)SNDMSG((hwnd), LVM_GETCALLBACKMASK, 0, 0)
- #define LVM_SETCALLBACKMASK (LVM_FIRST + 11)
- #define ListView_SetCallbackMask(hwnd, mask)
- (BOOL)SNDMSG((hwnd), LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0)
- #define LVNI_ALL 0x0000
- #define LVNI_FOCUSED 0x0001
- #define LVNI_SELECTED 0x0002
- #define LVNI_CUT 0x0004
- #define LVNI_DROPHILITED 0x0008
- #define LVNI_ABOVE 0x0100
- #define LVNI_BELOW 0x0200
- #define LVNI_TOLEFT 0x0400
- #define LVNI_TORIGHT 0x0800
- #define LVM_GETNEXTITEM (LVM_FIRST + 12)
- #define ListView_GetNextItem(hwnd, i, flags)
- (int)SNDMSG((hwnd), LVM_GETNEXTITEM, (WPARAM)(int)(i), MAKELPARAM((flags), 0))
- #define LVFI_PARAM 0x0001
- #define LVFI_STRING 0x0002
- #define LVFI_PARTIAL 0x0008
- #define LVFI_WRAP 0x0020
- #define LVFI_NEARESTXY 0x0040
- #if (_WIN32_IE >= 0x0300)
- #define LV_FINDINFOA LVFINDINFOA
- #define LV_FINDINFOW LVFINDINFOW
- #else
- #define tagLVFINDINFOA _LV_FINDINFOA
- #define LVFINDINFOA LV_FINDINFOA
- #define tagLVFINDINFOW _LV_FINDINFOW
- #define LVFINDINFOW LV_FINDINFOW
- #endif
- #define LV_FINDINFO LVFINDINFO
- typedef struct tagLVFINDINFOA
- {
- UINT flags;
- LPCSTR psz;
- LPARAM lParam;
- POINT pt;
- UINT vkDirection;
- } LVFINDINFOA, FAR* LPFINDINFOA;
- typedef struct tagLVFINDINFOW
- {
- UINT flags;
- LPCWSTR psz;
- LPARAM lParam;
- POINT pt;
- UINT vkDirection;
- } LVFINDINFOW, FAR* LPFINDINFOW;
- #ifdef UNICODE
- #define LVFINDINFO LVFINDINFOW
- #else
- #define LVFINDINFO LVFINDINFOA
- #endif
- #define LVM_FINDITEMA (LVM_FIRST + 13)
- #define LVM_FINDITEMW (LVM_FIRST + 83)
- #ifdef UNICODE
- #define LVM_FINDITEM LVM_FINDITEMW
- #else
- #define LVM_FINDITEM LVM_FINDITEMA
- #endif
- #define ListView_FindItem(hwnd, iStart, plvfi)
- (int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
- #define LVIR_BOUNDS 0
- #define LVIR_ICON 1
- #define LVIR_LABEL 2
- #define LVIR_SELECTBOUNDS 3
- #define LVM_GETITEMRECT (LVM_FIRST + 14)
- #define ListView_GetItemRect(hwnd, i, prc, code)
- (BOOL)SNDMSG((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i),
- ((prc) ? (((RECT FAR *)(prc))->left = (code),(LPARAM)(RECT FAR*)(prc)) : (LPARAM)(RECT FAR*)NULL))
- #define LVM_SETITEMPOSITION (LVM_FIRST + 15)
- #define ListView_SetItemPosition(hwndLV, i, x, y)
- (BOOL)SNDMSG((hwndLV), LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y)))
- #define LVM_GETITEMPOSITION (LVM_FIRST + 16)
- #define ListView_GetItemPosition(hwndLV, i, ppt)
- (BOOL)SNDMSG((hwndLV), LVM_GETITEMPOSITION, (WPARAM)(int)(i), (LPARAM)(POINT FAR*)(ppt))
- #define LVM_GETSTRINGWIDTHA (LVM_FIRST + 17)
- #define LVM_GETSTRINGWIDTHW (LVM_FIRST + 87)
- #ifdef UNICODE
- #define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW
- #else
- #define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA
- #endif
- #define ListView_GetStringWidth(hwndLV, psz)
- (int)SNDMSG((hwndLV), LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)(psz))
- #define LVHT_NOWHERE 0x0001
- #define LVHT_ONITEMICON 0x0002
- #define LVHT_ONITEMLABEL 0x0004
- #define LVHT_ONITEMSTATEICON 0x0008
- #define LVHT_ONITEM (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
- #define LVHT_ABOVE 0x0008
- #define LVHT_BELOW 0x0010
- #define LVHT_TORIGHT 0x0020
- #define LVHT_TOLEFT 0x0040
- #if (_WIN32_IE >= 0x0300)
- #define LV_HITTESTINFO LVHITTESTINFO
- #else
- #define tagLVHITTESTINFO _LV_HITTESTINFO
- #define LVHITTESTINFO LV_HITTESTINFO
- #endif
- typedef struct tagLVHITTESTINFO
- {
- POINT pt;
- UINT flags;
- int iItem;
- #if (_WIN32_IE >= 0x0300)
- int iSubItem; // this is was NOT in win95. valid only for LVM_SUBITEMHITTEST
- #endif
- } LVHITTESTINFO, FAR* LPLVHITTESTINFO;
- #define LVM_HITTEST (LVM_FIRST + 18)
- #define ListView_HitTest(hwndLV, pinfo)
- (int)SNDMSG((hwndLV), LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO FAR*)(pinfo))
- #define LVM_ENSUREVISIBLE (LVM_FIRST + 19)
- #define ListView_EnsureVisible(hwndLV, i, fPartialOK)
- (BOOL)SNDMSG((hwndLV), LVM_ENSUREVISIBLE, (WPARAM)(int)(i), MAKELPARAM((fPartialOK), 0))
- #define LVM_SCROLL (LVM_FIRST + 20)
- #define ListView_Scroll(hwndLV, dx, dy)
- (BOOL)SNDMSG((hwndLV), LVM_SCROLL, (WPARAM)(int)dx, (LPARAM)(int)dy)
- #define LVM_REDRAWITEMS (LVM_FIRST + 21)
- #define ListView_RedrawItems(hwndLV, iFirst, iLast)
- (BOOL)SNDMSG((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)iFirst, (LPARAM)(int)iLast)
- #define LVA_DEFAULT 0x0000
- #define LVA_ALIGNLEFT 0x0001
- #define LVA_ALIGNTOP 0x0002
- #define LVA_SNAPTOGRID 0x0005
- #define LVM_ARRANGE (LVM_FIRST + 22)
- #define ListView_Arrange(hwndLV, code)
- (BOOL)SNDMSG((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0L)
- #define LVM_EDITLABELA (LVM_FIRST + 23)
- #define LVM_EDITLABELW (LVM_FIRST + 118)
- #ifdef UNICODE
- #define LVM_EDITLABEL LVM_EDITLABELW
- #else
- #define LVM_EDITLABEL LVM_EDITLABELA
- #endif
- #define ListView_EditLabel(hwndLV, i)
- (HWND)SNDMSG((hwndLV), LVM_EDITLABEL, (WPARAM)(int)(i), 0L)
- #define LVM_GETEDITCONTROL (LVM_FIRST + 24)
- #define ListView_GetEditControl(hwndLV)
- (HWND)SNDMSG((hwndLV), LVM_GETEDITCONTROL, 0, 0L)
- #if (_WIN32_IE >= 0x0300)
- #define LV_COLUMNA LVCOLUMNA
- #define LV_COLUMNW LVCOLUMNW
- #else
- #define tagLVCOLUMNA _LV_COLUMNA
- #define LVCOLUMNA LV_COLUMNA
- #define tagLVCOLUMNW _LV_COLUMNW