home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
COMMCTRL.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-28
|
96KB
|
3,157 lines
{*******************************************************}
{ }
{ Delphi Run-time Library }
{ Windows 32bit API Interface Unit }
{ }
{ Copyright (c) 1996-1997 Borland International }
{ }
{*******************************************************}
unit CommCtrl; // $Revision: 1.9 $
interface
uses Messages, Windows;
{ Interface for the Windows Property Sheet Pages }
const
MAXPROPPAGES = 100;
PSP_DEFAULT = $0000;
PSP_DLGINDIRECT = $0001;
PSP_USEHICON = $0002;
PSP_USEICONID = $0004;
PSP_USETITLE = $0008;
PSP_HASHELP = $0020;
PSP_USEREFPARENT = $0040;
PSP_USECALLBACK = $0080;
PSPCB_RELEASE = 1;
PSPCB_CREATE = 2;
PSH_DEFAULT = $0000;
PSH_PROPTITLE = $0001;
PSH_USEHICON = $0002;
PSH_USEICONID = $0004;
PSH_PROPSHEETPAGE = $0008;
PSH_MULTILINETABS = $0010;
PSH_WIZARD = $0020;
PSH_USEPSTARTPAGE = $0040;
PSH_NOAPPLYNOW = $0080;
PSH_USECALLBACK = $0100;
PSH_HASHELP = $0200;
PSH_MODELESS = $0400;
PSCB_INITIALIZED = 1;
PSN_FIRST = -200;
PSN_LAST = -299;
PSN_SETACTIVE = PSN_FIRST - 0;
PSN_KILLACTIVE = PSN_FIRST - 1;
PSN_APPLY = PSN_FIRST - 2;
PSN_RESET = PSN_FIRST - 3;
PSN_HELP = PSN_FIRST - 5;
PSN_WIZBACK = PSN_FIRST - 6;
PSN_WIZNEXT = PSN_FIRST - 7;
PSN_WIZFINISH = PSN_FIRST - 8;
PSN_QUERYCANCEL = PSN_FIRST - 9;
PSNRET_NOERROR = 0;
PSNRET_INVALID = 1;
PSNRET_INVALID_NOCHANGEPAGE = 2;
PSM_SETCURSEL = WM_USER + 101;
PSM_REMOVEPAGE = WM_USER + 102;
PSM_ADDPAGE = WM_USER + 103;
PSM_CHANGED = WM_USER + 104;
PSM_RESTARTWINDOWS = WM_USER + 105;
PSM_REBOOTSYSTEM = WM_USER + 106;
PSM_CANCELTOCLOSE = WM_USER + 107;
PSM_QUERYSIBLINGS = WM_USER + 108;
PSM_UNCHANGED = WM_USER + 109;
PSM_APPLY = WM_USER + 110;
PSM_SETTITLE = WM_USER + 111;
PSM_SETTITLEW = WM_USER + 120;
PSM_SETWIZBUTTONS = WM_USER + 112;
PSM_PRESSBUTTON = WM_USER + 113;
PSM_SETCURSELID = WM_USER + 114;
PSM_SETFINISHTEXT = WM_USER + 115;
PSM_SETFINISHTEXTW = WM_USER + 121;
PSM_GETTABCONTROL = WM_USER + 116;
PSM_ISDIALOGMESSAGE = WM_USER + 117;
PSWIZB_BACK = $00000001;
PSWIZB_NEXT = $00000002;
PSWIZB_FINISH = $00000004;
PSWIZB_DISABLEDFINISH = $00000008;
PSBTN_BACK = 0;
PSBTN_NEXT = 1;
PSBTN_FINISH = 2;
PSBTN_OK = 3;
PSBTN_APPLYNOW = 4;
PSBTN_CANCEL = 5;
PSBTN_HELP = 6;
PSBTN_MAX = 6;
ID_PSRESTARTWINDOWS = 2;
ID_PSREBOOTSYSTEM = ID_PSRESTARTWINDOWS or 1;
WIZ_CXDLG = 276;
WIZ_CYDLG = 140;
WIZ_CXBMP = 80;
WIZ_BODYX = 92;
WIZ_BODYCX = 184;
PROP_SM_CXDLG = 212;
PROP_SM_CYDLG = 188;
PROP_MED_CXDLG = 227;
PROP_MED_CYDLG = 215;
PROP_LG_CXDLG = 252;
PROP_LG_CYDLG = 218;
type
HPropSheetPage = Pointer;
PPropSheetPageA = ^TPropSheetPageA;
PPropSheetPageW = ^TPropSheetPageW;
PPropSheetPage = PPropSheetPageA;
TFNPSPCallbackA = function(Wnd: HWnd; Msg: Integer;
PPSP: PPropSheetPageA): Integer stdcall;
TFNPSPCallbackW = function(Wnd: HWnd; Msg: Integer;
PPSP: PPropSheetPageW): Integer stdcall;
TFNPSPCallback = TFNPSPCallbackA;
_PROPSHEETPAGEA = record
dwSize: Longint;
dwFlags: Longint;
hInstance: THandle;
case Integer of
0: (
pszTemplate: PAnsiChar);
1: (
pResource: Pointer;
case Integer of
0: (
hIcon: THandle);
1: (
pszIcon: PAnsiChar;
pszTitle: PAnsiChar;
pfnDlgProc: Pointer;
lParam: Longint;
pfnCallback: TFNPSPCallbackA;
pcRefParent: PInteger));
end;
{$nonamespace _PROPSHEETPAGEA}
TPropSheetPageA = _PROPSHEETPAGEA;
_PROPSHEETPAGEW = record
dwSize: Longint;
dwFlags: Longint;
hInstance: THandle;
case Integer of
0: (
pszTemplate: PWideChar);
1: (
pResource: Pointer;
case Integer of
0: (
hIcon: THandle);
1: (
pszIcon: PWideChar;
pszTitle: PWideChar;
pfnDlgProc: Pointer;
lParam: Longint;
pfnCallback: TFNPSPCallbackW;
pcRefParent: PInteger));
end;
{$nonamespace _PROPSHEETPAGEW}
TPropSheetPageW = _PROPSHEETPAGEW;
TPropSheetPage = TPropSheetPageA;
TFNPropSheetCallback = function(Wnd: HWnd; Msg: Integer;
LParam: Integer): Integer stdcall;
PPropSheetHeaderA = ^TPropSheetHeaderA;
PPropSheetHeaderW = ^TPropSheetHeaderW;
PPropSheetHeader = PPropSheetHeaderA;
_PROPSHEETHEADERA = record
dwSize: Longint;
dwFlags: Longint;
hwndParent: HWnd;
hInstance: THandle;
case Integer of
0: (
hIcon: THandle);
1: (
pszIcon: PAnsiChar;
pszCaption: PAnsiChar;
nPages: Integer;
case Integer of
0: (
nStartPage: Integer);
1: (
pStartPage: PAnsiChar;
case Integer of
0: (
ppsp: PPropSheetPageA);
1: (
phpage: Pointer;
pfnCallback: TFNPropSheetCallback)));
end;
{$nonamespace _PROPSHEETHEADERA}
TPropSheetHeaderA = _PROPSHEETHEADERA;
_PROPSHEETHEADERW = record
dwSize: Longint;
dwFlags: Longint;
hwndParent: HWnd;
hInstance: THandle;
case Integer of
0: (
hIcon: THandle);
1: (
pszIcon: PWideChar;
pszCaption: PWideChar;
nPages: Integer;
case Integer of
0: (
nStartPage: Integer);
1: (
pStartPage: PWideChar;
case Integer of
0: (
ppsp: PPropSheetPageW);
1: (
phpage: Pointer;
pfnCallback: TFNPropSheetCallback)));
end;
{$nonamespace _PROPSHEETHEADERW}
TPropSheetHeaderW = _PROPSHEETHEADERW;
TPropSheetHeader = TPropSheetHeaderA;
TFNAddPropSheetPage = function(hPSP: HPropSheetPage;
lParam: Longint): BOOL stdcall;
function CreatePropertySheetPageA(var PSP: TPropSheetPageA): HPropSheetPage; stdcall;
function CreatePropertySheetPageW(var PSP: TPropSheetPageW): HPropSheetPage; stdcall;
function CreatePropertySheetPage(var PSP: TPropSheetPage): HPropSheetPage; stdcall;
function DestroyPropertySheetPage(hPSP: HPropSheetPage): BOOL; stdcall;
function PropertySheetA(var PSH: TPropSheetHeaderA): Integer; stdcall;
function PropertySheetW(var PSH: TPropSheetHeaderW): Integer; stdcall;
function PropertySheet(var PSH: TPropSheetHeader): Integer; stdcall;
procedure InitCommonControls; stdcall;
const
IMAGE_BITMAP = 0;
const
ODT_HEADER = 100;
ODT_TAB = 101;
ODT_LISTVIEW = 102;
{ ====== Ranges for control message IDs ======================= }
const
LVM_FIRST = $1000; { ListView messages }
TV_FIRST = $1100; { TreeView messages }
HDM_FIRST = $1200; { Header messages }
{ ====== WM_NOTIFY codes (NMHDR.code values) ================== }
const
NM_FIRST = 0- 0; { generic to all controls }
NM_LAST = 0- 99;
LVN_FIRST = 0-100; { listview }
LVN_LAST = 0-199;
HDN_FIRST = 0-300; { header }
HDN_LAST = 0-399;
TVN_FIRST = 0-400; { treeview }
TVN_LAST = 0-499;
TTN_FIRST = 0-520; { tooltips }
TTN_LAST = 0-549;
TCN_FIRST = 0-550; { tab control }
TCN_LAST = 0-580;
{ Shell reserved (0-580) - (0-589)
CDN_FIRST = 0-601; { common dialog (new) }
CDN_LAST = 0-699;
TBN_FIRST = 0-700; { toolbar }
TBN_LAST = 0-720;
UDN_FIRST = 0-721; { updown }
UDN_LAST = 0-740;
MSGF_COMMCTRL_BEGINDRAG = $4200;
MSGF_COMMCTRL_SIZEHEADER = $4201;
MSGF_COMMCTRL_DRAGSELECT = $4202;
MSGF_COMMCTRL_TOOLBARCUST = $4203;
{ ====== Generic WM_NOTIFY notification codes ================= }
const
NM_OUTOFMEMORY = NM_FIRST-1;
NM_CLICK = NM_FIRST-2;
NM_DBLCLK = NM_FIRST-3;
NM_RETURN = NM_FIRST-4;
NM_RCLICK = NM_FIRST-5;
NM_RDBLCLK = NM_FIRST-6;
NM_SETFOCUS = NM_FIRST-7;
NM_KILLFOCUS = NM_FIRST-8;
NM_STARTWAIT = NM_FIRST-9;
NM_ENDWAIT = NM_FIRST-10;
NM_BTNCLK = NM_FIRST-10;
{ ====== IMAGE LIST =========================================== }
const
CLR_NONE = $FFFFFFFF;
CLR_DEFAULT = $FF000000;
type
HImageList = THandle;
const
ILC_MASK = $0001;
ILC_COLOR = $00FE;
ILC_COLORDDB = $00FE;
ILC_COLOR4 = $0004;
ILC_COLOR8 = $0008;
ILC_COLOR16 = $0010;
ILC_COLOR24 = $0018;
ILC_COLOR32 = $0020;
ILC_PALETTE = $0800;
function ImageList_Create(CX, CY: Integer; Flags: UINT;
Initial, Grow: Integer): HImageList; stdcall;
function ImageList_Destroy(ImageList: HImageList): Bool; stdcall;
function ImageList_GetImageCount(ImageList: HImageList): Integer; stdcall;
function ImageList_Add(ImageList: HImageList; Image, Mask: HBitmap): Integer; stdcall;
function ImageList_ReplaceIcon(ImageList: HImageList; Index: Integer;
Icon: HIcon): Integer; stdcall;
function ImageList_SetBkColor(ImageList: HImageList; ClrBk: TColorRef): TColorRef; stdcall;
function ImageList_GetBkColor(ImageList: HImageList): TColorRef; stdcall;
function ImageList_SetOverlayImage(ImageList: HImageList; Image: Integer;
Overlay: Integer): Bool; stdcall;
function ImageList_AddIcon(ImageList: HImageList; Icon: HIcon): Integer;
const
ILD_NORMAL = $0000;
ILD_TRANSPARENT = $0001;
ILD_MASK = $0010;
ILD_IMAGE = $0020;
ILD_BLEND = $000E;
ILD_BLEND25 = $0002;
ILD_BLEND50 = $0004;
ILD_OVERLAYMASK = $0F00;
function IndexToOverlayMask(Index: Integer): Integer;
const
ILD_SELECTED = ILD_BLEND50;
ILD_FOCUS = ILD_BLEND25;
CLR_HILIGHT = CLR_DEFAULT;
function ImageList_Draw(ImageList: HImageList; Index: Integer;
Dest: HDC; X, Y: Integer; Style: UINT): Bool; stdcall;
function ImageList_Replace(ImageList: HImageList; Index: Integer;
Image, Mask: HBitmap): Bool; stdcall;
function ImageList_AddMasked(ImageList: HImageList; Image: HBitmap;
Mask: TColorRef): Integer; stdcall;
function ImageList_DrawEx(ImageList: HImageList; Index: Integer;
Dest: HDC; X, Y, DX, DY: Integer; Bk, Fg: TColorRef; Style: Cardinal): Bool; stdcall;
function ImageList_Remove(ImageList: HImageList; Index: Integer): Bool; stdcall;
function ImageList_GetIcon(ImageList: HImageList; Index: Integer;
Flags: Cardinal): HIcon; stdcall;
function ImageList_LoadImage(Instance: THandle; Bmp: LPCSTR; CX, Grow: Integer;
Mask: TColorRef; pType, Flags: Cardinal): HImageList; stdcall;
function ImageList_BeginDrag(ImageList: HImageList; Track: Integer;
XHotSpot, YHotSpot: Integer): Bool; stdcall;
function ImageList_EndDrag: Bool; stdcall;
function ImageList_DragEnter(LockWnd: HWnd; X, Y: Integer): Bool; stdcall;
function ImageList_DragLeave(LockWnd: HWnd): Bool; stdcall;
function ImageList_DragMove(X, Y: Integer): Bool; stdcall;
function ImageList_SetDragCursorImage(ImageList: HImageList; Drag: Integer;
XHotSpot, YHotSpot: Integer): Bool; stdcall;
function ImageList_DragShowNolock(Show: Bool): Bool; stdcall;
function ImageList_GetDragImage(Point, HotSpot: PPoint): HImageList; stdcall;
{ macros }
procedure ImageList_RemoveAll(ImageList: HImageList);
function ImageList_ExtractIcon(Instance: THandle; ImageList: HImageList;
Image: Integer): HIcon;
function ImageList_LoadBitmap(Instance: THandle; Bmp: PChar;
CX, Grow: Integer; MasK: TColorRef): HImageList;
type
PImageInfo = ^TImageInfo;
_IMAGEINFO = packed record
hbmImage: HBitmap;
hbmMask: HBitmap;
Unused1: Integer;
Unused2: Integer;
rcImage: TRect;
end;
{$nonamespace _IMAGEINFO}
TImageInfo = _IMAGEINFO;
function ImageList_GetIconSize(ImageList: HImageList; var CX, CY: Integer): Bool; stdcall;
function ImageList_SetIconSize(ImageList: HImageList; CX, CY: Integer): Bool; stdcall;
function ImageList_GetImageInfo(ImageList: HImageList; Index: Integer;
var ImageInfo: TImageInfo): Bool; stdcall;
function ImageList_Merge(ImageList1: HImageList; Index1: Integer;
ImageList2: HImageList; Index2: Integer; DX, DY: Integer): Bool; stdcall;
{ ====== HEADER CONTROL ========================== }
const
WC_HEADER = 'SysHeader32';
HDS_HORZ = $00000000;
HDS_BUTTONS = $00000002;
HDS_HIDDEN = $00000008;
type
PHDItemA = ^THDItemA;
PHDItemW = ^THDItemW;
PHDItem = PHDItemA;
_HD_ITEMA = packed record
Mask: Cardinal;
cxy: Integer;
pszText: PAnsiChar;
hbm: HBITMAP;
cchTextMax: Integer;
fmt: Integer;
lParam: LPARAM;
end;
{$nonamespace _HD_ITEMA}
THDItemA = _HD_ITEMA;
_HD_ITEMW = packed record
Mask: Cardinal;
cxy: Integer;
pszText: PWideChar;
hbm: HBITMAP;
cchTextMax: Integer;
fmt: Integer;
lParam: LPARAM;
end;
{$nonamespace _HD_ITEMW}
THDItemW = _HD_ITEMW;
THDItem = THDItemA;
const
HDI_WIDTH = $0001;
HDI_HEIGHT = HDI_WIDTH;
HDI_TEXT = $0002;
HDI_FORMAT = $0004;
HDI_LPARAM = $0008;
HDI_BITMAP = $0010;
HDF_LEFT = 0;
HDF_RIGHT = 1;
HDF_CENTER = 2;
HDF_JUSTIFYMASK = $0003;
HDF_OWNERDRAW = $8000;
HDF_STRING = $4000;
HDF_BITMAP = $2000;
HDM_GETITEMCOUNT = HDM_FIRST + 0;
function Header_GetItemCount(Header: HWnd): Integer;
const
HDM_INSERTITEMW = HDM_FIRST + 10;
HDM_INSERTITEMA = HDM_FIRST + 1;
HDM_INSERTITEM = HDM_INSERTITEMA;
function Header_InsertItem(Header: HWnd; Index: Integer;
const Item: THDItem): Integer;
const
HDM_DELETEITEM = HDM_FIRST + 2;
function Header_DeleteItem(Header: HWnd; Index: Integer): Bool;
const
HDM_GETITEMW = HDM_FIRST + 11;
HDM_GETITEMA = HDM_FIRST + 3;
HDM_GETITEM = HDM_GETITEMA;
function Header_GetItem(Header: HWnd; Index: Integer;
var Item: THDItem): Bool;
const
HDM_SETITEMA = HDM_FIRST + 4;
HDM_SETITEMW = HDM_FIRST + 12;
HDM_SETITEM = HDM_SETITEMA;
function Header_SetItem(Header: HWnd; Index: Integer; const Item: THDItem): Bool;
type
PHDLayout = ^THDLayout;
_HD_LAYOUT = packed record
Rect: ^TRect;
WindowPos: PWindowPos;
end;
{$nonamespace _HD_LAYOUT}
THDLayout = _HD_LAYOUT;
const
HDM_LAYOUT = HDM_FIRST + 5;
function Header_Layout(Header: HWnd; Layout: PHDLayout): Bool;
const
HHT_NOWHERE = $0001;
HHT_ONHEADER = $0002;
HHT_ONDIVIDER = $0004;
HHT_ONDIVOPEN = $0008;
HHT_ABOVE = $0100;
HHT_BELOW = $0200;
HHT_TORIGHT = $0400;
HHT_TOLEFT = $0800;
type
PHDHitTestInfo = ^THDHitTestInfo;
_HD_HITTESTINFO = packed record
Point: TPoint;
Flags: Cardinal;
Item: Integer;
end;
{$nonamespace _HD_HITTESTINFO}
THDHitTestInfo = _HD_HITTESTINFO;
const
HDM_HITTEST = HDM_FIRST + 6;
const
HDN_ITEMCHANGINGA = HDN_FIRST-0;
HDN_ITEMCHANGEDA = HDN_FIRST-1;
HDN_ITEMCLICKA = HDN_FIRST-2;
HDN_ITEMDBLCLICKA = HDN_FIRST-3;
HDN_DIVIDERDBLCLICKA = HDN_FIRST-5;
HDN_BEGINTRACKA = HDN_FIRST-6;
HDN_ENDTRACKA = HDN_FIRST-7;
HDN_TRACKA = HDN_FIRST-8;
HDN_ITEMCHANGINGW = HDN_FIRST-20;
HDN_ITEMCHANGEDW = HDN_FIRST-21;
HDN_ITEMCLICKW = HDN_FIRST-22;
HDN_ITEMDBLCLICKW = HDN_FIRST-23;
HDN_DIVIDERDBLCLICKW = HDN_FIRST-25;
HDN_BEGINTRACKW = HDN_FIRST-26;
HDN_ENDTRACKW = HDN_FIRST-27;
HDN_TRACKW = HDN_FIRST-28;
HDN_ITEMCHANGING = HDN_ITEMCHANGINGA;
HDN_ITEMCHANGED = HDN_ITEMCHANGEDA;
HDN_ITEMCLICK = HDN_ITEMCLICKA;
HDN_ITEMDBLCLICK = HDN_ITEMDBLCLICKA;
HDN_DIVIDERDBLCLICK = HDN_DIVIDERDBLCLICKA;
HDN_BEGINTRACK = HDN_BEGINTRACKA;
HDN_ENDTRACK = HDN_ENDTRACKA;
HDN_TRACK = HDN_TRACKA;
type
PHDNotifyA = ^THDNotifyA;
PHDNotifyW = ^THDNotifyW;
PHDNotify = PHDNotifyA;
_HD_NOTIFY = packed record
Hdr: TNMHDR;
Item: Integer;
Button: Integer;
PItem: PHDItemA;
end;
{$nonamespace _HD_NOTIFY}
THDNotifyA = _HD_NOTIFY;
_HD_NOTIFYW = packed record
Hdr: TNMHDR;
Item: Integer;
Button: Integer;
PItem: PHDItemW;
end;
{$nonamespace _HD_NOTIFYW}
THDNotifyW = _HD_NOTIFYW;
THDNotify = THDNotifyA;
{ ====== TOOLBAR CONTROL =================== }
const
TOOLBARCLASSNAME = 'ToolbarWindow32';
type
PTBButton = ^TTBButton;
_TBBUTTON = packed record
iBitmap: Integer;
idCommand: Integer;
fsState: Byte;
fsStyle: Byte;
bReserved: array[1..2] of Byte;
dwData: Longint;
iString: Integer;
end;
{$nonamespace _TBBUTTON}
TTBButton = _TBBUTTON;
PColorMap = ^TColorMap;
_COLORMAP = packed record
cFrom: TColorRef;
cTo: TColorRef;
end;
{$nonamespace _COLORMAP}
TColorMap = _COLORMAP;
function CreateToolBarEx(Wnd: HWnd; ws: Longint; ID: UINT;
Bitmaps: Integer; BMInst: THandle; BMID: Cardinal; Buttons: PTBButton;
NumButtons: Integer; dxButton, dyButton: Integer;
dxBitmap, dyBitmap: Integer; StructSize: UINT): HWnd; stdcall;
function CreateMappedBitmap(Instance: THandle; Bitmap: Integer;
Flags: UINT; ColorMap: PColorMap; NumMaps: Integer): HBitmap; stdcall;
const
CMB_MASKED = $02;
TBSTATE_CHECKED = $01;
TBSTATE_PRESSED = $02;
TBSTATE_ENABLED = $04;
TBSTATE_HIDDEN = $08;
TBSTATE_INDETERMINATE = $10;
TBSTATE_WRAP = $20;
TBSTYLE_BUTTON = $00;
TBSTYLE_SEP = $01;
TBSTYLE_CHECK = $02;
TBSTYLE_GROUP = $04;
TBSTYLE_CHECKGROUP = TBSTYLE_GROUP or TBSTYLE_CHECK;
TBSTYLE_TOOLTIPS = $0100;
TBSTYLE_WRAPABLE = $0200;
TBSTYLE_ALTDRAG = $0400;
TB_ENABLEBUTTON = WM_USER + 1;
TB_CHECKBUTTON = WM_USER + 2;
TB_PRESSBUTTON = WM_USER + 3;
TB_HIDEBUTTON = WM_USER + 4;
TB_INDETERMINATE = WM_USER + 5;
TB_ISBUTTONENABLED = WM_USER + 9;
TB_ISBUTTONCHECKED = WM_USER + 10;
TB_ISBUTTONPRESSED = WM_USER + 11;
TB_ISBUTTONHIDDEN = WM_USER + 12;
TB_ISBUTTONINDETERMINATE = WM_USER + 13;
TB_SETSTATE = WM_USER + 17;
TB_GETSTATE = WM_USER + 18;
TB_ADDBITMAP = WM_USER + 19;
type
PTBAddBitmap = ^TTBAddBitmap;
tagTBADDBITMAP = packed record
hInst: THandle;
nID: UINT;
end;
{$nonamespace tagTBADDBITMAP}
TTBAddBitmap = tagTBADDBITMAP;
const
HINST_COMMCTRL = THandle(-1);
IDB_STD_SMALL_COLOR = 0;
IDB_STD_LARGE_COLOR = 1;
IDB_VIEW_SMALL_COLOR = 4;
IDB_VIEW_LARGE_COLOR = 5;
{ icon indexes for standard bitmap }
STD_CUT = 0;
STD_COPY = 1;
STD_PASTE = 2;
STD_UNDO = 3;
STD_REDOW = 4;
STD_DELETE = 5;
STD_FILENEW = 6;
STD_FILEOPEN = 7;
STD_FILESAVE = 8;
STD_PRINTPRE = 9;
STD_PROPERTIES = 10;
STD_HELP = 11;
STD_FIND = 12;
STD_REPLACE = 13;
STD_PRINT = 14;
{ icon indexes for standard view bitmap }
VIEW_LARGEICONS = 0;
VIEW_SMALLICONS = 1;
VIEW_LIST = 2;
VIEW_DETAILS = 3;
VIEW_SORTNAME = 4;
VIEW_SORTSIZE = 5;
VIEW_SORTDATE = 6;
VIEW_SORTTYPE = 7;
VIEW_PARENTFOLDER = 8;
VIEW_NETCONNECT = 9;
VIEW_NETDISCONNECT = 10;
VIEW_NEWFOLDER = 11;
TB_ADDBUTTONS = WM_USER + 20;
TB_INSERTBUTTON = WM_USER + 21;
TB_DELETEBUTTON = WM_USER + 22;
TB_GETBUTTON = WM_USER + 23;
TB_BUTTONCOUNT = WM_USER + 24;
TB_COMMANDTOINDEX = WM_USER + 25;
type
PTBSaveParamsA = ^TTBSaveParamsA;
PTBSaveParamsW = ^TTBSaveParamsW;
PTBSaveParams = PTBSaveParamsA;
tagTBSAVEPARAMSA = packed record
hkr: THandle;
pszSubKey: PAnsiChar;
pszValueName: PAnsiChar;
end;
{$nonamespace tagTBSAVEPARAMSA}
TTBSaveParamsA = tagTBSAVEPARAMSA;
tagTBSAVEPARAMSW = packed record
hkr: THandle;
pszSubKey: PWideChar;
pszValueName: PWideChar;
end;
{$nonamespace tagTBSAVEPARAMSW}
TTBSaveParamsW = tagTBSAVEPARAMSW;
TTBSaveParams = TTBSaveParamsA;
const
TB_SAVERESTOREA = WM_USER + 26;
TB_ADDSTRINGA = WM_USER + 28;
TB_GETBUTTONTEXTA = WM_USER + 45;
TBN_GETBUTTONINFOA = TBN_FIRST-0;
TB_SAVERESTOREW = WM_USER + 47;
TB_ADDSTRINGW = WM_USER + 48;
TB_GETBUTTONTEXTW = WM_USER + 46;
TBN_GETBUTTONINFOW = TBN_FIRST-20;
TB_SAVERESTORE = TB_SAVERESTOREA;
TB_ADDSTRING = TB_ADDSTRINGA;
TB_GETBUTTONTEXT = TB_GETBUTTONTEXTA;
TBN_GETBUTTONINFO = TBN_GETBUTTONINFOA;
TB_CUSTOMIZE = WM_USER + 27;
TB_GETITEMRECT = WM_USER + 29;
TB_BUTTONSTRUCTSIZE = WM_USER + 30;
TB_SETBUTTONSIZE = WM_USER + 31;
TB_SETBITMAPSIZE = WM_USER + 32;
TB_AUTOSIZE = WM_USER + 33;
TB_SETBUTTONTYPE = WM_USER + 34;
TB_GETTOOLTIPS = WM_USER + 35;
TB_SETTOOLTIPS = WM_USER + 36;
TB_SETPARENT = WM_USER + 37;
TB_SETROWS = WM_USER + 39;
TB_GETROWS = WM_USER + 40;
TB_SETCMDID = WM_USER + 42;
TB_CHANGEBITMAP = WM_USER + 43;
TB_GETBITMAP = WM_USER + 44;
TB_GETBITMAPFLAGS = WM_USER + 41;
TBN_BEGINDRAG = TBN_FIRST-1;
TBN_ENDDRAG = TBN_FIRST-2;
TBN_BEGINADJUST = TBN_FIRST-3;
TBN_ENDADJUST = TBN_FIRST-4;
TBN_RESET = TBN_FIRST-5;
TBN_QUERYINSERT = TBN_FIRST-6;
TBN_QUERYDELETE = TBN_FIRST-7;
TBN_TOOLBARCHANGE = TBN_FIRST-8;
TBN_CUSTHELP = TBN_FIRST-9;
TBBF_LARGE = $0001;
type
PTBNotifyA = ^TTBNotifyA;
PTBNotifyW = ^TTBNotifyW;
PTBNotify = PTBNotifyA;
tagTBNOTIFYA = packed record
hdr: TNMHdr;
iItem: Integer;
tbButton: TTBButton;
cchText: Integer;
pszText: PAnsiChar;
end;
{$nonamespace tagTBNOTIFYA}
TTBNotifyA = tagTBNOTIFYA;
tagTBNOTIFYW = packed record
hdr: TNMHdr;
iItem: Integer;
tbButton: TTBButton;
cchText: Integer;
pszText: PWideChar;
end;
{$nonamespace tagTBNOTIFYW}
TTBNotifyW = tagTBNOTIFYW;
TTBNotify = TTBNotifyA;
{ ====== TOOLTIPS CONTROL ========================== }
const
TOOTIPS_CLASS = 'tooltips_class32';
type
PToolInfoA = ^TToolInfoA;
PToolInfoW = ^TToolInfoW;
PToolInfo = PToolInfoA;
tagTOOLINFOA = packed record
cbSize: UINT;
uFlags: UINT;
hwnd: HWND;
uId: UINT;
Rect: TRect;
hInst: THandle;
lpszText: PAnsiChar;
end;
{$nonamespace tagTOOLINFOA}
TToolInfoA = tagTOOLINFOA;
tagTOOLINFOW = packed record
cbSize: UINT;
uFlags: UINT;
hwnd: HWND;
uId: UINT;
Rect: TRect;
hInst: THandle;
lpszText: PWideChar;
end;
{$nonamespace tagTOOLINFOW}
TToolInfoW = tagTOOLINFOW;
TToolInfo = TToolInfoA;
const
TTS_ALWAYSTIP = $01;
TTS_NOPREFIX = $02;
TTF_IDISHWND = $01;
TTF_CENTERTIP = $02;
TTDT_AUTOMATIC = 0;
TTDT_RESHOW = 1;
TTDT_AUTOPOP = 2;
TTDT_INITIAL = 3;
TTM_ACTIVATE = WM_USER + 1;
TTM_SETDELAYTIME = WM_USER + 3;
TTM_ADDTOOLA = WM_USER + 4;
TTM_DELTOOLA = WM_USER + 5;
TTM_NEWTOOLRECTA = WM_USER + 6;
TTM_GETTOOLINFOA = WM_USER + 8;
TTM_SETTOOLINFOA = WM_USER + 9;
TTM_HITTESTA = WM_USER + 10;
TTM_GETTEXTA = WM_USER + 11;
TTM_UPDATETIPTEXTA = WM_USER + 12;
TTM_ENUMTOOLSA = WM_USER + 14;
TTM_GETCURRENTTOOLA = WM_USER + 15;
TTM_ADDTOOLW = WM_USER + 50;
TTM_DELTOOLW = WM_USER + 51;
TTM_NEWTOOLRECTW = WM_USER + 52;
TTM_GETTOOLINFOW = WM_USER + 53;
TTM_SETTOOLINFOW = WM_USER + 54;
TTM_HITTESTW = WM_USER + 55;
TTM_GETTEXTW = WM_USER + 56;
TTM_UPDATETIPTEXTW = WM_USER + 57;
TTM_ENUMTOOLSW = WM_USER + 58;
TTM_GETCURRENTTOOLW = WM_USER + 59;
TTM_ADDTOOL = TTM_ADDTOOLA;
TTM_DELTOOL = TTM_DELTOOLA;
TTM_NEWTOOLRECT = TTM_NEWTOOLRECTA;
TTM_GETTOOLINFO = TTM_GETTOOLINFOA;
TTM_SETTOOLINFO = TTM_SETTOOLINFOA;
TTM_HITTEST = TTM_HITTESTA;
TTM_GETTEXT = TTM_GETTEXTA;
TTM_UPDATETIPTEXT = TTM_UPDATETIPTEXTA;
TTM_ENUMTOOLS = TTM_ENUMTOOLSA;
TTM_GETCURRENTTOOL = TTM_GETCURRENTTOOLA;
TTM_RELAYEVENT = WM_USER + 7;
TTM_GETTOOLCOUNT = WM_USER +13;
type
PTTHitTestInfoA = ^TTTHitTestInfoA;
PTTHitTestInfoW = ^TTTHitTestInfoW;
PTTHitTestInfo = PTTHitTestInfoA;
_TT_HITTESTINFOA = packed record
hwnd: HWND;
pt: TPoint;
ti: TToolInfoA;
end;
{$nonamespace _TT_HITTESTINFOA}
TTTHitTestInfoA = _TT_HITTESTINFOA;
_TT_HITTESTINFOW = packed record
hwnd: HWND;
pt: TPoint;
ti: TToolInfoW;
end;
{$nonamespace _TT_HITTESTINFOW}
TTTHitTestInfoW = _TT_HITTESTINFOW;
TTTHitTestInfo = TTTHitTestInfoA;
const
TTN_NEEDTEXTA = TTN_FIRST - 0;
TTN_NEEDTEXTW = TTN_FIRST - 10;
TTN_NEEDTEXT = TTN_NEEDTEXTA;
TTN_SHOW = TTN_FIRST - 1;
TTN_POP = TTN_FIRST - 2;
type
PToolTipTextA = ^TToolTipTextA;
tagTOOLTIPTEXTA = packed record
hdr: TNMHDR;
lpszText: LPSTR;
szText: array[0..79] of Char;
hinst: THandle;
uFlags: UINT;
end;
{$nonamespace tagTOOLTIPTEXTA}
TToolTipTextA = tagTOOLTIPTEXTA;
PToolTipTextW = ^TToolTipTextW;
tagTOOLTIPTEXTW = packed record
hdr: TNMHDR;
lpszText: LPWSTR;
szText: array[0..79] of WideChar;
hinst: THandle;
uFlags: UINT;
end;
{$nonamespace tagTOOLTIPTEXTW}
TToolTipTextW = tagTOOLTIPTEXTW;
{ ====== STATUS BAR CONTROL ================= }
const
SBARS_SIZEGRIP = $0100;
procedure DrawStatusTextA(hDC: HDC; lprc: PRect; pzsText: PAnsiChar;
uFlags: UINT); stdcall;
procedure DrawStatusTextW(hDC: HDC; lprc: PRect; pzsText: PWideChar;
uFlags: UINT); stdcall;
procedure DrawStatusText(hDC: HDC; lprc: PRect; pzsText: PChar;
uFlags: UINT); stdcall;
function CreateStatusWindowA(Style: Longint; lpszText: PAnsiChar;
hwndParent: HWND; wID: UINT): HWND; stdcall;
function CreateStatusWindowW(Style: Longint; lpszText: PWideChar;
hwndParent: HWND; wID: UINT): HWND; stdcall;
function CreateStatusWindow(Style: Longint; lpszText: PChar;
hwndParent: HWND; wID: UINT): HWND; stdcall;
const
STATUSCLASSNAME = 'msctls_statusbar32';
const
SB_SETTEXTA = WM_USER+1;
SB_GETTEXTA = WM_USER+2;
SB_GETTEXTLENGTHA = WM_USER+3;
SB_SETTEXTW = WM_USER+11;
SB_GETTEXTW = WM_USER+13;
SB_GETTEXTLENGTHW = WM_USER+12;
SB_SETTEXT = SB_SETTEXTA;
SB_GETTEXT = SB_GETTEXTA;
SB_GETTEXTLENGTH = SB_GETTEXTLENGTHA;
SB_SETPARTS = WM_USER+4;
SB_GETPARTS = WM_USER+6;
SB_GETBORDERS = WM_USER+7;
SB_SETMINHEIGHT = WM_USER+8;
SB_SIMPLE = WM_USER+9;
SB_GETRECT = WM_USER + 10;
SBT_OWNERDRAW = $1000;
SBT_NOBORDERS = $0100;
SBT_POPOUT = $0200;
HBT_SPRING = $0400;
{ ====== MENU HELP ========================== }
procedure MenuHelp(Msg: UINT; wParam: WPARAM; lParam: LPARAM;
hMainMenu: HMENU; hInst: THandle; hwndStatus: HWND; lpwIDs: PUINT); stdcall;
function ShowHideMenuCtl(hWnd: HWND; uFlags: UINT; lpInfo: PINT): Bool; stdcall;
procedure GetEffectiveClientRect(hWnd: HWND; lprc: PRect; lpInfo: PINT); stdcall;
const
MINSYSCOMMAND = SC_SIZE;
{ ====== TRACKBAR CONTROL =================== }
TRACKBAR_CLASS = 'msctls_trackbar32';
const
TBS_AUTOTICKS = $0001;
TBS_VERT = $0002;
TBS_HORZ = $0000;
TBS_TOP = $0004;
TBS_BOTTOM = $0000;
TBS_LEFT = $0004;
TBS_RIGHT = $0000;
TBS_BOTH = $0008;
TBS_NOTICKS = $0010;
TBS_ENABLESELRANGE = $0020;
TBS_FIXEDLENGTH = $0040;
TBS_NOTHUMB = $0080;
TBM_GETPOS = WM_USER;
TBM_GETRANGEMIN = WM_USER+1;
TBM_GETRANGEMAX = WM_USER+2;
TBM_GETTIC = WM_USER+3;
TBM_SETTIC = WM_USER+4;
TBM_SETPOS = WM_USER+5;
TBM_SETRANGE = WM_USER+6;
TBM_SETRANGEMIN = WM_USER+7;
TBM_SETRANGEMAX = WM_USER+8;
TBM_CLEARTICS = WM_USER+9;
TBM_SETSEL = WM_USER+10;
TBM_SETSELSTART = WM_USER+11;
TBM_SETSELEND = WM_USER+12;
TBM_GETPTICS = WM_USER+14;
TBM_GETTICPOS = WM_USER+15;
TBM_GETNUMTICS = WM_USER+16;
TBM_GETSELSTART = WM_USER+17;
TBM_GETSELEND = WM_USER+18;
TBM_CLEARSEL = WM_USER+19;
TBM_SETTICFREQ = WM_USER+20;
TBM_SETPAGESIZE = WM_USER+21;
TBM_GETPAGESIZE = WM_USER+22;
TBM_SETLINESIZE = WM_USER+23;
TBM_GETLINESIZE = WM_USER+24;
TBM_GETTHUMBRECT = WM_USER+25;
TBM_GETCHANNELRECT = WM_USER+26;
TBM_SETTHUMBLENGTH = WM_USER+27;
TBM_GETTHUMBLENGTH = WM_USER+28;
TB_LINEUP = 0;
TB_LINEDOWN = 1;
TB_PAGEUP = 2;
TB_PAGEDOWN = 3;
TB_THUMBPOSITION = 4;
TB_THUMBTRACK = 5;
TB_TOP = 6;
TB_BOTTOM = 7;
TB_ENDTRACK = 8;
{ ====== DRAG LIST CONTROL ================== }
type
PDragListInfo = ^TDragListInfo;
tagDRAGLISTINFO = packed record
uNotification: UINT;
hWnd: HWND;
ptCursor: TPoint;
end;
{$nonamespace tagDRAGLISTINFO}
TDragListInfo = tagDRAGLISTINFO;
const
DL_BEGINDRAG = WM_USER+133;
DL_DRAGGING = WM_USER+134;
DL_DROPPED = WM_USER+135;
DL_CANCELDRAG = WM_USER+136;
DL_CURSORSET = 0;
DL_STOPCURSOR = 1;
DL_COPYCURSOR = 2;
DL_MOVECURSOR = 3;
const
DRAGLISTMSGSTRING = 'commctrl_DragListMsg';
procedure MakeDragList(hLB: HWND); stdcall;
procedure DrawInsert(hwndParent: HWND; hLB: HWND; nItem: Integer); stdcall;
function LBItemFromPt(hLB: HWND; pt: TPoint; bAutoScroll: Bool): Integer; stdcall;
{ ====== UPDOWN CONTROL ========================== }
const
UPDOWN_CLASS = 'msctls_updown32';
type
PUDAccel = ^TUDAccel;
_UDACCEL = packed record
nSec: UINT;
nInc: UINT;
end;
{$nonamespace _UDACCEL}
TUDAccel = _UDACCEL;
const
UD_MAXVAL = $7fff;
UD_MINVAL = -UD_MAXVAL;
UDS_WRAP = $0001;
UDS_SETBUDDYINT = $0002;
UDS_ALIGNRIGHT = $0004;
UDS_ALIGNLEFT = $0008;
UDS_AUTOBUDDY = $0010;
UDS_ARROWKEYS = $0020;
UDS_HORZ = $0040;
UDS_NOTHOUSANDS = $0080;
UDM_SETRANGE = WM_USER+101;
UDM_GETRANGE = WM_USER+102;
UDM_SETPOS = WM_USER+103;
UDM_GETPOS = WM_USER+104;
UDM_SETBUDDY = WM_USER+105;
UDM_GETBUDDY = WM_USER+106;
UDM_SETACCEL = WM_USER+107;
UDM_GETACCEL = WM_USER+108;
UDM_SETBASE = WM_USER+109;
UDM_GETBASE = WM_USER+110;
function CreateUpDownControl(dwStyle: Longint; X, Y, CX, CY: Integer;
hParent: HWND; nID: Integer; hInst: THandle; hBuddy: HWND;
nUpper, nLower, nPos: Integer): HWND; stdcall;
type
PNMUpDown = ^TNMUpDown;
_NM_UPDOWN = packed record
hdr: TNMHDR;
iPos: Integer;
iDelta: Integer;
end;
{$nonamespace _NM_UPDOWN}
TNMUpDown = _NM_UPDOWN;
const
UDN_DELTAPOS = UDN_FIRST - 1;
{ ====== PROGRESS CONTROL ========================= }
const
PROGRESS_CLASS = 'msctls_progress32';
const
PBM_SETRANGE = WM_USER+1;
PBM_SETPOS = WM_USER+2;
PBM_DELTAPOS = WM_USER+3;
PBM_SETSTEP = WM_USER+4;
PBM_STEPIT = WM_USER+5;
{ ====== HOTKEY CONTROL ========================== }
const
HOTKEYF_SHIFT = $01;
HOTKEYF_CONTROL = $02;
HOTKEYF_ALT = $04;
HOTKEYF_EXT = $08;
HKCOMB_NONE = $0001;
HKCOMB_S = $0002;
HKCOMB_C = $0004;
HKCOMB_A = $0008;
HKCOMB_SC = $0010;
HKCOMB_SA = $0020;
HKCOMB_CA = $0040;
HKCOMB_SCA = $0080;
HKM_SETHOTKEY = WM_USER+1;
HKM_GETHOTKEY = WM_USER+2;
HKM_SETRULES = WM_USER+3;
const
HOTKEYCLASS = 'msctls_hotkey32';
{ ====== COMMON CONTROL STYLES ================ }
const
CCS_TOP = $00000001;
CCS_NOMOVEY = $00000002;
CCS_BOTTOM = $00000003;
CCS_NORESIZE = $00000004;
CCS_NOPARENTALIGN = $00000008;
CCS_NOHILITE = $00000010;
CCS_ADJUSTABLE = $00000020;
CCS_NODIVIDER = $00000040;
{ ====== LISTVIEW CONTROL ====================== }
const
WC_LISTVIEW = 'SysListView32';
const
LVS_ICON = $0000;
LVS_REPORT = $0001;
LVS_SMALLICON = $0002;
LVS_LIST = $0003;
LVS_TYPEMASK = $0003;
LVS_SINGLESEL = $0004;
LVS_SHOWSELALWAYS = $0008;
LVS_SORTASCENDING = $0010;
LVS_SORTDESCENDING = $0020;
LVS_SHAREIMAGELISTS = $0040;
LVS_NOLABELWRAP = $0080;
LVS_AUTOARRANGE = $0100;
LVS_EDITLABELS = $0200;
LVS_NOSCROLL = $2000;
LVS_TYPESTYLEMASK = $FC00;
LVS_ALIGNTOP = $0000;
LVS_ALIGNLEFT = $0800;
LVS_ALIGNMASK = $0c00;
LVS_OWNERDRAWFIXED = $0400;
LVS_NOCOLUMNHEADER = $4000;
LVS_NOSORTHEADER = $8000;
const
LVM_GETBKCOLOR = LVM_FIRST + 0;
function ListView_GetBkColor(hWnd: HWND): TColorRef;
const
LVM_SETBKCOLOR = LVM_FIRST + 1;
function ListView_SetBkColor(hWnd: HWND; clrBk: TColorRef): Bool;
const
LVM_GETIMAGELIST = LVM_FIRST + 2;
function ListView_GetImageList(hWnd: HWND; iImageList: Integer): HImageList;
const
LVSIL_NORMAL = 0;
LVSIL_SMALL = 1;
LVSIL_STATE = 2;
const
LVM_SETIMAGELIST = LVM_FIRST + 3;
function ListView_SetImageList(hWnd: HWND; himl: HImageList;
iImageList: Integer): HImageList;
const
LVM_GETITEMCOUNT = LVM_FIRST + 4;
function ListView_GetItemCount(hWnd: HWND): Integer;
const
LVIF_TEXT = $0001;
LVIF_IMAGE = $0002;
LVIF_PARAM = $0004;
LVIF_STATE = $0008;
LVIS_FOCUSED = $0001;
LVIS_SELECTED = $0002;
LVIS_CUT = $0004;
LVIS_DROPHILITED = $0008;
LVIS_LINK = $0040;
LVIS_OVERLAYMASK = $0F00;
LVIS_STATEIMAGEMASK = $F000;
function IndexToStateImageMask(I: Longint): Longint;
type
PLVItemA = ^TLVItemA;
PLVItemW = ^TLVItemW;
PLVItem = PLVItemA;
_LV_ITEMA = packed record
mask: UINT;
iItem: Integer;
iSubItem: Integer;
state: UINT;
stateMask: UINT;
pszText: PAnsiChar;
cchTextMax: Integer;
iImage: Integer;
lParam: LPARAM;
end;
{$nonamespace _LV_ITEMA}
TLVItemA = _LV_ITEMA;
_LV_ITEMW = packed record
mask: UINT;
iItem: Integer;
iSubItem: Integer;
state: UINT;
stateMask: UINT;
pszText: PWideChar;
cchTextMax: Integer;
iImage: Integer;
lParam: LPARAM;
end;
{$nonamespace _LV_ITEMW}
TLVItemW = _LV_ITEMW;
TLVItem = TLVItemA;
const
LPSTR_TEXTCALLBACKA = LPSTR(-1);
LPSTR_TEXTCALLBACKW = LPWSTR(-1);
LPSTR_TEXTCALLBACK = LPSTR_TEXTCALLBACKA;
I_IMAGECALLBACK = -1;
const
LVM_GETITEMA = LVM_FIRST + 5;
LVM_SETITEMA = LVM_FIRST + 6;
LVM_INSERTITEMA = LVM_FIRST + 7;
LVM_GETITEMW = LVM_FIRST + 75;
LVM_SETITEMW = LVM_FIRST + 76;
LVM_INSERTITEMW = LVM_FIRST + 77;
LVM_GETITEM = LVM_GETITEMA;
LVM_SETITEM = LVM_SETITEMA;
LVM_INSERTITEM = LVM_INSERTITEMA;
LVM_DELETEITEM = LVM_FIRST + 8;
LVM_DELETEALLITEMS = LVM_FIRST + 9;
LVM_GETCALLBACKMASK = LVM_FIRST + 10;
LVM_SETCALLBACKMASK = LVM_FIRST + 11;
function ListView_GetItemA(hWnd: HWND; var pItem: TLVItemA): Bool;
function ListView_GetItemW(hWnd: HWND; var pItem: TLVItemW): Bool;
function ListView_GetItem(hWnd: HWND; var pItem: TLVItem): Bool;
function ListView_SetItemA(hWnd: HWND; const pItem: TLVItemA): Bool;
function ListView_SetItemW(hWnd: HWND; const pItem: TLVItemW): Bool;
function ListView_SetItem(hWnd: HWND; const pItem: TLVItem): Bool;
function ListView_InsertItemA(hWnd: HWND; const pItem: TLVItemA): Integer;
function ListView_InsertItemW(hWnd: HWND; const pItem: TLVItemW): Integer;
function ListView_InsertItem(hWnd: HWND; const pItem: TLVItem): Integer;
function ListView_DeleteItem(hWnd: HWND; i: Integer): Bool;
function ListView_DeleteAllItems(hWnd: HWND): Bool;
function ListView_GetCallbackMask(hWnd: HWND): UINT;
function ListView_SetCallbackMask(hWnd: HWND; mask: UINT): Bool;
const
LVNI_ALL = $0000;
LVNI_FOCUSED = $0001;
LVNI_SELECTED = $0002;
LVNI_CUT = $0004;
LVNI_DROPHILITED = $0008;
LVNI_PREVIOUS = $0020;
LVNI_ABOVE = $0100;
LVNI_BELOW = $0200;
LVNI_TOLEFT = $0400;
LVNI_TORIGHT = $0800;
const
LVM_GETNEXTITEM = LVM_FIRST + 12;
function ListView_GetNextItem(hWnd: HWND; iStart: Integer; Flags: UINT): Integer;
const
LVFI_PARAM = $0001;
LVFI_STRING = $0002;
LVFI_PARTIAL = $0008;
LVFI_WRAP = $0020;
LVFI_NEARESTXY = $0040;
type
PLVFindInfoA = ^TLVFindInfoA;
PLVFindInfoW = ^TLVFindInfoW;
PLVFindInfo = PLVFindInfoA;
_LV_FINDINFOA = packed record
flags: UINT;
psz: PAnsiChar;
lParam: LPARAM;
pt: TPoint;
vkDirection: UINT;
end;
{$nonamespace _LV_FINDINFOA}
TLVFindInfoA = _LV_FINDINFOA;
_LV_FINDINFOW = packed record
flags: UINT;
psz: PWideChar;
lParam: LPARAM;
pt: TPoint;
vkDirection: UINT;
end;
{$nonamespace _LV_FINDINFOW}
TLVFindInfoW = _LV_FINDINFOW;
TLVFindInfo = TLVFindInfoA;
const
LVM_FINDITEMA = LVM_FIRST + 13;
LVM_FINDITEMW = LVM_FIRST + 83;
LVM_FINDITEM = LVM_FINDITEMA;
function ListView_FindItemA(hWnd: HWND; iStart: Integer;
const plvfi: TLVFindInfoA): Integer;
function ListView_FindItemW(hWnd: HWND; iStart: Integer;
const plvfi: TLVFindInfoW): Integer;
function ListView_FindItem(hWnd: HWND; iStart: Integer;
const plvfi: TLVFindInfo): Integer;
const
LVIR_BOUNDS = 0;
LVIR_ICON = 1;
LVIR_LABEL = 2;
LVIR_SELECTBOUNDS = 3;
const
LVM_GETITEMRECT = LVM_FIRST + 14;
function ListView_GetItemRect(hWnd: HWND; i: Integer; var prc: TRect;
Code: Integer): Bool;
const
LVM_SETITEMPOSITION = LVM_FIRST + 15;
function ListView_SetItemPosition(hWnd: HWND; i, x, y: Integer): Bool;
const
LVM_GETITEMPOSITION = LVM_FIRST + 16;
function ListView_GetItemPosition(hwndLV: HWND; i: Integer; var ppt: TPoint): Bool;
const
LVM_GETSTRINGWIDTHA = LVM_FIRST + 17;
LVM_GETSTRINGWIDTHW = LVM_FIRST + 87;
LVM_GETSTRINGWIDTH = LVM_GETSTRINGWIDTHA;
function ListView_GetStringWidthA(hwndLV: HWND; psz: PAnsiChar): Integer;
function ListView_GetStringWidthW(hwndLV: HWND; psz: PWideChar): Integer;
function ListView_GetStringWidth(hwndLV: HWND; psz: PChar): Integer;
const
LVHT_NOWHERE = $0001;
LVHT_ONITEMICON = $0002;
LVHT_ONITEMLABEL = $0004;
LVHT_ONITEMSTATEICON = $0008;
LVHT_ONITEM = LVHT_ONITEMICON or LVHT_ONITEMLABEL or
LVHT_ONITEMSTATEICON;
LVHT_ABOVE = $0008;
LVHT_BELOW = $0010;
LVHT_TORIGHT = $0020;
LVHT_TOLEFT = $0040;
type
PLVHitTestInfo = ^TLVHitTestInfo;
_LV_HITTESTINFO = packed record
pt: TPoint;
flags: UINT;
iItem: Integer;
end;
{$nonamespace _LV_HITTESTINFO}
TLVHitTestInfo = _LV_HITTESTINFO;
const
LVM_HITTEST = LVM_FIRST + 18;
function ListView_HitTest(hwndLV: HWND; var pinfo: TLVHitTestInfo): Integer;
const
LVM_ENSUREVISIBLE = LVM_FIRST + 19;
function ListView_EnsureVisible(hwndLV: HWND; i: Integer; fPartialOK: Bool): Bool;
const
LVM_SCROLL = LVM_FIRST + 20;
function ListView_Scroll(hwndLV: HWnd; DX, DY: Integer): Bool;
const
LVM_REDRAWITEMS = LVM_FIRST + 21;
function ListView_RedrawItems(hwndLV: HWND; iFirst, iLast: Integer): Bool;
const
LVA_DEFAULT = $0000;
LVA_ALIGNLEFT = $0001;
LVA_ALIGNTOP = $0002;
LVA_ALIGNRIGHT = $0003;
LVA_ALIGNBOTTOM = $0004;
LVA_SNAPTOGRID = $0005;
LVA_SORTASCENDING = $0100;
LVA_SORTDESCENDING = $0200;
const
LVM_ARRANGE = LVM_FIRST + 22;
function ListView_Arrange(hwndLV: HWND; Code: UINT): Bool;
const
LVM_EDITLABELA = LVM_FIRST + 23;
LVM_EDITLABELW = LVM_FIRST + 118;
LVM_EDITLABEL = LVM_EDITLABELA;
function ListView_EditLabelA(hwndLV: HWND; i: Integer): HWND;
function ListView_EditLabelW(hwndLV: HWND; i: Integer): HWND;
function ListView_EditLabel(hwndLV: HWND; i: Integer): HWND;
const
LVM_GETEDITCONTROL = LVM_FIRST + 24;
function ListView_GetEditControl(hwndLV: HWND): HWND;
type
PLVColumnA = ^TLVColumnA;
PLVColumnW = ^TLVColumnW;
PLVColumn = PLVColumnA;
_LV_COLUMNA = packed record
mask: UINT;
fmt: Integer;
cx: Integer;
pszText: PAnsiChar;
cchTextMax: Integer;
iSubItem: Integer;
end;
{$nonamespace _LV_COLUMNA}
TLVColumnA = _LV_COLUMNA;
_LV_COLUMNW = packed record
mask: UINT;
fmt: Integer;
cx: Integer;
pszText: PWideChar;
cchTextMax: Integer;
iSubItem: Integer;
end;
{$nonamespace _LV_COLUMNW}
TLVColumnW = _LV_COLUMNW;
TLVColumn = TLVColumnA;
const
LVCF_FMT = $0001;
LVCF_WIDTH = $0002;
LVCF_TEXT = $0004;
LVCF_SUBITEM = $0008;
LVCFMT_LEFT = 0;
LVCFMT_RIGHT = 1;
LVCFMT_CENTER = 2;
LVCFMT_JUSTIFYMASK = 3;
LVM_GETCOLUMNA = LVM_FIRST + 25;
LVM_GETCOLUMNW = LVM_FIRST + 95;
LVM_GETCOLUMN = LVM_GETCOLUMNA;
function ListView_GetColumnA(hwnd: HWND; iCol: Integer;
var pcol: TLVColumnA): Bool;
function ListView_GetColumnW(hwnd: HWND; iCol: Integer;
var pcol: TLVColumnW): Bool;
function ListView_GetColumn(hwnd: HWND; iCol: Integer;
var pcol: TLVColumn): Bool;
const
LVM_SETCOLUMNA = LVM_FIRST + 26;
LVM_SETCOLUMNW = LVM_FIRST + 96;
LVM_SETCOLUMN = LVM_SETCOLUMNA;
function ListView_SetColumnA(hwnd: HWnd; iCol: Integer; const pcol: TLVColumnA): Bool;
function ListView_SetColumnW(hwnd: HWnd; iCol: Integer; const pcol: TLVColumnW): Bool;
function ListView_SetColumn(hwnd: HWnd; iCol: Integer; const pcol: TLVColumn): Bool;
const
LVM_INSERTCOLUMNA = LVM_FIRST + 27;
LVM_INSERTCOLUMNW = LVM_FIRST + 97;
LVM_INSERTCOLUMN = LVM_INSERTCOLUMNA;
function ListView_InsertColumnA(hwnd: HWND; iCol: Integer;
const pcol: TLVColumnA): Integer;
function ListView_InsertColumnW(hwnd: HWND; iCol: Integer;
const pcol: TLVColumnW): Integer;
function ListView_InsertColumn(hwnd: HWND; iCol: Integer;
const pcol: TLVColumn): Integer;
const
LVM_DELETECOLUMN = LVM_FIRST + 28;
function ListView_DeleteColumn(hwnd: HWND; iCol: Integer): Bool;
const
LVM_GETCOLUMNWIDTH = LVM_FIRST + 29;
function ListView_GetColumnWidth(hwnd: HWND; iCol: Integer): Integer;
const
LVSCW_AUTOSIZE = -1;
LVSCW_AUTOSIZE_USEHEADER = -2;
LVM_SETCOLUMNWIDTH = LVM_FIRST + 30;
function ListView_SetColumnWidth(hwnd: HWnd; iCol: Integer; cx: Integer): Bool;
const
LVM_CREATEDRAGIMAGE = LVM_FIRST + 33;
function ListView_CreateDragImage(hwnd: HWND; i: Integer;
const lpptUpLeft: TPoint): HImageList;
const
LVM_GETVIEWRECT = LVM_FIRST + 34;
function ListView_GetViewRect(hwnd: HWND; var prc: TRect): Bool;
const
LVM_GETTEXTCOLOR = LVM_FIRST + 35;
function ListView_GetTextColor(hwnd: HWND): TColorRef;
const
LVM_SETTEXTCOLOR = LVM_FIRST + 36;
function ListView_SetTextColor(hwnd: HWND; clrText: TColorRef): Bool;
const
LVM_GETTEXTBKCOLOR = LVM_FIRST + 37;
function ListView_GetTextBkColor(hwnd: HWND): TColorRef;
const
LVM_SETTEXTBKCOLOR = LVM_FIRST + 38;
function ListView_SetTextBkColor(hwnd: HWND; clrTextBk: TColorRef): Bool;
const
LVM_GETTOPINDEX = LVM_FIRST + 39;
function ListView_GetTopIndex(hwndLV: HWND): Integer;
const
LVM_GETCOUNTPERPAGE = LVM_FIRST + 40;
function ListView_GetCountPerPage(hwndLV: HWND): Integer;
const
LVM_GETORIGIN = LVM_FIRST + 41;
function ListView_GetOrigin(hwndLV: HWND; var ppt: TPoint): Bool;
const
LVM_UPDATE = LVM_FIRST + 42;
function ListView_Update(hwndLV: HWND; i: Integer): Bool;
const
LVM_SETITEMSTATE = LVM_FIRST + 43;
function ListView_SetItemState(hwndLV: HWND; i: Integer; data, mask: UINT): Bool;
const
LVM_GETITEMSTATE = LVM_FIRST + 44;
function ListView_GetItemState(hwndLV: HWND; i, mask: Integer): Integer;
const
LVM_GETITEMTEXTA = LVM_FIRST + 45;
LVM_GETITEMTEXTW = LVM_FIRST + 115;
LVM_GETITEMTEXT = LVM_GETITEMTEXTA;
function ListView_GetItemTextA(hwndLV: HWND; i, iSubItem: Integer;
pszText: PAnsiChar; cchTextMax: Integer): Integer;
function ListView_GetItemTextW(hwndLV: HWND; i, iSubItem: Integer;
pszText: PWideChar; cchTextMax: Integer): Integer;
function ListView_GetItemText(hwndLV: HWND; i, iSubItem: Integer;
pszText: PChar; cchTextMax: Integer): Integer;
const
LVM_SETITEMTEXTA = LVM_FIRST + 46;
LVM_SETITEMTEXTW = LVM_FIRST + 116;
LVM_SETITEMTEXT = LVM_SETITEMTEXTA;
function ListView_SetItemTextA(hwndLV: HWND; i, iSubItem: Integer;
pszText: PAnsiChar): Bool;
function ListView_SetItemTextW(hwndLV: HWND; i, iSubItem: Integer;
pszText: PWideChar): Bool;
function ListView_SetItemText(hwndLV: HWND; i, iSubItem: Integer;
pszText: PChar): Bool;
const
LVM_SETITEMCOUNT = LVM_FIRST + 47;
procedure ListView_SetItemCount(hwndLV: HWND; cItems: Integer);
type
TLVCompare = function(lParam1, lParam2, lParamSort: Integer): Integer stdcall;
const
LVM_SORTITEMS = LVM_FIRST + 48;
function ListView_SortItems(hwndLV: HWND; pfnCompare: TLVCompare;
lPrm: Longint): Bool;
const
LVM_SETITEMPOSITION32 = LVM_FIRST + 49;
procedure ListView_SetItemPosition32(hwndLV: HWND; i, x, y: Integer);
const
LVM_GETSELECTEDCOUNT = LVM_FIRST + 50;
function ListView_GetSelectedCount(hwndLV: HWND): UINT;
const
LVM_GETITEMSPACING = LVM_FIRST + 51;
function ListView_GetItemSpacing(hwndLV: HWND; fSmall: Integer): Longint;
const
LVM_GETISEARCHSTRINGA = LVM_FIRST + 52;
LVM_GETISEARCHSTRINGW = LVM_FIRST + 117;
LVM_GETISEARCHSTRING = LVM_GETISEARCHSTRINGA;
function ListView_GetISearchStringA(hwndLV: HWND; lpsz: PAnsiChar): Bool;
function ListView_GetISearchStringW(hwndLV: HWND; lpsz: PWideChar): Bool;
function ListView_GetISearchString(hwndLV: HWND; lpsz: PChar): Bool;
type
PNMListView = ^TNMListView;
_NM_LISTVIEW = packed record
hdr: TNMHDR;
iItem: Integer;
iSubItem: Integer;
uNewState: UINT;
uOldState: UINT;
uChanged: UINT;
ptAction: TPoint;
lParam: LPARAM;
end;
{$nonamespace _NM_LISTVIEW}
TNMListView = _NM_LISTVIEW;
const
LVN_ITEMCHANGING = LVN_FIRST-0;
LVN_ITEMCHANGED = LVN_FIRST-1;
LVN_INSERTITEM = LVN_FIRST-2;
LVN_DELETEITEM = LVN_FIRST-3;
LVN_DELETEALLITEMS = LVN_FIRST-4;
LVN_COLUMNCLICK = LVN_FIRST-8;
LVN_BEGINDRAG = LVN_FIRST-9;
LVN_ENDDRAG = LVN_FIRST-10;
LVN_BEGINRDRAG = LVN_FIRST-11;
LVN_ENDRDRAG = LVN_FIRST-12;
LVN_BEGINLABELEDITA = LVN_FIRST-5;
LVN_ENDLABELEDITA = LVN_FIRST-6;
LVN_BEGINLABELEDITW = LVN_FIRST-75;
LVN_ENDLABELEDITW = LVN_FIRST-76;
LVN_BEGINLABELEDIT = LVN_BEGINLABELEDITA;
LVN_ENDLABELEDIT = LVN_ENDLABELEDITA;
const
LVN_GETDISPINFOA = LVN_FIRST-50;
LVN_SETDISPINFOA = LVN_FIRST-51;
LVN_GETDISPINFOW = LVN_FIRST-77;
LVN_SETDISPINFOW = LVN_FIRST-78;
LVN_GETDISPINFO = LVN_GETDISPINFOA;
LVN_SETDISPINFO = LVN_SETDISPINFOA;
LVIF_DI_SETITEM = $1000;
type
PLVDispInfoA = ^TLVDispInfoA;
_LV_DISPINFO = packed record
hdr: TNMHDR;
item: TLVItemA;
end;
{$nonamespace _LV_DISPINFO}
TLVDispInfoA = _LV_DISPINFO;
PLVDispInfoW = ^TLVDispInfoW;
_LV_DISPINFOW = packed record
hdr: TNMHDR;
item: TLVItemW;
end;
{$nonamespace _LV_DISPINFOW}
TLVDispInfoW = _LV_DISPINFOW;
PLVDispInfo = PLVDispInfoA;
const
LVN_KEYDOWN = LVN_FIRST-55;
type
PLVKeyDown = ^TLVKeyDown;
_LV_KEYDOWN = packed record
hdr: TNMHDR;
wVKey: Word;
flags: UINT;
end;
{$nonamespace _LV_KEYDOWN}
TLVKeyDown = _LV_KEYDOWN;
{ ====== TREEVIEW CONTROL =================== }
const
WC_TREEVIEW = 'SysTreeView32';
const
TVS_HASBUTTONS = $0001;
TVS_HASLINES = $0002;
TVS_LINESATROOT = $0004;
TVS_EDITLABELS = $0008;
TVS_DISABLEDRAGDROP = $0010;
TVS_SHOWSELALWAYS = $0020;
type
HTreeItem = ^_TreeItem;
_TreeItem = packed record
end;
const
TVIF_TEXT = $0001;
TVIF_IMAGE = $0002;
TVIF_PARAM = $0004;
TVIF_STATE = $0008;
TVIF_HANDLE = $0010;
TVIF_SELECTEDIMAGE = $0020;
TVIF_CHILDREN = $0040;
TVIS_FOCUSED = $0001;
TVIS_SELECTED = $0002;
TVIS_CUT = $0004;
TVIS_DROPHILITED = $0008;
TVIS_BOLD = $0010;
TVIS_EXPANDED = $0020;
TVIS_EXPANDEDONCE = $0040;
TVIS_OVERLAYMASK = $0F00;
TVIS_STATEIMAGEMASK = $F000;
TVIS_USERMASK = $F000;
const
I_CHILDRENCALLBACK = -1;
type
PTVItemA = ^TTVItemA;
PTVItemW = ^TTVItemW;
PTVItem = PTVItemA;
_TV_ITEMA = packed record
mask: UINT;
hItem: HTreeItem;
state: UINT;
stateMask: UINT;
pszText: PAnsiChar;
cchTextMax: Integer;
iImage: Integer;
iSelectedImage: Integer;
cChildren: Integer;
lParam: LPARAM;
end;
{$nonamespace _TV_ITEMA}
TTVItemA = _TV_ITEMA;
_TV_ITEMW = packed record
mask: UINT;
hItem: HTreeItem;
state: UINT;
stateMask: UINT;
pszText: PWideChar;
cchTextMax: Integer;
iImage: Integer;
iSelectedImage: Integer;
cChildren: Integer;
lParam: LPARAM;
end;
{$nonamespace _TV_ITEMW}
TTVItemW = _TV_ITEMW;
TTVItem = TTVItemA;
const
TVI_ROOT = HTreeItem($FFFF0000);
TVI_FIRST = HTreeItem($FFFF0001);
TVI_LAST = HTreeItem($FFFF0002);
TVI_SORT = HTreeItem($FFFF0003);
type
PTVInsertStructA = ^TTVInsertStructA;
PTVInsertStructW = ^TTVInsertStructW;
PTVInsertStruct = PTVInsertStructA;
_TV_INSERTSTRUCTA = packed record
hParent: HTreeItem;
hInsertAfter: HTreeItem;
item: TTVItemA;
end;
{$nonamespace _TV_INSERTSTRUCTA}
TTVInsertStructA = _TV_INSERTSTRUCTA;
_TV_INSERTSTRUCTW = packed record
hParent: HTreeItem;
hInsertAfter: HTreeItem;
item: TTVItemW;
end;
{$nonamespace _TV_INSERTSTRUCTW}
TTVInsertStructW = _TV_INSERTSTRUCTW;
TTVInsertStruct = TTVInsertStructA;
const
TVM_INSERTITEMA = TV_FIRST + 0;
TVM_INSERTITEMW = TV_FIRST + 50;
TVM_INSERTITEM = TVM_INSERTITEMA;
function TreeView_InsertItem(hwnd: HWND; const lpis: TTVInsertStruct): HTreeItem;
const
TVM_DELETEITEM = TV_FIRST + 1;
function TreeView_DeleteItem(hwnd: HWND; hitem: HTreeItem): Bool;
function TreeView_DeleteAllItems(hwnd: HWND): Bool;
const
TVM_EXPAND = TV_FIRST + 2;
function TreeView_Expand(hwnd: HWND; hitem: HTreeItem; code: Integer): Bool;
const
TVE_COLLAPSE = $0001;
TVE_EXPAND = $0002;
TVE_TOGGLE = $0003;
TVE_COLLAPSERESET = $8000;
const
TVM_GETITEMRECT = TV_FIRST + 4;
function TreeView_GetItemRect(hwnd: HWND; hitem: HTreeItem;
var prc: TRect; code: Bool): Bool;
const
TVM_GETCOUNT = TV_FIRST + 5;
function TreeView_GetCount(hwnd: HWND): UINT;
const
TVM_GETINDENT = TV_FIRST + 6;
function TreeView_GetIndent(hwnd: HWND): UINT;
const
TVM_SETINDENT = TV_FIRST + 7;
function TreeView_SetIndent(hwnd: HWND; indent: Integer): Bool;
const
TVM_GETIMAGELIST = TV_FIRST + 8;
function TreeView_GetImageList(hwnd: HWND; iImage: Integer): HImageList;
const
TVSIL_NORMAL = 0;
TVSIL_STATE = 2;
const
TVM_SETIMAGELIST = TV_FIRST + 9;
function TreeView_SetImageList(hwnd: HWND; himl: HImageList;
iImage: Integer): HImageList;
const
TVM_GETNEXTITEM = TV_FIRST + 10;
function TreeView_GetNextItem(hwnd: HWND; hitem: HTreeItem;
code: Integer): HTreeItem;
const
TVGN_ROOT = $0000;
TVGN_NEXT = $0001;
TVGN_PREVIOUS = $0002;
TVGN_PARENT = $0003;
TVGN_CHILD = $0004;
TVGN_FIRSTVISIBLE = $0005;
TVGN_NEXTVISIBLE = $0006;
TVGN_PREVIOUSVISIBLE = $0007;
TVGN_DROPHILITE = $0008;
TVGN_CARET = $0009;
function TreeView_GetChild(hwnd: HWND; hitem: HTreeItem): HTreeItem;
function TreeView_GetNextSibling(hwnd: HWND; hitem: HTreeItem): HTreeItem;
function TreeView_GetPrevSibling(hwnd: HWND; hitem: HTreeItem): HTreeItem;
function TreeView_GetParent(hwnd: HWND; hitem: HTreeItem): HTreeItem;
function TreeView_GetFirstVisible(hwnd: HWND): HTreeItem;
function TreeView_GetNextVisible(hwnd: HWND; hitem: HTreeItem): HTreeItem;
function TreeView_GetPrevVisible(hwnd: HWND; hitem: HTreeItem): HTreeItem;
function TreeView_GetSelection(hwnd: HWND): HTreeItem;
function TreeView_GetDropHilite(hwnd: HWND): HTreeItem;
function TreeView_GetRoot(hwnd: HWND): HTreeItem;
const
TVM_SELECTITEM = TV_FIRST + 11;
function TreeView_Select(hwnd: HWND; hitem: HTreeItem;
code: Integer): HTreeItem;
function TreeView_SelectItem(hwnd: HWND; hitem: HTreeItem): HTreeItem;
function TreeView_SelectDropTarget(hwnd: HWND; hitem: HTreeItem): HTreeItem;
function TreeView_SelectSetFirstVisible(hwnd: HWND; hitem: HTreeItem): HTreeItem;
const
TVM_GETITEMA = TV_FIRST + 12;
TVM_GETITEMW = TV_FIRST + 62;
TVM_GETITEM = TVM_GETITEMA;
function TreeView_GetItemA(hwnd: HWND; var pitem: TTVItemA): Bool;
function TreeView_GetItemW(hwnd: HWND; var pitem: TTVItemW): Bool;
function TreeView_GetItem(hwnd: HWND; var pitem: TTVItem): Bool;
const
TVM_SETITEMA = TV_FIRST + 13;
TVM_SETITEMW = TV_FIRST + 63;
TVM_SETITEM = TVM_SETITEMA;
function TreeView_SetItemA(hwnd: HWND; const pitem: TTVItemA): Bool;
function TreeView_SetItemW(hwnd: HWND; const pitem: TTVItemW): Bool;
function TreeView_SetItem(hwnd: HWND; const pitem: TTVItem): Bool;
const
TVM_EDITLABELA = TV_FIRST + 14;
TVM_EDITLABELW = TV_FIRST + 65;
TVM_EDITLABEL = TVM_EDITLABELA;
function TreeView_EditLabelA(hwnd: HWND; hitem: HTreeItem): HWND;
function TreeView_EditLabelW(hwnd: HWND; hitem: HTreeItem): HWND;
function TreeView_EditLabel(hwnd: HWND; hitem: HTreeItem): HWND;
const
TVM_GETEDITCONTROL = TV_FIRST + 15;
function TreeView_GetEditControl(hwnd: HWND): HWND;
const
TVM_GETVISIBLECOUNT = TV_FIRST + 16;
function TreeView_GetVisibleCount(hwnd: HWND): UINT;
const
TVM_HITTEST = TV_FIRST + 17;
type
PTVHitTestInfo = ^TTVHitTestInfo;
_TV_HITTESTINFO = packed record
pt: TPoint;
flags: UINT;
hItem: HTreeItem;
end;
{$nonamespace _TV_HITTESTINFO}
TTVHitTestInfo = _TV_HITTESTINFO;
function TreeView_HitTest(hwnd: HWND; var lpht: TTVHitTestInfo): HTreeItem;
const
TVHT_NOWHERE = $0001;
TVHT_ONITEMICON = $0002;
TVHT_ONITEMLABEL = $0004;
TVHT_ONITEMINDENT = $0008;
TVHT_ONITEMBUTTON = $0010;
TVHT_ONITEMRIGHT = $0020;
TVHT_ONITEMSTATEICON = $0040;
TVHT_ONITEM = TVHT_ONITEMICON or TVHT_ONITEMLABEL or
TVHT_ONITEMSTATEICON;
TVHT_ABOVE = $0100;
TVHT_BELOW = $0200;
TVHT_TORIGHT = $0400;
TVHT_TOLEFT = $0800;
const
TVM_CREATEDRAGIMAGE = TV_FIRST + 18;
function TreeView_CreateDragImage(hwnd: HWND; hitem: HTreeItem): HimageList;
const
TVM_SORTCHILDREN = TV_FIRST + 19;
function TreeView_SortChildren(hwnd: HWND; hitem: HTreeItem;
recurse: Integer): Bool;
const
TVM_ENSUREVISIBLE = TV_FIRST + 20;
function TreeView_EnsureVisible(hwnd: HWND; hitem: HTreeItem): Bool;
const
TVM_SORTCHILDRENCB = TV_FIRST + 21;
type
TTVCompare = function(lParam1, lParam2, lParamSort: Longint): Integer stdcall;
type
_TV_SORTCB = packed record
hParent: HTreeItem;
lpfnCompare: TTVCompare;
lParam: LPARAM;
end;
{$nonamespace _TV_SORTCB}
TTVSortCB = _TV_SORTCB;
function TreeView_SortChildrenCB(hwnd: HWND; const psort: TTVSortCB;
recurse: Integer): Bool;
const
TVM_ENDEDITLABELNOW = TV_FIRST + 22;
function TreeView_EndEditLabelNow(hwnd: HWND; fCancel: Bool): Bool;
const
TVM_GETISEARCHSTRINGA = TV_FIRST + 23;
TVM_GETISEARCHSTRINGW = TV_FIRST + 64;
TVM_GETISEARCHSTRING = TVM_GETISEARCHSTRINGA;
function TreeView_GetISearchStringA(hwndTV: HWND; lpsz: PAnsiChar): Bool;
function TreeView_GetISearchStringW(hwndTV: HWND; lpsz: PWideChar): Bool;
function TreeView_GetISearchString(hwndTV: HWND; lpsz: PChar): Bool;
type
PNMTreeViewA = ^TNMTreeViewA;
PNMTreeViewW = ^TNMTreeViewW;
PNMTreeView = PNMTreeViewA;
_NM_TREEVIEWA = packed record
hdr: TNMHDR;
action: UINT;
itemOld: TTVItemA;
itemNew: TTVItemA;
ptDrag: TPoint;
end;
{$nonamespace _NM_TREEVIEWA}
TNMTreeViewA = _NM_TREEVIEWA;
_NM_TREEVIEWW = packed record
hdr: TNMHDR;
action: UINT;
itemOld: TTVItemW;
itemNew: TTVItemW;
ptDrag: TPoint;
end;
{$nonamespace _NM_TREEVIEWW}
TNMTreeViewW = _NM_TREEVIEWW;
TNMTreeView = TNMTreeViewA;
const
TVN_SELCHANGINGA = TVN_FIRST-1;
TVN_SELCHANGEDA = TVN_FIRST-2;
TVN_SELCHANGINGW = TVN_FIRST-50;
TVN_SELCHANGEDW = TVN_FIRST-51;
TVN_SELCHANGING = TVN_SELCHANGINGA;
TVN_SELCHANGED = TVN_SELCHANGEDA;
const
TVC_UNKNOWN = $0000;
TVC_BYMOUSE = $0001;
TVC_BYKEYBOARD = $0002;
const
TVN_GETDISPINFOA = TVN_FIRST-3;
TVN_SETDISPINFOA = TVN_FIRST-4;
TVN_GETDISPINFOW = TVN_FIRST-52;
TVN_SETDISPINFOW = TVN_FIRST-53;
TVN_GETDISPINFO = TVN_GETDISPINFOA;
TVN_SETDISPINFO = TVN_SETDISPINFOA;
TVIF_DI_SETITEM = $1000;
type
PTVDispInfoA = ^TTVDispInfoA;
PTVDispInfoW = ^TTVDispInfoW;
PTVDispInfo = PTVDispInfoA;
_TV_DISPINFOA = packed record
hdr: TNMHDR;
item: TTVItemA;
end;
{$nonamespace _TV_DISPINFOA}
TTVDispInfoA = _TV_DISPINFOA;
_TV_DISPINFOW = packed record
hdr: TNMHDR;
item: TTVItemW;
end;
{$nonamespace _TV_DISPINFOW}
TTVDispInfoW = _TV_DISPINFOW;
TTVDispInfo = TTVDispInfoA;
const
TVN_ITEMEXPANDINGA = TVN_FIRST-5;
TVN_ITEMEXPANDEDA = TVN_FIRST-6;
TVN_BEGINDRAGA = TVN_FIRST-7;
TVN_BEGINRDRAGA = TVN_FIRST-8;
TVN_DELETEITEMA = TVN_FIRST-9;
TVN_BEGINLABELEDITA = TVN_FIRST-10;
TVN_ENDLABELEDITA = TVN_FIRST-11;
TVN_ITEMEXPANDINGW = TVN_FIRST-54;
TVN_ITEMEXPANDEDW = TVN_FIRST-55;
TVN_BEGINDRAGW = TVN_FIRST-56;
TVN_BEGINRDRAGW = TVN_FIRST-57;
TVN_DELETEITEMW = TVN_FIRST-58;
TVN_BEGINLABELEDITW = TVN_FIRST-59;
TVN_ENDLABELEDITW = TVN_FIRST-60;
TVN_ITEMEXPANDING = TVN_ITEMEXPANDINGA;
TVN_ITEMEXPANDED = TVN_ITEMEXPANDEDA;
TVN_BEGINDRAG = TVN_BEGINDRAGA;
TVN_BEGINRDRAG = TVN_BEGINRDRAGA;
TVN_DELETEITEM = TVN_DELETEITEMA;
TVN_BEGINLABELEDIT = TVN_BEGINLABELEDITA;
TVN_ENDLABELEDIT = TVN_ENDLABELEDITA;
const
TVN_KEYDOWN = TVN_FIRST-12;
type
_TV_KEYDOWN = packed record
hdr: TNMHDR;
wVKey: Word;
flags: UINT;
end;
{$nonamespace _TV_KEYDOWN}
TTVKeyDown = _TV_KEYDOWN;
{ ====== TAB CONTROL ======================== }
const
WC_TABCONTROL = 'SysTabControl32';
const
TCS_FORCEICONLEFT = $0010;
TCS_FORCELABELLEFT = $0020;
TCS_SHAREIMAGELISTS = $0040;
TCS_TABS = $0000;
TCS_BUTTONS = $0100;
TCS_SINGLELINE = $0000;
TCS_MULTILINE = $0200;
TCS_RIGHTJUSTIFY = $0000;
TCS_FIXEDWIDTH = $0400;
TCS_RAGGEDRIGHT = $0800;
TCS_FOCUSONBUTTONDOWN = $1000;
TCS_OWNERDRAWFIXED = $2000;
TCS_TOOLTIPS = $4000;
TCS_FOCUSNEVER = $8000;
const
TCM_FIRST = $1300;
TCM_GETBKCOLOR = TCM_FIRST + 0;
TCM_SETBKCOLOR = TCM_FIRST + 1;
TCM_GETIMAGELIST = TCM_FIRST + 2;
TCM_SETIMAGELIST = TCM_FIRST + 3;
TCM_GETITEMCOUNT = TCM_FIRST + 4;
TCM_DELETEITEM = TCM_FIRST + 8;
TCM_DELETEALLITEMS = TCM_FIRST + 9;
TCM_GETITEMRECT = TCM_FIRST + 10;
TCM_GETCURSEL = TCM_FIRST + 11;
TCM_SETCURSEL = TCM_FIRST + 12;
TCM_HITTEST = TCM_FIRST + 13;
TCM_SETITEMEXTRA = TCM_FIRST + 14;
TCM_ADJUSTRECT = TCM_FIRST + 40;
TCM_SETITEMSIZE = TCM_FIRST + 41;
TCM_REMOVEIMAGE = TCM_FIRST + 42;
TCM_SETPADDING = TCM_FIRST + 43;
TCM_GETROWCOUNT = TCM_FIRST + 44;
TCM_GETTOOLTIPS = TCM_FIRST + 45;
TCM_SETTOOLTIPS = TCM_FIRST + 46;
TCM_GETCURFOCUS = TCM_FIRST + 47;
TCM_SETCURFOCUS = TCM_FIRST + 48;
const
TCIF_TEXT = $0001;
TCIF_IMAGE = $0002;
TCIF_PARAM = $0008;
type
PTCItemHeaderA = ^TTCItemHeaderA;
PTCItemHeaderW = ^TTCItemHeaderW;
PTCItemHeader = PTCItemHeaderA;
_TC_ITEMHEADERA = packed record
mask: UINT;
lpReserved1: UINT;
lpReserved2: UINT;
pszText: PAnsiChar;
cchTextMax: Integer;
iImage: Integer;
end;
{$nonamespace _TC_ITEMHEADERA}
TTCItemHeaderA = _TC_ITEMHEADERA;
_TC_ITEMHEADERW = packed record
mask: UINT;
lpReserved1: UINT;
lpReserved2: UINT;
pszText: PWideChar;
cchTextMax: Integer;
iImage: Integer;
end;
{$nonamespace _TC_ITEMHEADERW}
TTCItemHeaderW = _TC_ITEMHEADERW;
TTCItemHeader = TTCItemHeaderA;
PTCItemA = ^TTCItemA;
PTCItemW = ^TTCItemW;
PTCItem = PTCItemA;
_TC_ITEMA = packed record
mask: UINT;
lpReserved1: UINT;
lpReserved2: UINT;
pszText: PAnsiChar;
cchTextMax: Integer;
iImage: Integer;
lParam: LPARAM;
end;
{$nonamespace _TC_ITEMA}
TTCItemA = _TC_ITEMA;
_TC_ITEMW = packed record
mask: UINT;
lpReserved1: UINT;
lpReserved2: UINT;
pszText: PWideChar;
cchTextMax: Integer;
iImage: Integer;
lParam: LPARAM;
end;
{$nonamespace _TC_ITEMW}
TTCItemW = _TC_ITEMW;
TTCItem = TTCItemA;
const
TCM_GETITEMA = TCM_FIRST + 5;
TCM_SETITEMA = TCM_FIRST + 6;
TCM_INSERTITEMA = TCM_FIRST + 7;
TCM_GETITEMW = TCM_FIRST + 60;
TCM_SETITEMW = TCM_FIRST + 61;
TCM_INSERTITEMW = TCM_FIRST + 62;
TCM_GETITEM = TCM_GETITEMA;
TCM_SETITEM = TCM_SETITEMA;
TCM_INSERTITEM = TCM_INSERTITEMA;
const
TCHT_NOWHERE = $0001;
TCHT_ONITEMICON = $0002;
TCHT_ONITEMLABEL = $0004;
TCHT_ONITEM = TCHT_ONITEMICON or TCHT_ONITEMLABEL;
type
PTCHitTestInfo = ^TTCHitTestInfo;
_TC_HITTESTINFO = packed record
pt: TPoint;
flags: UINT;
end;
{$nonamespace _TC_HITTESTINFO}
TTCHitTestInfo = _TC_HITTESTINFO;
_TC_KEYDOWN = packed record
hdr: TNMHDR;
wVKey: Word;
flags: UINT;
end;
{$nonamespace _TC_KEYDOWN}
TTCKeyDown = _TC_KEYDOWN;
const
TCN_KEYDOWN = TCN_FIRST - 0;
TCN_SELCHANGE = TCN_FIRST - 1;
TCN_SELCHANGING = TCN_FIRST - 2;
{ ====== ANIMATE CONTROL ================= }
const
ANIMATE_CLASS = 'SysAnimate32';
const
ACS_CENTER = $0001;
ACS_TRANSPARENT = $0002;
ACS_AUTOPLAY = $0004;
ACM_OPENA = WM_USER + 100;
ACM_OPENW = WM_USER + 103;
ACM_OPEN = ACM_OPENA;
ACM_PLAY = WM_USER + 101;
ACM_STOP = WM_USER + 102;
ACN_START = 1;
ACN_STOP = 2;
implementation
uses SysUtils;
const
cctrl = 'comctl32.dll';
procedure InitCommonControls; external cctrl name 'InitCommonControls';
{ Property Sheets }
function CreatePropertySheetPageA; external cctrl name 'CreatePropertySheetPageA';
function CreatePropertySheetPageW; external cctrl name 'CreatePropertySheetPageW';
function CreatePropertySheetPage; external cctrl name 'CreatePropertySheetPageA';
function DestroyPropertySheetPage; external cctrl name 'DestroyPropertySheetPage';
function PropertySheetA; external cctrl name 'PropertySheetA';
function PropertySheetW; external cctrl name 'PropertySheetW';
function PropertySheet; external cctrl name 'PropertySheetA';
{ Image List }
function ImageList_Create; external cctrl name 'ImageList_Create';
function ImageList_Destroy; external cctrl name 'ImageList_Destroy';
function ImageList_GetImageCount; external cctrl name 'ImageList_GetImageCount';
function ImageList_Add; external cctrl name 'ImageList_Add';
function ImageList_ReplaceIcon; external cctrl name 'ImageList_ReplaceIcon';
function ImageList_SetBkColor; external cctrl name 'ImageList_SetBkColor';
function ImageList_GetBkColor; external cctrl name 'ImageList_GetBkColor';
function ImageList_SetOverlayImage; external cctrl name 'ImageList_SetOverlayImage';
function ImageList_AddIcon(ImageList: HImageList; Icon: HIcon): Integer;
begin
Result := ImageList_ReplaceIcon(ImageList, -1, Icon);
end;
function IndexToOverlayMask(Index: Integer): Integer;
begin
Result := Index shl 8;
end;
function ImageList_Draw; external cctrl name 'ImageList_Draw';
function ImageList_Replace; external cctrl name 'ImageList_Replace';
function ImageList_AddMasked; external cctrl name 'ImageList_AddMasked';
function ImageList_DrawEx; external cctrl name 'ImageList_DrawEx';
function ImageList_Remove; external cctrl name 'ImageList_Remove';
function ImageList_GetIcon; external cctrl name 'ImageList_GetIcon';
function ImageList_LoadImage; external cctrl name 'ImageList_LoadImage';
function ImageList_BeginDrag; external cctrl name 'ImageList_BeginDrag';
function ImageList_EndDrag; external cctrl name 'ImageList_EndDrag';
function ImageList_DragEnter; external cctrl name 'ImageList_DragEnter';
function ImageList_DragLeave; external cctrl name 'ImageList_DragLeave';
function ImageList_DragMove; external cctrl name 'ImageList_DragMove';
function ImageList_SetDragCursorImage; external cctrl name 'ImageList_SetDragCursorImage';
function ImageList_DragShowNolock; external cctrl name 'ImageList_DragShowNolock';
function ImageList_GetDragImage; external cctrl name 'ImageList_GetDragImage';
{ macros }
procedure ImageList_RemoveAll(ImageList: HImageList);
begin
ImageList_Remove(ImageList, -1);
end;
function ImageList_ExtractIcon(Instance: THandle; ImageList: HImageList;
Image: Integer): HIcon;
begin
Result := ImageList_GetIcon(ImageList, Image, 0);
end;
function ImageList_LoadBitmap(Instance: THandle; Bmp: PChar;
CX, Grow: Integer; Mask: TColorRef): HImageList;
begin
Result := ImageList_LoadImage(Instance, Bmp, CX, Grow, Mask,
IMAGE_BITMAP, 0);
end;
function ImageList_GetIconSize; external cctrl name 'ImageList_GetIconSize';
function ImageList_SetIconSize; external cctrl name 'ImageList_SetIconSize';
function ImageList_GetImageInfo; external cctrl name 'ImageList_GetImageInfo';
function ImageList_Merge; external cctrl name 'ImageList_Merge';
{ Headers }
function Header_GetItemCount(Header: HWnd): Integer;
begin
Result := SendMessage(Header, HDM_GETITEMCOUNT, 0, 0);
end;
function Header_InsertItem(Header: HWnd; Index: Integer;
const Item: THDItem): Integer;
begin
Result := SendMessage(Header, HDM_INSERTITEM, Index, Longint(@Item));
end;
function Header_DeleteItem(Header: HWnd; Index: Integer): Bool;
begin
Result := Bool( SendMessage(Header, HDM_DELETEITEM, Index, 0) );
end;
function Header_GetItem(Header: HWnd; Index: Integer; var Item: THDItem): Bool;
begin
Result := Bool( SendMessage(Header, HDM_GETITEM, Index, Longint(@Item)) );
end;
function Header_SetItem(Header: HWnd; Index: Integer; const Item: THDItem): Bool;
begin
Result := Bool( SendMessage(Header, HDM_SETITEM, Index, Longint(@Item)) );
end;
function Header_Layout(Header: HWnd; Layout: PHDLayout): Bool;
begin
Result := Bool( SendMessage(Header, HDM_LAYOUT, 0, Longint(Layout)) );
end;
{ Toolbar }
function CreateToolBarEx; external cctrl name 'CreateToolbarEx';
function CreateMappedBitmap; external cctrl name 'CreateMappedBitmap';
{ Status bar }
procedure DrawStatusTextA; external cctrl name 'DrawStatusTextA';
procedure DrawStatusTextW; external cctrl name 'DrawStatusTextW';
procedure DrawStatusText; external cctrl name 'DrawStatusTextA';
function CreateStatusWindowA; external cctrl name 'CreateStatusWindowA';
function CreateStatusWindowW; external cctrl name 'CreateStatusWindowW';
function CreateStatusWindow; external cctrl name 'CreateStatusWindowA';
{ Menu Help }
procedure MenuHelp; external cctrl name 'MenuHelp';
function ShowHideMenuCtl; external cctrl name 'ShowHideMenuCtl';
procedure GetEffectiveClientRect; external cctrl name 'GetEffectiveClientRect';
{ Drag List Box }
procedure MakeDragList; external cctrl name 'MakeDragList';
procedure DrawInsert; external cctrl name 'DrawInsert';
function LBItemFromPt; external cctrl name 'LBItemFromPt';
{ UpDown control }
function CreateUpDownControl; external cctrl name 'CreateUpDownControl';
{ List View }
function ListView_GetBkColor(hWnd: HWND): TColorRef;
begin
Result := SendMessage(hWnd, LVM_GETBKCOLOR, 0, 0);
end;
function ListView_SetBkColor(hWnd: HWND; clrBk: TColorRef): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_SETBKCOLOR, 0, clrBk) );
end;
function ListView_GetImageList(hWnd: HWND; iImageList: Integer): HImageList;
begin
Result := HImageList( SendMessage(hWnd, LVM_GETIMAGELIST, iImageList, 0) );
end;
function ListView_SetImageList(hWnd: HWND; himl: HImageList; iImageList: Integer): HImageList;
begin
Result := HImageList( SendMessage(hWnd, LVM_SETIMAGELIST, iImageList, Longint(himl)) );
end;
function ListView_GetItemCount(hWnd: HWND): Integer;
begin
Result := SendMessage(hWnd, LVM_GETITEMCOUNT, 0, 0);
end;
function IndexToStateImageMask(I: Longint): Longint;
begin
Result := I shl 12;
end;
function ListView_GetItemA(hWnd: HWND; var pItem: TLVItemA): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_GETITEM, 0, Longint(@pItem)) );
end;
function ListView_GetItemW(hWnd: HWND; var pItem: TLVItemW): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_GETITEM, 0, Longint(@pItem)) );
end;
function ListView_GetItem(hWnd: HWND; var pItem: TLVItem): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_GETITEM, 0, Longint(@pItem)) );
end;
function ListView_SetItemA(hWnd: HWND; const pItem: TLVItemA): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_SETITEM, 0, Longint(@pItem)) );
end;
function ListView_SetItemW(hWnd: HWND; const pItem: TLVItemW): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_SETITEM, 0, Longint(@pItem)) );
end;
function ListView_SetItem(hWnd: HWND; const pItem: TLVItem): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_SETITEM, 0, Longint(@pItem)) );
end;
function ListView_InsertItemA(hWnd: HWND; const pItem: TLVItemA): Integer;
begin
Result := Integer( SendMessage(hWnd, LVM_INSERTITEM, 0, Longint(@pItem)) );
end;
function ListView_InsertItemW(hWnd: HWND; const pItem: TLVItemW): Integer;
begin
Result := Integer( SendMessage(hWnd, LVM_INSERTITEM, 0, Longint(@pItem)) );
end;
function ListView_InsertItem(hWnd: HWND; const pItem: TLVItem): Integer;
begin
Result := Integer( SendMessage(hWnd, LVM_INSERTITEM, 0, Longint(@pItem)) );
end;
function ListView_DeleteItem(hWnd: HWND; i: Integer): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_DELETEITEM, i, 0) );
end;
function ListView_DeleteAllItems(hWnd: HWND): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_DELETEALLITEMS, 0, 0) );
end;
function ListView_GetCallbackMask(hWnd: HWND): UINT;
begin
Result := SendMessage(hWnd, LVM_GETCALLBACKMASK, 0, 0);
end;
function ListView_SetCallbackMask(hWnd: HWND; mask: UINT): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_SETCALLBACKMASK, mask, 0) );
end;
function ListView_GetNextItem(hWnd: HWND; iStart: Integer; Flags: UINT): Integer;
begin
Result := SendMessage(hWnd, LVM_GETNEXTITEM, iStart, MakeLong(Flags, 0));
end;
function ListView_FindItemA(hWnd: HWND; iStart: Integer;
const plvfi: TLVFindInfoA): Integer;
begin
Result := SendMessage(hWnd, LVM_FINDITEM, iStart, Longint(@plvfi));
end;
function ListView_FindItemW(hWnd: HWND; iStart: Integer;
const plvfi: TLVFindInfoW): Integer;
begin
Result := SendMessage(hWnd, LVM_FINDITEM, iStart, Longint(@plvfi));
end;
function ListView_FindItem(hWnd: HWND; iStart: Integer;
const plvfi: TLVFindInfo): Integer;
begin
Result := SendMessage(hWnd, LVM_FINDITEM, iStart, Longint(@plvfi));
end;
function ListView_GetItemRect(hWnd: HWND; i: Integer; var prc: TRect;
Code: Integer): Bool;
begin
prc.left := Code;
Result := Bool( SendMessage(hWnd, LVM_GETITEMRECT, i, Longint(@prc)) );
end;
function ListView_SetItemPosition(hWnd: HWND; i, x, y: Integer): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_SETITEMPOSITION, i, MakeLong(x, y)) );
end;
function ListView_GetItemPosition(hwndLV: HWND; i: Integer;
var ppt: TPoint): Bool;
begin
Result := Bool( SendMessage(hWndLV, LVM_GETITEMPOSITION, i, Longint(@ppt)) );
end;
function ListView_GetStringWidthA(hwndLV: HWND; psz: PAnsiChar): Integer;
begin
Result := SendMessage(hwndLV, LVM_GETSTRINGWIDTH, 0, Longint(psz));
end;
function ListView_GetStringWidthW(hwndLV: HWND; psz: PWideChar): Integer;
begin
Result := SendMessage(hwndLV, LVM_GETSTRINGWIDTH, 0, Longint(psz));
end;
function ListView_GetStringWidth(hwndLV: HWND; psz: PChar): Integer;
begin
Result := SendMessage(hwndLV, LVM_GETSTRINGWIDTH, 0, Longint(psz));
end;
function ListView_HitTest(hwndLV: HWND; var pinfo: TLVHitTestInfo): Integer;
begin
Result := SendMessage(hwndLV, LVM_HITTEST, 0, Longint(@pinfo));
end;
function ListView_EnsureVisible(hwndLV: HWND; i: Integer; fPartialOK: Bool): Bool;
begin
Result := SendMessage(hwndLV, LVM_ENSUREVISIBLE, i,
MakeLong(Integer(fPartialOK), 0)) <> 0;
end;
function ListView_Scroll(hwndLV: HWnd; DX, DY: Integer): Bool;
begin
Result := Bool( SendMessage(hwndLV, LVM_SCROLL, DX, DY) );
end;
function ListView_RedrawItems(hwndLV: HWND; iFirst, iLast: Integer): Bool;
begin
Result := Bool( SendMessage(hwndLV, LVM_REDRAWITEMS, iFirst, iLast) );
end;
function ListView_Arrange(hwndLV: HWND; Code: UINT): Bool;
begin
Result := Bool( SendMessage(hwndLV, LVM_ARRANGE, Code, 0) );
end;
function ListView_EditLabelA(hwndLV: HWND; i: Integer): HWND;
begin
Result := HWND( SendMessage(hwndLV, LVM_EDITLABEL, i, 0) );
end;
function ListView_EditLabelW(hwndLV: HWND; i: Integer): HWND;
begin
Result := HWND( SendMessage(hwndLV, LVM_EDITLABEL, i, 0) );
end;
function ListView_EditLabel(hwndLV: HWND; i: Integer): HWND;
begin
Result := HWND( SendMessage(hwndLV, LVM_EDITLABEL, i, 0) );
end;
function ListView_GetEditControl(hwndLV: HWND): HWND;
begin
Result := HWND( SendMessage(hwndLV, LVM_GETEDITCONTROL, 0, 0) );
end;
function ListView_GetColumnA(hwnd: HWND; iCol: Integer; var pcol: TLVColumnA): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_GETCOLUMN, iCol, Longint(@pcol)) );
end;
function ListView_GetColumnW(hwnd: HWND; iCol: Integer; var pcol: TLVColumnW): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_GETCOLUMN, iCol, Longint(@pcol)) );
end;
function ListView_GetColumn(hwnd: HWND; iCol: Integer; var pcol: TLVColumn): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_GETCOLUMN, iCol, Longint(@pcol)) );
end;
function ListView_SetColumnA(hwnd: HWND; iCol: Integer; const pcol: TLVColumnA): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_SETCOLUMN, iCol, Longint(@pcol)) );
end;
function ListView_SetColumnW(hwnd: HWND; iCol: Integer; const pcol: TLVColumnW): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_SETCOLUMN, iCol, Longint(@pcol)) );
end;
function ListView_SetColumn(hwnd: HWND; iCol: Integer; const pcol: TLVColumn): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_SETCOLUMN, iCol, Longint(@pcol)) );
end;
function ListView_InsertColumnA(hwnd: HWND; iCol: Integer; const pcol: TLVColumnA): Integer;
begin
Result := SendMessage(hWnd, LVM_INSERTCOLUMN, iCol, Longint(@pcol));
end;
function ListView_InsertColumnW(hwnd: HWND; iCol: Integer; const pcol: TLVColumnW): Integer;
begin
Result := SendMessage(hWnd, LVM_INSERTCOLUMN, iCol, Longint(@pcol));
end;
function ListView_InsertColumn(hwnd: HWND; iCol: Integer; const pcol: TLVColumn): Integer;
begin
Result := SendMessage(hWnd, LVM_INSERTCOLUMN, iCol, Longint(@pcol));
end;
function ListView_DeleteColumn(hwnd: HWND; iCol: Integer): Bool;
begin
Result := Bool( SendMessage(hWnd, LVM_DELETECOLUMN, iCol, 0) );
end;
function ListView_GetColumnWidth(hwnd: HWND; iCol: Integer): Integer;
begin
Result := Integer( SendMessage(hwnd, LVM_GETCOLUMNWIDTH, iCol, 0) );
end;
function ListView_SetColumnWidth(hwnd: HWnd; iCol: Integer; cx: Integer): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_SETCOLUMNWIDTH, iCol,
MakeLong((cx), 0)) );
end;
function ListView_CreateDragImage(hwnd: HWND; i: Integer;
const lpptUpLeft: TPoint): HImageList;
begin
Result := HIMAGELIST( SendMessage(hwnd, LVM_CREATEDRAGIMAGE, i,
Longint(@lpptUpLeft)));
end;
function ListView_GetViewRect(hwnd: HWND; var prc: TRect): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_GETVIEWRECT, 0, Longint(@prc)) );
end;
function ListView_GetTextColor(hwnd: HWND): TColorRef;
begin
Result := SendMessage(hwnd, LVM_GETTEXTCOLOR, 0, 0);
end;
function ListView_SetTextColor(hwnd: HWND; clrText: TColorRef): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_SETTEXTCOLOR, 0, clrText) );
end;
function ListView_GetTextBkColor(hwnd: HWND): TColorRef;
begin
Result := SendMessage(hwnd, LVM_GETTEXTBKCOLOR, 0, 0);
end;
function ListView_SetTextBkColor(hwnd: HWND; clrTextBk: TColorRef): Bool;
begin
Result := Bool( SendMessage(hwnd, LVM_SETTEXTBKCOLOR, 0, clrTextBk) );
end;
function ListView_GetTopIndex(hwndLV: HWND): Integer;
begin
Result := SendMessage(hwndLV, LVM_GETTOPINDEX, 0, 0);
end;
function ListView_GetCountPerPage(hwndLV: HWND): Integer;
begin
Result := SendMessage(hwndLV, LVM_GETCOUNTPERPAGE, 0, 0);
end;
function ListView_GetOrigin(hwndLV: HWND; var ppt: TPoint): Bool;
begin
Result := Bool( SendMessage(hwndLV, LVM_GETORIGIN, 0, Longint(@ppt)) );
end;
function ListView_Update(hwndLV: HWND; i: Integer): Bool;
begin
Result := SendMessage(hwndLV, LVM_UPDATE, i, 0) <> 0;
end;
function ListView_SetItemState(hwndLV: HWND; i: Integer; data, mask: UINT): Bool;
var
Item: TLVItem;
begin
Item.stateMask := mask;
Item.state := data;
Result := Bool( SendMessage(hwndLV, LVM_SETITEMSTATE, i, Longint(@Item)) );
end;
function ListView_GetItemState(hwndLV: HWND; i, mask: Integer): Integer;
begin
Result := SendMessage(hwndLV, LVM_GETITEMSTATE, i, mask);
end;
function ListView_GetItemTextA(hwndLV: HWND; i, iSubItem: Integer;
pszText: PAnsiChar; cchTextMax: Integer): Integer;
var
Item: TLVItemA;
begin
Item.iSubItem := iSubItem;
Item.cchTextMax := cchTextMax;
Item.pszText := pszText;
Result := SendMessage(hwndLV, LVM_GETITEMTEXT, i, Longint(@Item));
end;
function ListView_GetItemTextW(hwndLV: HWND; i, iSubItem: Integer;
pszText: PWideChar; cchTextMax: Integer): Integer;
var
Item: TLVItemW;
begin
Item.iSubItem := iSubItem;
Item.cchTextMax := cchTextMax;
Item.pszText := pszText;
Result := SendMessage(hwndLV, LVM_GETITEMTEXT, i, Longint(@Item));
end;
function ListView_GetItemText(hwndLV: HWND; i, iSubItem: Integer;
pszText: PChar; cchTextMax: Integer): Integer;
var
Item: TLVItem;
begin
Item.iSubItem := iSubItem;
Item.cchTextMax := cchTextMax;
Item.pszText := pszText;
Result := SendMessage(hwndLV, LVM_GETITEMTEXT, i, Longint(@Item));
end;
function ListView_SetItemTextA(hwndLV: HWND; i, iSubItem: Integer;
pszText: PAnsiChar): Bool;
var
Item: TLVItemA;
begin
Item.iSubItem := iSubItem;
Item.pszText := pszText;
Result := Bool( SendMessage(hwndLV, LVM_SETITEMTEXT, i, Longint(@Item)) );
end;
function ListView_SetItemTextW(hwndLV: HWND; i, iSubItem: Integer;
pszText: PWideChar): Bool;
var
Item: TLVItemW;
begin
Item.iSubItem := iSubItem;
Item.pszText := pszText;
Result := Bool( SendMessage(hwndLV, LVM_SETITEMTEXT, i, Longint(@Item)) );
end;
function ListView_SetItemText(hwndLV: HWND; i, iSubItem: Integer;
pszText: PChar): Bool;
var
Item: TLVItem;
begin
Item.iSubItem := iSubItem;
Item.pszText := pszText;
Result := Bool( SendMessage(hwndLV, LVM_SETITEMTEXT, i, Longint(@Item)) );
end;
procedure ListView_SetItemCount(hwndLV: HWND; cItems: Integer);
begin
SendMessage(hwndLV, LVM_SETITEMCOUNT, cItems, 0);
end;
function ListView_SortItems(hwndLV: HWND; pfnCompare: TLVCompare;
lPrm: Longint): Bool;
begin
Result := Bool( SendMessage(hwndLV, LVM_SORTITEMS, lPrm,
Longint(@pfnCompare)) );
end;
procedure ListView_SetItemPosition32(hwndLV: HWND; i, x, y: Integer);
var
ptNewPos: TPoint;
begin
ptNewPos.x := x;
ptNewPos.y := y;
SendMessage(hwndLV, LVM_SETITEMPOSITION32, i, Longint(@ptNewPos));
end;
function ListView_GetSelectedCount(hwndLV: HWND): UINT;
begin
Result := SendMessage(hwndLV, LVM_GETSELECTEDCOUNT, 0, 0);
end;
function ListView_GetItemSpacing(hwndLV: HWND; fSmall: Integer): Longint;
begin
Result := SendMessage(hwndLV, LVM_GETITEMSPACING, fSmall, 0);
end;
function ListView_GetISearchStringA(hwndLV: HWND; lpsz: PAnsiChar): Bool;
begin
Result := Bool( SendMessage(hwndLV, LVM_GETISEARCHSTRING, 0,
Longint(lpsz)) );
end;
function ListView_GetISearchStringW(hwndLV: HWND; lpsz: PWideChar): Bool;
begin
Result := Bool( SendMessage(hwndLV, LVM_GETISEARCHSTRING, 0,
Longint(lpsz)) );
end;
function ListView_GetISearchString(hwndLV: HWND; lpsz: PChar): Bool;
begin
Result := Bool( SendMessage(hwndLV, LVM_GETISEARCHSTRING, 0,
Longint(lpsz)) );
end;
{ Tree View }
function TreeView_InsertItem(hwnd: HWND; const lpis: TTVInsertStruct): HTreeItem;
begin
Result := HTreeItem( SendMessage(hwnd, TVM_INSERTITEM, 0, Longint(@lpis)) );
end;
function TreeView_DeleteItem(hwnd: HWND; hitem: HTreeItem): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_DELETEITEM, 0, Longint(hitem)) );
end;
function TreeView_DeleteAllItems(hwnd: HWND): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_DELETEITEM, 0, Longint(TVI_ROOT)) );
end;
function TreeView_Expand(hwnd: HWND; hitem: HTreeItem; code: Integer): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_EXPAND, code, Longint(hitem)) );
end;
function TreeView_GetItemRect(hwnd: HWND; hitem: HTreeItem;
var prc: TRect; code: Bool): Bool;
begin
HTreeItem(Pointer(@prc)^) := hitem;
Result := Bool( SendMessage(hwnd, TVM_GETITEMRECT, Integer(code), Longint(@prc)) );
end;
function TreeView_GetCount(hwnd: HWND): UINT;
begin
Result := SendMessage(hwnd, TVM_GETCOUNT, 0, 0);
end;
function TreeView_GetIndent(hwnd: HWND): UINT;
begin
Result := SendMessage(hwnd, TVM_GETINDENT, 0, 0);
end;
function TreeView_SetIndent(hwnd: HWND; indent: Integer): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_SETINDENT, indent, 0) );
end;
function TreeView_GetImageList(hwnd: HWND; iImage: Integer): HImageList;
begin
Result := HImageList( SendMessage(hwnd, TVM_GETIMAGELIST, iImage, 0) );
end;
function TreeView_SetImageList(hwnd: HWND; himl: HImageList;
iImage: Integer): HImageList;
begin
Result := HImageList( SendMessage(hwnd, TVM_SETIMAGELIST, iImage,
Longint(himl)) );
end;
function TreeView_GetNextItem(hwnd: HWND; hitem: HTreeItem;
code: Integer): HTreeItem;
begin
Result := HTreeItem( SendMessage(hwnd, TVM_GETNEXTITEM, code,
Longint(hitem)) );
end;
function TreeView_GetChild(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD);
end;
function TreeView_GetNextSibling(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT);
end;
function TreeView_GetPrevSibling(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS);
end;
function TreeView_GetParent(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT);
end;
function TreeView_GetFirstVisible(hwnd: HWND): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, nil, TVGN_FIRSTVISIBLE);
end;
function TreeView_GetNextVisible(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE);
end;
function TreeView_GetPrevVisible(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE);
end;
function TreeView_GetSelection(hwnd: HWND): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, nil, TVGN_CARET);
end;
function TreeView_GetDropHilite(hwnd: HWND): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, nil, TVGN_DROPHILITE);
end;
function TreeView_GetRoot(hwnd: HWND): HTreeItem;
begin
Result := TreeView_GetNextItem(hwnd, nil, TVGN_ROOT);
end;
function TreeView_Select(hwnd: HWND; hitem: HTreeItem;
code: Integer): HTreeItem;
begin
Result := HTreeItem( SendMessage(hwnd, TVM_SELECTITEM, code,
Longint(hitem)) );
end;
function TreeView_SelectItem(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_Select(hwnd, hitem, TVGN_CARET);
end;
function TreeView_SelectDropTarget(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_Select(hwnd, hitem, TVGN_DROPHILITE);
end;
function TreeView_SelectSetFirstVisible(hwnd: HWND; hitem: HTreeItem): HTreeItem;
begin
Result := TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE);
end;
function TreeView_GetItemA(hwnd: HWND; var pitem: TTVItemA): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_GETITEM, 0, Longint(@pitem)) );
end;
function TreeView_GetItemW(hwnd: HWND; var pitem: TTVItemW): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_GETITEM, 0, Longint(@pitem)) );
end;
function TreeView_GetItem(hwnd: HWND; var pitem: TTVItem): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_GETITEM, 0, Longint(@pitem)) );
end;
function TreeView_SetItemA(hwnd: HWND; const pitem: TTVItemA): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_SETITEM, 0, Longint(@pitem)) );
end;
function TreeView_SetItemW(hwnd: HWND; const pitem: TTVItemW): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_SETITEM, 0, Longint(@pitem)) );
end;
function TreeView_SetItem(hwnd: HWND; const pitem: TTVItem): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_SETITEM, 0, Longint(@pitem)) );
end;
function TreeView_EditLabelA(hwnd: HWND; hitem: HTreeItem): HWND;
begin
Result := Windows.HWND( SendMessage(hwnd, TVM_EDITLABEL, 0, Longint(hitem)) );
end;
function TreeView_EditLabelW(hwnd: HWND; hitem: HTreeItem): HWND;
begin
Result := Windows.HWND( SendMessage(hwnd, TVM_EDITLABEL, 0, Longint(hitem)) );
end;
function TreeView_EditLabel(hwnd: HWND; hitem: HTreeItem): HWND;
begin
Result := Windows.HWND( SendMessage(hwnd, TVM_EDITLABEL, 0, Longint(hitem)) );
end;
function TreeView_GetEditControl(hwnd: HWND): HWND;
begin
Result := Windows.HWND( SendMessage(hwnd, TVM_GETEDITCONTROL, 0, 0) );
end;
function TreeView_GetVisibleCount(hwnd: HWND): UINT;
begin
Result := SendMessage(hwnd, TVM_GETVISIBLECOUNT, 0, 0);
end;
function TreeView_HitTest(hwnd: HWND; var lpht: TTVHitTestInfo): HTreeItem;
begin
Result := HTreeItem( SendMessage(hwnd, TVM_HITTEST, 0, Longint(@lpht)) );
end;
function TreeView_CreateDragImage(hwnd: HWND; hitem: HTreeItem): HimageList;
begin
Result := HImageList( SendMessage(hwnd, TVM_CREATEDRAGIMAGE, 0,
Longint(hitem)) );
end;
function TreeView_SortChildren(hwnd: HWND; hitem: HTreeItem;
recurse: Integer): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_SORTCHILDREN, recurse,
Longint(hitem)) );
end;
function TreeView_EnsureVisible(hwnd: HWND; hitem: HTreeItem): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_ENSUREVISIBLE, 0, Longint(hitem)) );
end;
function TreeView_SortChildrenCB(hwnd: HWND; const psort: TTVSortCB;
recurse: Integer): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_SORTCHILDRENCB, recurse,
Longint(@psort)) );
end;
function TreeView_EndEditLabelNow(hwnd: HWND; fCancel: Bool): Bool;
begin
Result := Bool( SendMessage(hwnd, TVM_ENDEDITLABELNOW, Integer(fCancel),
0) );
end;
function TreeView_GetISearchStringA(hwndTV: HWND; lpsz: PAnsiChar): Bool;
begin
Result := Bool( SendMessage(hwndTV, TVM_GETISEARCHSTRING, 0,
Longint(lpsz)) );
end;
function TreeView_GetISearchStringW(hwndTV: HWND; lpsz: PWideChar): Bool;
begin
Result := Bool( SendMessage(hwndTV, TVM_GETISEARCHSTRING, 0,
Longint(lpsz)) );
end;
function TreeView_GetISearchString(hwndTV: HWND; lpsz: PChar): Bool;
begin
Result := Bool( SendMessage(hwndTV, TVM_GETISEARCHSTRING, 0,
Longint(lpsz)) );
end;
end.