-
Notifications
You must be signed in to change notification settings - Fork 31
/
delphicommctrl.inc
1605 lines (1354 loc) · 50.1 KB
/
delphicommctrl.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
////////////////////////////////////////////////////////////////////////////
// this part of unit contains definitions moved here from CommCtrl.pas
// (using of CommCtrl.pas in Delphi3 leads to increase size of executable
// onto 30K)
type
PTCItemA = ^TTCItemA;
PTCItemW = ^TTCItemW;
PTCItem = PTCItemA;
tagTCITEMA = packed record
mask: UINT;
dwState: UINT;
dwStateMask: UINT;
pszText: PAnsiChar;
cchTextMax: Integer;
iImage: Integer;
lParam: LPARAM;
end;
tagTCITEMW = packed record
mask: UINT;
dwState: UINT;
dwStateMask: UINT;
pszText: PWideChar;
cchTextMax: Integer;
iImage: Integer;
lParam: LPARAM;
end;
PTCKeyDown = ^TTCKeyDown;
TTCKEYDOWN = packed record
hdr: TNMHDR;
wVKey: Word;
flags: UINT;
end;
tagTCITEM = tagTCITEMA;
_TC_ITEMA = tagTCITEMA;
_TC_ITEMW = tagTCITEMW;
_TC_ITEM = _TC_ITEMA;
TTCItemA = tagTCITEMA;
TTCItemW = tagTCITEMW;
TTCItem = TTCItemA;
TC_ITEMA = tagTCITEMA;
TC_ITEMW = tagTCITEMW;
TC_ITEM = TC_ITEMA;
const
CCM_FIRST = $2000; { Common control shared messages }
CCM_SETBKCOLOR = CCM_FIRST + 1; // lParam is bkColor
CCM_SETCOLORSCHEME = CCM_FIRST + 2; // lParam is color scheme
CCM_GETCOLORSCHEME = CCM_FIRST + 3; // fills in COLORSCHEME pointed to by lParam
CCM_GETDROPTARGET = CCM_FIRST + 4;
CCM_SETUNICODEFORMAT = CCM_FIRST + 5;
CCM_GETUNICODEFORMAT = CCM_FIRST + 6;
TCS_SCROLLOPPOSITE = $0001; // assumes multiline tab
TCS_BOTTOM = $0002;
TCS_RIGHT = $0002;
TCS_MULTISELECT = $0004; // allow multi-select in button mode
TCS_FLATBUTTONS = $0008;
TCS_FORCEICONLEFT = $0010;
TCS_FORCELABELLEFT = $0020;
TCS_HOTTRACK = $0040;
TCS_VERTICAL = $0080;
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;
TCS_EX_FLATSEPARATORS = $00000001;
TCS_EX_REGISTERDROP = $00000002;
TCM_FIRST = $1300; { Tab control messages }
TCM_GETIMAGELIST = TCM_FIRST + 2;
TCM_SETIMAGELIST = TCM_FIRST + 3;
TCM_GETITEMCOUNT = TCM_FIRST + 4;
TCM_GETITEMA = TCM_FIRST + 5;
TCM_SETITEMA = TCM_FIRST + 6;
TCM_INSERTITEMA = TCM_FIRST + 7;
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;
TCM_SETMINTABWIDTH = TCM_FIRST + 49;
TCM_DESELECTALL = TCM_FIRST + 50;
TCM_HIGHLIGHTITEM = TCM_FIRST + 51;
TCM_SETEXTENDEDSTYLE = TCM_FIRST + 52; // optional wParam == mask
TCM_GETEXTENDEDSTYLE = TCM_FIRST + 53;
TCM_GETITEMW = TCM_FIRST + 60;
TCM_SETITEMW = TCM_FIRST + 61;
TCM_INSERTITEMW = TCM_FIRST + 62;
TCM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT;
TCM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT;
TCM_GETITEM = TCM_GETITEMA;
TCM_SETITEM = TCM_SETITEMA;
TCM_INSERTITEM = TCM_INSERTITEMA;
TCN_FIRST = 0-550; { tab control }
TCN_LAST = 0-580;
TCN_KEYDOWN = TCN_FIRST - 0;
TCN_SELCHANGE = TCN_FIRST - 1;
TCN_SELCHANGING = TCN_FIRST - 2;
TCN_GETOBJECT = TCN_FIRST - 3;
TCIF_TEXT = $0001;
TCIF_IMAGE = $0002;
TCIF_RTLREADING = $0004;
TCIF_PARAM = $0008;
TCIF_STATE = $0010;
PBS_SMOOTH = 01;
PBS_VERTICAL = 04;
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;
PBM_SETRANGE32 = WM_USER+6; // lParam = high, wParam = low
PBM_GETRANGE = WM_USER+7; // lParam = PPBRange or Nil
// wParam = False: Result = high
// wParam = True: Result = low
PBM_GETPOS = WM_USER+8;
PBM_SETBARCOLOR = WM_USER+9; // lParam = bar color
PBM_SETBKCOLOR = CCM_SETBKCOLOR; // lParam = bkColor
SB_SETTEXTA = WM_USER+1;
SB_GETTEXTA = WM_USER+2;
SB_GETTEXTLENGTHA = WM_USER+3;
SB_SETTIPTEXTA = WM_USER+16;
SB_GETTIPTEXTA = WM_USER+18;
SB_SETTEXTW = WM_USER+11;
SB_GETTEXTW = WM_USER+13;
SB_GETTEXTLENGTHW = WM_USER+12;
SB_SETTIPTEXTW = WM_USER+17;
SB_GETTIPTEXTW = WM_USER+19;
SB_SETTEXT = SB_SETTEXTA;
SB_GETTEXT = SB_GETTEXTA;
SB_GETTEXTLENGTH = SB_GETTEXTLENGTHA;
SB_SETTIPTEXT = SB_SETTIPTEXTA;
SB_GETTIPTEXT = SB_GETTIPTEXTA;
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;
SB_ISSIMPLE = WM_USER+14;
SB_SETICON = WM_USER+15;
SB_GETICON = WM_USER+20;
SB_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT;
SB_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT;
SBT_OWNERDRAW = $1000;
SBT_NOBORDERS = $0100;
SBT_POPOUT = $0200;
SBT_RTLREADING = $0400;
SBT_TOOLTIPS = $0800;
SB_SETBKCOLOR = CCM_SETBKCOLOR; // lParam = bkColor
SBARS_SIZEGRIP = $0100;
{ List View Styles }
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_OWNERDATA = $1000;
LVS_NOSCROLL = $2000;
LVS_TYPESTYLEMASK = $FC00;
LVS_ALIGNTOP = $0000;
LVS_ALIGNLEFT = $0800;
LVS_ALIGNMASK = $0c00;
LVS_OWNERDRAWFIXED = $0400;
LVS_NOCOLUMNHEADER = $4000;
LVS_NOSORTHEADER = $8000;
{ List View Extended Styles }
LVS_EX_GRIDLINES = $00000001;
LVS_EX_SUBITEMIMAGES = $00000002;
LVS_EX_CHECKBOXES = $00000004;
LVS_EX_TRACKSELECT = $00000008;
LVS_EX_HEADERDRAGDROP = $00000010;
LVS_EX_FULLROWSELECT = $00000020; // applies to report mode only
LVS_EX_ONECLICKACTIVATE = $00000040;
LVS_EX_TWOCLICKACTIVATE = $00000080;
LVS_EX_FLATSB = $00000100;
LVS_EX_REGIONAL = $00000200;
LVS_EX_INFOTIP = $00000400; // listview does InfoTips for you
LVS_EX_LABELTIP = $00004000;
LVS_EX_UNDERLINEHOT = $00000800;
LVS_EX_UNDERLINECOLD = $00001000;
LVS_EX_MULTIWORKAREAS = $00002000;
I_IMAGECALLBACK = -1;
I_SKIP = -2;
LVSIL_NORMAL = 0;
LVSIL_SMALL = 1;
LVSIL_STATE = 2;
{ List View column styles }
LVCF_FMT = $0001;
LVCF_WIDTH = $0002;
LVCF_TEXT = $0004;
LVCF_SUBITEM = $0008;
LVCF_IMAGE = $0010;
LVCF_ORDER = $0020;
LVSCW_AUTOSIZE = -1;
LVSCW_AUTOSIZE_USEHEADER = -2;
LVCFMT_LEFT = $0000;
LVCFMT_RIGHT = $0001;
LVCFMT_CENTER = $0002;
LVCFMT_JUSTIFYMASK = $0003;
LVCFMT_IMAGE = $0800;
LVCFMT_BITMAP_ON_RIGHT = $1000;
LVCFMT_COL_HAS_IMAGES = $8000;
LVIF_TEXT = $0001;
LVIF_IMAGE = $0002;
LVIF_PARAM = $0004;
LVIF_STATE = $0008;
LVIF_INDENT = $0010;
//LVIF_NORECOMPUTE = $0800;
LVIF_DI_SETITEM = $1000;
LVIS_FOCUSED = $0001;
LVIS_SELECTED = $0002;
LVIS_CUT = $0004;
LVIS_DROPHILITED = $0008;
//LVIS_ACTIVATING = $0020;
LVIS_OVERLAYMASK = $0F00;
LVIS_STATEIMAGEMASK = $F000;
{ List View messages }
LVM_FIRST = $1000; { ListView messages }
LVM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT;
LVM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT;
LVM_GETBKCOLOR = LVM_FIRST + 0;
LVM_SETBKCOLOR = LVM_FIRST + 1;
LVM_GETIMAGELIST = LVM_FIRST + 2;
LVM_SETIMAGELIST = LVM_FIRST + 3;
LVM_GETITEMCOUNT = LVM_FIRST + 4;
LVM_GETITEMA = LVM_FIRST + 5;
LVM_SETITEMA = LVM_FIRST + 6;
LVM_INSERTITEMA = LVM_FIRST + 7;
LVM_DELETEITEM = LVM_FIRST + 8;
LVM_DELETEALLITEMS = LVM_FIRST + 9;
LVM_GETCALLBACKMASK = LVM_FIRST + 10;
LVM_SETCALLBACKMASK = LVM_FIRST + 11;
LVM_GETNEXTITEM = LVM_FIRST + 12;
LVM_FINDITEMA = LVM_FIRST + 13;
LVM_GETITEMRECT = LVM_FIRST + 14;
LVM_SETITEMPOSITION = LVM_FIRST + 15;
LVM_GETITEMPOSITION = LVM_FIRST + 16;
LVM_GETSTRINGWIDTHA = LVM_FIRST + 17;
LVM_HITTEST = LVM_FIRST + 18;
LVM_ENSUREVISIBLE = LVM_FIRST + 19;
LVM_SCROLL = LVM_FIRST + 20;
LVM_REDRAWITEMS = LVM_FIRST + 21;
LVM_ARRANGE = LVM_FIRST + 22;
LVM_EDITLABELA = LVM_FIRST + 23;
LVM_GETCOLUMNA = LVM_FIRST + 25;
LVM_SETCOLUMNA = LVM_FIRST + 26;
LVM_INSERTCOLUMNA = LVM_FIRST + 27;
LVM_DELETECOLUMN = LVM_FIRST + 28;
LVM_GETCOLUMNWIDTH = LVM_FIRST + 29;
LVM_SETCOLUMNWIDTH = LVM_FIRST + 30;
LVM_GETHEADER = LVM_FIRST + 31;
LVM_CREATEDRAGIMAGE = LVM_FIRST + 33;
LVM_GETVIEWRECT = LVM_FIRST + 34;
LVM_GETTEXTCOLOR = LVM_FIRST + 35;
LVM_SETTEXTCOLOR = LVM_FIRST + 36;
LVM_GETTEXTBKCOLOR = LVM_FIRST + 37;
LVM_SETTEXTBKCOLOR = LVM_FIRST + 38;
LVM_GETTOPINDEX = LVM_FIRST + 39;
LVM_GETCOUNTPERPAGE = LVM_FIRST + 40;
LVM_GETORIGIN = LVM_FIRST + 41;
LVM_UPDATE = LVM_FIRST + 42;
LVM_SETITEMSTATE = LVM_FIRST + 43;
LVM_GETITEMSTATE = LVM_FIRST + 44;
LVM_GETITEMTEXTA = LVM_FIRST + 45;
LVM_SETITEMTEXTA = LVM_FIRST + 46;
LVM_SETITEMCOUNT = LVM_FIRST + 47;
LVM_SORTITEMS = LVM_FIRST + 48;
LVM_SETITEMPOSITION32 = LVM_FIRST + 49;
LVM_GETSELECTEDCOUNT = LVM_FIRST + 50;
LVM_GETITEMSPACING = LVM_FIRST + 51;
LVM_GETISEARCHSTRINGA = LVM_FIRST + 52;
LVM_SETICONSPACING = LVM_FIRST + 53;
LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54;
LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55;
LVM_GETSUBITEMRECT = LVM_FIRST + 56;
LVM_SUBITEMHITTEST = LVM_FIRST + 57;
LVM_SETCOLUMNORDERARRAY = LVM_FIRST + 58;
LVM_GETCOLUMNORDERARRAY = LVM_FIRST + 59;
LVM_SETHOTITEM = LVM_FIRST + 60;
LVM_GETHOTITEM = LVM_FIRST + 61;
LVM_SETHOTCURSOR = LVM_FIRST + 62;
LVM_GETHOTCURSOR = LVM_FIRST + 63;
LVM_APPROXIMATEVIEWRECT = LVM_FIRST + 64;
LVM_SETWORKAREA = LVM_FIRST + 65;
LVM_GETSELECTIONMARK = LVM_FIRST + 66;
LVM_SETSELECTIONMARK = LVM_FIRST + 67;
LVM_SETBKIMAGEA = LVM_FIRST + 68;
LVM_GETBKIMAGEA = LVM_FIRST + 69;
LVM_GETWORKAREAS = LVM_FIRST + 70;
LVM_SETHOVERTIME = LVM_FIRST + 71;
LVM_GETHOVERTIME = LVM_FIRST + 72;
LVM_GETNUMBEROFWORKAREAS = LVM_FIRST + 73;
LVM_SETTOOLTIPS = LVM_FIRST + 74;
LVM_GETITEMW = LVM_FIRST + 75;
LVM_SETITEMW = LVM_FIRST + 76;
LVM_INSERTITEMW = LVM_FIRST + 77;
LVM_GETTOOLTIPS = LVM_FIRST + 78;
LVM_SORTITEMSEX = LVM_FIRST + 81;
LVM_FINDITEMW = LVM_FIRST + 83;
LVM_GETSTRINGWIDTHW = LVM_FIRST + 87;
LVM_GETCOLUMNW = LVM_FIRST + 95;
LVM_SETCOLUMNW = LVM_FIRST + 96;
LVM_INSERTCOLUMNW = LVM_FIRST + 97;
LVM_GETITEMTEXTW = LVM_FIRST + 115;
LVM_SETITEMTEXTW = LVM_FIRST + 116;
LVM_GETISEARCHSTRINGW = LVM_FIRST + 117;
LVM_EDITLABELW = LVM_FIRST + 118;
LVM_SETBKIMAGEW = LVM_FIRST + 138;
LVM_GETBKIMAGEW = LVM_FIRST + 139;
LVM_GETITEM = LVM_GETITEMA;
LVM_SETITEM = LVM_SETITEMA;
LVM_INSERTITEM = LVM_INSERTITEMA;
LVM_GETCOLUMN = LVM_GETCOLUMNA;
LVM_SETCOLUMN = LVM_SETCOLUMNA;
LVM_INSERTCOLUMN = LVM_INSERTCOLUMNA;
LVM_GETITEMTEXT = LVM_GETITEMTEXTA;
LVM_SETITEMTEXT = LVM_SETITEMTEXTA;
LVM_EDITLABEL = LVM_EDITLABELA;
LVM_FINDITEM = LVM_FINDITEMA;
LVM_GETISEARCHSTRING = LVM_GETISEARCHSTRINGA;
LVM_GETSTRINGWIDTH = LVM_GETSTRINGWIDTHA;
LVM_SETBKIMAGE = LVM_SETBKIMAGEA;
LVM_GETBKIMAGE = LVM_GETBKIMAGEA;
LV_MAX_WORKAREAS = 16;
LVIR_BOUNDS = 0;
LVIR_ICON = 1;
LVIR_LABEL = 2;
LVIR_SELECTBOUNDS = 3;
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;
LVNI_ALL = $0000;
LVNI_FOCUSED = $0001;
LVNI_SELECTED = $0002;
LVNI_CUT = $0004;
LVNI_DROPHILITED = $0008;
LVNI_ABOVE = $0100;
LVNI_BELOW = $0200;
LVNI_TOLEFT = $0400;
LVNI_TORIGHT = $0800;
{ WM_NOTIFY codes }
NM_FIRST = 0- 0; { generic to all controls }
NM_LAST = 0- 99;
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_CUSTOMDRAW = NM_FIRST-12;
NM_HOVER = NM_FIRST-13;
NM_NCHITTEST = NM_FIRST-14; // uses NMMOUSE struct
NM_KEYDOWN = NM_FIRST-15; // uses NMKEY struct
NM_RELEASEDCAPTURE = NM_FIRST-16;
NM_SETCURSOR = NM_FIRST-17; // uses NMMOUSE struct
NM_CHAR = NM_FIRST-18; // uses NMCHAR struct
LVN_FIRST = 0-100; { listview }
LVN_LAST = 0-199;
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_BEGINRDRAG = LVN_FIRST-11;
LVN_ODCACHEHINT = LVN_FIRST-13;
LVN_ODFINDITEMA = LVN_FIRST-52;
LVN_ODFINDITEMW = LVN_FIRST-79;
LVN_ITEMACTIVATE = LVN_FIRST-14;
LVN_ODSTATECHANGED = LVN_FIRST-15;
LVN_ODFINDITEM = LVN_ODFINDITEMA;
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;
LVN_HOTTRACK = LVN_FIRST-21;
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;
type
tagNMLVODSTATECHANGE = packed record
hdr: TNMHdr;
iFrom: Integer;
iTo: Integer;
uNewState: UINT;
uOldState: UINT;
end;
PNMLVODStateChange = ^TNMLVODStateChange;
TNMLVODStateChange = tagNMLVODSTATECHANGE;
type
PLVColumn = ^TLVColumn;
TLVColumn = packed record
mask: DWORD;
fmt: DWORD;
cx: Integer;
pszText: PChar;
cchTextMax: Integer;
iSubItem: Integer;
// only IE4+ :
iImage: Integer;
iOrder: Integer;
end;
PLVColumnW = ^TLVColumnW;
TLVColumnW = packed record
mask: DWORD;
fmt: DWORD;
cx: Integer;
pszText: PWideChar;
cchTextMax: Integer;
iSubItem: Integer;
// only IE4+ :
iImage: Integer;
iOrder: Integer;
end;
PLVItem = ^TLVItem;
TLVItem = packed record
mask: DWORD;
iItem: Integer;
iSubItem: Integer;
state: Integer;
stateMask: DWORD;
pszText: PChar;
cchTextMax: Integer;
iImage: Integer;
lParam: LParam;
iIndent: Integer; // only for IE3.0 and higher
end;
PLVItemW = ^TLVItemW;
TLVItemW = packed record
mask: DWORD;
iItem: Integer;
iSubItem: Integer;
state: Integer;
stateMask: DWORD;
pszText: PWideChar;
cchTextMax: Integer;
iImage: Integer;
lParam: LParam;
iIndent: Integer; // only for IE3.0 and higher
end;
PLVDispInfo = ^TLVDispInfo;
TLVDispInfo = packed record
hdr: TNMHDR;
item: TLVItem;
end;
PLVDispInfoW = ^TLVDispInfoW;
TLVDispInfoW = packed record
hdr: TNMHDR;
item: TLVItemW;
end;
PLVFindInfoA = ^TLVFindInfo;
TLVFindInfo = packed record
flags: UINT;
psz: PAnsiChar;
lParam: LPARAM;
pt: TPoint;
vkDirection: UINT;
end;
PLVFindInfoW = ^TLVFindInfoW;
TLVFindInfoW = packed record
flags: UINT;
psz: PWideChar;
lParam: LPARAM;
pt: TPoint;
vkDirection: UINT;
end;
TLVHitTestInfo = packed record
pt: TPoint;
flags: DWORD;
iItem: Integer;
iSubItem: Integer;
end;
const
LVFI_PARAM = $0001;
LVFI_STRING = $0002;
LVFI_PARTIAL = $0008;
LVFI_WRAP = $0020;
LVFI_NEARESTXY = $0040;
const
HDM_FIRST = $1200; { Header messages }
HDM_GETITEMW = HDM_FIRST + 11;
HDM_GETITEMA = HDM_FIRST + 3;
HDM_GETITEM = HDM_GETITEMA;
HDI_WIDTH = $0001;
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;
iImage: Integer; // index of bitmap in ImageList
iOrder: Integer; // where to draw this item
end;
_HD_ITEMW = packed record
Mask: Cardinal;
cxy: Integer;
pszText: PWideChar;
hbm: HBITMAP;
cchTextMax: Integer;
fmt: Integer;
lParam: LPARAM;
iImage: Integer; // index of bitmap in ImageList
iOrder: Integer; // where to draw this item
end;
THDItemA = _HD_ITEMA;
THDItemW = _HD_ITEMW;
THDItem = THDItemA;
const
TVS_HASBUTTONS = $0001;
TVS_HASLINES = $0002;
TVS_LINESATROOT = $0004;
TVS_EDITLABELS = $0008;
TVS_DISABLEDRAGDROP = $0010;
TVS_SHOWSELALWAYS = $0020;
TVS_RTLREADING = $0040;
TVS_NOTOOLTIPS = $0080;
TVS_CHECKBOXES = $0100;
TVS_TRACKSELECT = $0200;
TVS_SINGLEEXPAND = $0400;
TVS_INFOTIP = $0800;
TVS_FULLROWSELECT = $1000;
TVS_NOSCROLL = $2000;
TVS_NONEVENHEIGHT = $4000;
TVIF_TEXT = $0001;
TVIF_IMAGE = $0002;
TVIF_PARAM = $0004;
TVIF_STATE = $0008;
TVIF_HANDLE = $0010;
TVIF_SELECTEDIMAGE = $0020;
TVIF_CHILDREN = $0040;
TVIF_INTEGRAL = $0080;
TVIF_DI_SETITEM = $1000;
TVIS_FOCUSED = $0001;
TVIS_SELECTED = $0002;
TVIS_CUT = $0004;
TVIS_DROPHILITED = $0008;
TVIS_BOLD = $0010;
TVIS_EXPANDED = $0020;
TVIS_EXPANDEDONCE = $0040;
TVIS_EXPANDPARTIAL = $0080;
TVIS_OVERLAYMASK = $0F00;
TVIS_STATEIMAGEMASK = $F000;
TVIS_USERMASK = $F000;
TV_FIRST = $1100; { TreeView messages }
TVM_INSERTITEMA = TV_FIRST + 0;
TVM_INSERTITEM = TVM_INSERTITEMA;
TVM_DELETEITEM = TV_FIRST + 1;
TVM_EXPAND = TV_FIRST + 2;
TVE_COLLAPSE = $0001;
TVE_EXPAND = $0002;
TVE_TOGGLE = $0003;
TVE_EXPANDPARTIAL = $4000;
TVE_COLLAPSERESET = $8000;
TVM_GETITEMRECT = TV_FIRST + 4;
TVM_GETCOUNT = TV_FIRST + 5;
TVM_GETINDENT = TV_FIRST + 6;
TVM_SETINDENT = TV_FIRST + 7;
TVM_GETIMAGELIST = TV_FIRST + 8;
TVSIL_NORMAL = 0;
TVSIL_STATE = 2;
TVM_SETIMAGELIST = TV_FIRST + 9;
TVM_GETNEXTITEM = TV_FIRST + 10;
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;
TVGN_LASTVISIBLE = $000A;
TVM_SELECTITEM = TV_FIRST + 11;
TVM_GETITEMA = TV_FIRST + 12;
TVM_GETITEM = TVM_GETITEMA;
TVM_SETITEMA = TV_FIRST + 13;
TVM_SETITEM = TVM_SETITEMA;
TVM_EDITLABELA = TV_FIRST + 14;
TVM_EDITLABEL = TVM_EDITLABELA;
TVM_GETEDITCONTROL = TV_FIRST + 15;
TVM_GETVISIBLECOUNT = TV_FIRST + 16;
TVM_HITTEST = TV_FIRST + 17;
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;
TVM_CREATEDRAGIMAGE = TV_FIRST + 18;
TVM_SORTCHILDREN = TV_FIRST + 19;
TVM_ENSUREVISIBLE = TV_FIRST + 20;
TVM_SORTCHILDRENCB = TV_FIRST + 21;
TVM_ENDEDITLABELNOW = TV_FIRST + 22;
TVM_GETISEARCHSTRINGA = TV_FIRST + 23;
TVM_GETISEARCHSTRING = TVM_GETISEARCHSTRINGA;
TVM_SETTOOLTIPS = TV_FIRST + 24;
TVM_GETTOOLTIPS = TV_FIRST + 25;
TVM_SETINSERTMARK = TV_FIRST + 26;
TVM_SETITEMHEIGHT = TV_FIRST + 27;
TVM_GETITEMHEIGHT = TV_FIRST + 28;
TVM_SETBKCOLOR = TV_FIRST + 29;
TVM_SETTEXTCOLOR = TV_FIRST + 30;
TVM_GETBKCOLOR = TV_FIRST + 31;
TVM_GETTEXTCOLOR = TV_FIRST + 32;
TVM_SETSCROLLTIME = TV_FIRST + 33;
TVM_GETSCROLLTIME = TV_FIRST + 34;
TVM_SETINSERTMARKCOLOR = TV_FIRST + 37;
TVM_GETINSERTMARKCOLOR = TV_FIRST + 38;
TVM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT;
TVM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT;
TVM_INSERTITEMW = TV_FIRST + 50;
TVM_GETITEMW = TV_FIRST + 62;
TVM_SETITEMW = TV_FIRST + 63;
TVM_EDITLABELW = TV_FIRST + 65;
TVM_GETISEARCHSTRINGW = TV_FIRST + 64;
TVN_FIRST = 0-400; { treeview }
TVN_LAST = 0-499;
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;
TVC_UNKNOWN = $0000;
TVC_BYMOUSE = $0001;
TVC_BYKEYBOARD = $0002;
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;
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_GETINFOTIPA = TVN_FIRST-13;
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_GETINFOTIPW = TVN_FIRST-14;
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;
TVN_GETINFOTIP = TVN_GETINFOTIPA;
TVN_KEYDOWN = TVN_FIRST-12;
TVN_SINGLEEXPAND = TVN_FIRST-15;
TVI_ROOT = $FFFF0000;
TVI_FIRST = $FFFF0001;
TVI_LAST = $FFFF0002;
TVI_SORT = $FFFF0003;
type
PTVItemA = ^TTVItemA;
PTVItemW = ^TTVItemW;
PTVItem = PTVItemA;
tagTVITEMA = packed record
mask: UINT;
hItem: THandle;
state: UINT;
stateMask: UINT;
pszText: PAnsiChar;
cchTextMax: Integer;
iImage: Integer;
iSelectedImage: Integer;
cChildren: Integer;
lParam: LPARAM;
end;
tagTVITEMW = packed record
mask: UINT;
hItem: THandle;
state: UINT;
stateMask: UINT;
pszText: PWideChar;
cchTextMax: Integer;
iImage: Integer;
iSelectedImage: Integer;
cChildren: Integer;
lParam: LPARAM;
end;
tagTVITEM = tagTVITEMA;
_TV_ITEMA = tagTVITEMA;
_TV_ITEMW = tagTVITEMW;
_TV_ITEM = _TV_ITEMA;
TTVItemA = tagTVITEMA;
TTVItemW = tagTVITEMW;
TTVItem = TTVItemA;
TV_ITEMA = tagTVITEMA;
TV_ITEMW = tagTVITEMW;
TV_ITEM = TV_ITEMA;
// only used for Get and Set messages. no notifies
tagTVITEMEXA = packed record
mask: UINT;
hItem: THandle;
state: UINT;
stateMask: UINT;
pszText: PAnsiChar;
cchTextMax: Integer;
iImage: Integer;
iSelectedImage: Integer;
cChildren: Integer;
lParam: LPARAM;
iIntegral: Integer;
end;
tagTVITEMEXW = packed record
mask: UINT;
hItem: THandle;
state: UINT;
stateMask: UINT;
pszText: PWideChar;
cchTextMax: Integer;
iImage: Integer;
iSelectedImage: Integer;
cChildren: Integer;
lParam: LPARAM;
iIntegral: Integer;
end;
tagTVITEMEX = tagTVITEMEXA;
PTVItemExA = ^TTVItemExA;
PTVItemExW = ^TTVItemExW;
PTVItemEx = PTVItemExA;
TTVItemExA = tagTVITEMEXA;
TTVItemExW = tagTVITEMEXW;
TTVItemEx = TTVItemExA;
PNMTreeViewA = ^TNMTreeViewA;
PNMTreeViewW = ^TNMTreeViewW;
PNMTreeView = PNMTreeViewA;
tagNMTREEVIEWA = packed record
hdr: TNMHDR;
action: Integer;
itemOld: TTVItemA;
itemNew: TTVItemA;
ptDrag: TPoint;
end;
tagNMTREEVIEWW = packed record
hdr: TNMHDR;
action: Integer;
itemOld: TTVItemW;
itemNew: TTVItemW;
ptDrag: TPoint;
end;
tagNMTREEVIEW = tagNMTREEVIEWA;
_NM_TREEVIEWA = tagNMTREEVIEWA;
_NM_TREEVIEWW = tagNMTREEVIEWW;
_NM_TREEVIEW = _NM_TREEVIEWA;
TNMTreeViewA = tagNMTREEVIEWA;
TNMTreeViewW = tagNMTREEVIEWW;
TNMTreeView = TNMTreeViewA;
NM_TREEVIEWA = tagNMTREEVIEWA;
NM_TREEVIEWW = tagNMTREEVIEWW;
NM_TREEVIEW = NM_TREEVIEWA;
tagNMCUSTOMDRAWINFO = packed record
hdr: TNMHdr;
dwDrawStage: DWORD;
hdc: HDC;
rc: TRect;
dwItemSpec: DWORD; // this is control specific, but it's how to specify an item. valid only with CDDS_ITEM bit set
uItemState: UINT;
lItemlParam: LPARAM;
end;
PNMCustomDraw = ^TNMCustomDraw;
TNMCustomDraw = tagNMCUSTOMDRAWINFO;
const
// custom draw return flags
// values under 0x00010000 are reserved for global custom draw values.
// above that are for specific controls
CDRF_DODEFAULT = $00000000;
CDRF_NEWFONT = $00000002;
CDRF_SKIPDEFAULT = $00000004;
CDRF_NOTIFYPOSTPAINT = $00000010;
CDRF_NOTIFYITEMDRAW = $00000020;
CDRF_NOTIFYSUBITEMDRAW = $00000020; // flags are the same, we can distinguish by context
CDRF_NOTIFYPOSTERASE = $00000040;
// drawstage flags
// values under = $00010000 are reserved for global custom draw values.
// above that are for specific controls
CDDS_PREPAINT = $00000001;
CDDS_POSTPAINT = $00000002;
CDDS_PREERASE = $00000003;
CDDS_POSTERASE = $00000004;
// the = $000010000 bit means it's individual item specific
CDDS_ITEM = $00010000;
CDDS_ITEMPREPAINT = CDDS_ITEM or CDDS_PREPAINT;
CDDS_ITEMPOSTPAINT = CDDS_ITEM or CDDS_POSTPAINT;
CDDS_ITEMPREERASE = CDDS_ITEM or CDDS_PREERASE;
CDDS_ITEMPOSTERASE = CDDS_ITEM or CDDS_POSTERASE;
CDDS_SUBITEM = $00020000;
// itemState flags
CDIS_SELECTED = $0001;
CDIS_GRAYED = $0002;
CDIS_DISABLED = $0004;
CDIS_CHECKED = $0008;
CDIS_FOCUS = $0010;
CDIS_DEFAULT = $0020;
CDIS_HOT = $0040;
CDIS_MARKED = $0080;
CDIS_INDETERMINATE = $0100;
type
tagNMLVCUSTOMDRAW = packed record
nmcd: TNMCustomDraw;
clrText: COLORREF;
clrTextBk: COLORREF;
iSubItem: Integer; // IE 4.0 and higher
end;
PNMLVCustomDraw = ^TNMLVCustomDraw;
TNMLVCustomDraw = tagNMLVCUSTOMDRAW;
PTVDispInfoA = ^TTVDispInfoA;
PTVDispInfoW = ^TTVDispInfoW;
PTVDispInfo = PTVDispInfoA;
tagTVDISPINFOA = packed record
hdr: TNMHDR;
item: TTVItemA;
end;
tagTVDISPINFOW = packed record
hdr: TNMHDR;
item: TTVItemW;