-
Notifications
You must be signed in to change notification settings - Fork 200
/
Copy pathCommCtrl.Toolbar.cs
4005 lines (3670 loc) · 178 KB
/
CommCtrl.Toolbar.cs
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
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.User32;
namespace Vanara.PInvoke
{
public static partial class ComCtl32
{
/// <summary>Window class name for the Toolbar control.</summary>
public const string TOOLBARCLASSNAME = "ToolbarWindow32";
/// <summary/>
public static readonly IntPtr HINST_COMMCTRL = new(-1);
private const int TBN_FIRST = -700;
/// <summary>Options for CreateMappedBitmap.</summary>
public enum CMB
{
/// <summary>No flags</summary>
CMB_NONE = 0,
/// <summary>Uses a bitmap as a mask.</summary>
CMB_MASKED = 2
}
/// <summary>Flags that indicate why the hot item has changed in NMTBHOTITEM.</summary>
[PInvokeData("Commctrl.h")]
[Flags]
public enum HICF : uint
{
/// <summary>The change in the hot item was caused by a shortcut key.</summary>
HICF_ACCELERATOR = 0x00000004,
/// <summary>The change in the hot item was caused by an arrow key.</summary>
HICF_ARROWKEYS = 0x00000002,
/// <summary>Modifies HICF_ACCELERATOR. If this flag is set, more than one item has the same shortcut key character.</summary>
HICF_DUPACCEL = 0x00000008,
/// <summary>
/// Modifies the other reason flags. If this flag is set, there is no previous hot item and idOld does not contain valid information.
/// </summary>
HICF_ENTERING = 0x00000010,
/// <summary>
/// Modifies the other reason flags. If this flag is set, there is no new hot item and idNew does not contain valid information.
/// </summary>
HICF_LEAVING = 0x00000020,
/// <summary>The change in the hot item resulted from a left-click mouse event.</summary>
HICF_LMOUSE = 0x00000080,
/// <summary>The change in the hot item resulted from a mouse event.</summary>
HICF_MOUSE = 0x00000001,
/// <summary>
/// The change in the hot item resulted from an event that could not be determined. This will most often be due to a change in
/// focus or the TB_SETHOTITEM message.
/// </summary>
HICF_OTHER = 0x00000000,
/// <summary>The change in the hot item resulted from the user entering the shortcut key for an item that was already hot.</summary>
HICF_RESELECT = 0x00000040,
/// <summary>Version 5.80. Causes the button to switch states.</summary>
HICF_TOGGLEDROPDOWN = 0x00000100,
}
/// <summary>Index values for IDB_HIST_LARGE_COLOR and IDB_HIST_SMALL_COLOR</summary>
[PInvokeData("Commctrl.h")]
public enum HIST
{
/// <summary>Move back.</summary>
HIST_BACK = 0,
/// <summary>Move forward.</summary>
HIST_FORWARD = 1,
/// <summary>Open favorites folder.</summary>
HIST_FAVORITES = 2,
/// <summary>Add to favorites.</summary>
HIST_ADDTOFAVORITES = 3,
/// <summary>View tree.</summary>
HIST_VIEWTREE = 4,
}
/// <summary>Identifier of a system-defined button image list. Used by TB_LOADIMAGES.</summary>
[PInvokeData("Commctrl.h")]
public enum IDB
{
/// <summary>Standard bitmaps in small size.</summary>
IDB_STD_SMALL_COLOR = 0,
/// <summary>Standard bitmaps in large size.</summary>
IDB_STD_LARGE_COLOR = 1,
/// <summary>View bitmaps in small size.</summary>
IDB_VIEW_SMALL_COLOR = 4,
/// <summary>View bitmaps in large size.</summary>
IDB_VIEW_LARGE_COLOR = 5,
/// <summary>Windows Explorer bitmaps in small size.</summary>
IDB_HIST_SMALL_COLOR = 8,
/// <summary>Windows Explorer bitmaps in large size.</summary>
IDB_HIST_LARGE_COLOR = 9,
/// <summary>Windows Explorer travel buttons and favorites bitmaps in normal state.</summary>
IDB_HIST_NORMAL = 12,
/// <summary>Windows Explorer travel buttons and favorites bitmaps in hot state.</summary>
IDB_HIST_HOT = 13,
/// <summary>Windows Explorer travel buttons and favorites bitmaps in disabled state.</summary>
IDB_HIST_DISABLED = 14,
/// <summary>Windows Explorer travel buttons and favorites bitmaps in pressed state.</summary>
IDB_HIST_PRESSED = 15,
}
/// <summary>Index values for IDB_STD_LARGE_COLOR and IDB_STD_SMALL_COLOR</summary>
[PInvokeData("Commctrl.h")]
public enum STD
{
/// <summary>Cut operation.</summary>
STD_CUT = 0,
/// <summary>Copy operation.</summary>
STD_COPY = 1,
/// <summary>Paste operation.</summary>
STD_PASTE = 2,
/// <summary>Undo operation.</summary>
STD_UNDO = 3,
/// <summary>Redo operation.</summary>
STD_REDOW = 4,
/// <summary>Delete operation.</summary>
STD_DELETE = 5,
/// <summary>New file operation.</summary>
STD_FILENEW = 6,
/// <summary>Open file operation.</summary>
STD_FILEOPEN = 7,
/// <summary>Save file operation.</summary>
STD_FILESAVE = 8,
/// <summary>Print preview operation.</summary>
STD_PRINTPRE = 9,
/// <summary>Properties operation.</summary>
STD_PROPERTIES = 10,
/// <summary>Help operation.</summary>
STD_HELP = 11,
/// <summary>Find operation.</summary>
STD_FIND = 12,
/// <summary>Replace operation.</summary>
STD_REPLACE = 13,
/// <summary>Print operation.</summary>
STD_PRINT = 14,
}
/// <summary>
/// The value your application can return depends on the current drawing stage. The <c>dwDrawStage</c> member of the associated
/// <c>NMCUSTOMDRAW</c> structure holds a value that specifies the drawing stage. You must return one of the following values.
/// </summary>
[PInvokeData("Commctrl.h", MSDNShortId = "bb760492")]
[Flags]
public enum TBCDRF : uint
{
/// <summary>
/// The control will draw itself. It will not send any additional NM_CUSTOMDRAW notification codes for this paint cycle. This
/// occurs when dwDrawStage equals CDDS_PREPAINT.
/// </summary>
CDRF_DODEFAULT = 0x00000000,
/// <summary>
/// Your application specified a new font for the item; the control will use the new font. For more information on changing
/// fonts, see Changing fonts and colors. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.
/// </summary>
CDRF_NEWFONT = 0x00000002,
/// <summary>
/// Your application drew the item manually. The control will not draw the item. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.
/// </summary>
CDRF_SKIPDEFAULT = 0x00000004,
/// <summary>The control will notify the parent after painting an item. This occurs when dwDrawStage equals CDDS_PREPAINT.</summary>
CDRF_NOTIFYPOSTPAINT = 0x00000010,
/// <summary>
/// The control will notify the parent of any item-related drawing operations. It will send NM_CUSTOMDRAW notification codes
/// before and after drawing items. This occurs when dwDrawStage equals CDDS_PREPAINT.
/// </summary>
CDRF_NOTIFYITEMDRAW = 0x00000020,
/// <summary>
/// Version 4.71. The control will notify the parent when a list-view subitem is being drawn. This occurs when dwDrawStage equals CDDS_PREPAINT.
/// </summary>
CDRF_NOTIFYSUBITEMDRAW = 0x00000020,
/// <summary>The control will notify the parent after erasing an item. This occurs when dwDrawStage equals CDDS_PREPAINT.</summary>
CDRF_NOTIFYPOSTERASE = 0x00000040,
/// <summary>Version 5.00. Blend the button 50 percent with the background. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.</summary>
TBCDRF_BLENDICON = 0x00200000,
/// <summary>
/// Version 4.71. Use the clrHighlightHotTrack member of the NMTBCUSTOMDRAW structure to draw the background of hot-tracked
/// items. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.
/// </summary>
TBCDRF_HILITEHOTTRACK = 0x00020000,
/// <summary>Version 5.00. Do not draw button background. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.</summary>
TBCDRF_NOBACKGROUND = 0x00400000,
/// <summary>Version 4.71. Do not draw button edges. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.</summary>
TBCDRF_NOEDGES = 0x00010000,
/// <summary>Version 4.71. Do not draw etched effect for disabled items. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.</summary>
TBCDRF_NOETCHEDEFFECT = 0x00100000,
/// <summary>Do not draw default highlight of items that have the TBSTATE_MARKED. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.</summary>
TBCDRF_NOMARK = 0x00080000,
/// <summary>Version 4.71. Do not offset the button when pressed. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.</summary>
TBCDRF_NOOFFSET = 0x00040000,
/// <summary>Version 6.00, Windows Vista only. Use custom draw colors to render text regardless of visual style.</summary>
TBCDRF_USECDCOLORS = 0x00800000,
}
/// <summary>Return value from TBN_DROPDOWN.</summary>
[PInvokeData("Commctrl.h")]
public enum TBDDRET
{
/// <summary>The drop-down was handled.</summary>
TBDDRET_DEFAULT = 0,
/// <summary>The drop-down was not handled.</summary>
TBDDRET_NODEFAULT = 1,
/// <summary>The drop-down was handled, but treat the button like a regular button.</summary>
TBDDRET_TREATPRESSED = 2,
}
/// <summary>Flags used by TBBUTTONINFO.</summary>
[PInvokeData("Commctrl.h")]
[Flags]
public enum TBIF : uint
{
/// <summary>Version 5.80. The wParam sent with a TB_GETBUTTONINFO or TB_SETBUTTONINFO message is an index, not an identifier.</summary>
TBIF_BYINDEX = 0x80000000,
/// <summary>The idCommand member contains valid information or is being requested.</summary>
TBIF_COMMAND = 0x00000020,
/// <summary>The iImage member contains valid information or is being requested.</summary>
TBIF_IMAGE = 0x00000001,
/// <summary>The lParam member contains valid information or is being requested.</summary>
TBIF_LPARAM = 0x00000010,
/// <summary>The cx member contains valid information or is being requested.</summary>
TBIF_SIZE = 0x00000040,
/// <summary>The fsState member contains valid information or is being requested.</summary>
TBIF_STATE = 0x00000004,
/// <summary>The fsStyle member contains valid information or is being requested.</summary>
TBIF_STYLE = 0x00000008,
/// <summary>The pszText member contains valid information or is being requested.</summary>
TBIF_TEXT = 0x00000002,
}
/// <summary>Defines where the insertion mark is in relation to iButton in TBINSERTMARK.</summary>
[PInvokeData("Commctrl.h")]
[Flags]
public enum TBIMHT : uint
{
/// <summary>The insertion mark is to the right of the specified button.</summary>
TBIMHT_AFTER = 0x00000001,
/// <summary>
/// The insertion mark is on the background of the toolbar. This flag is only used with the TB_INSERTMARKHITTEST message.
/// </summary>
TBIMHT_BACKGROUND = 0x00000002,
}
/// <summary>Mask that determines the metric to retrieve in TBMETRICS.</summary>
[PInvokeData("Commctrl.h")]
[Flags]
public enum TBMF : uint
{
/// <summary>Retrieve the cxPad and cyPad values.</summary>
TBMF_PAD = 0x00000001,
/// <summary>Retrieve the cxBarPad and cyBarPad values.</summary>
TBMF_BARPAD = 0x00000002,
/// <summary>Retrieve the cxButtonSpacing and cyButtonSpacing values.</summary>
TBMF_BUTTONSPACING = 0x00000004,
}
/// <summary>Set of flags that indicate which members of NMTBDISPINFO are being requested.</summary>
[PInvokeData("Commctrl.h")]
[Flags]
public enum TBNF : uint
{
/// <summary>The item's image index is being requested. The image index must be placed in the iImage member.</summary>
TBNF_IMAGE = 0x00000001,
/// <summary>Not currently implemented.</summary>
TBNF_TEXT = 0x00000002,
/// <summary>
/// Set this flag when processing TBN_GETDISPINFO; the toolbar control will retain the supplied information and not request it again.
/// </summary>
TBNF_DI_SETITEM = 0x10000000,
}
/// <summary>State values used by TB_GETSTATE and TB_SETSTATE.</summary>
[PInvokeData("Commctrl.h")]
[Flags]
public enum TBSTATE : byte
{
/// <summary>The button has the TBSTYLE_CHECK style and is being clicked.</summary>
TBSTATE_CHECKED = 0x01,
/// <summary>Version 4.70. The button's text is cut off and an ellipsis is displayed.</summary>
TBSTATE_ELLIPSES = 0x40,
/// <summary>The button accepts user input. A button that does not have this state is grayed.</summary>
TBSTATE_ENABLED = 0x04,
/// <summary>The button is not visible and cannot receive user input.</summary>
TBSTATE_HIDDEN = 0x08,
/// <summary>The button is grayed.</summary>
TBSTATE_INDETERMINATE = 0x10,
/// <summary>Version 4.71. The button is marked. The interpretation of a marked item is dependent upon the application.</summary>
TBSTATE_MARKED = 0x80,
/// <summary>The button is being clicked.</summary>
TBSTATE_PRESSED = 0x02,
/// <summary>The button is followed by a line break. The button must also have the TBSTATE_ENABLED state.</summary>
TBSTATE_WRAP = 0x20,
}
/// <summary>Toolbar Control Messages</summary>
[PInvokeData("Commctrl.h")]
public enum ToolbarMessage
{
/// <summary>
/// Checks or unchecks a given button in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button to check.</para>
/// <para><em>lParam</em></para>
/// <para>
/// The <c>LOWORD</c> is a <c>BOOL</c> that indicates whether to check or uncheck the specified button. If <c>TRUE</c>, the check
/// is added. If <c>FALSE</c>, the check is removed.
/// </para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
/// <remarks>When a button is checked, it is displayed in the pressed state.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-checkbutton
TB_CHECKBUTTON = WindowMessage.WM_USER + 2,
/// <summary>
/// Presses or releases the specified button in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button to press or release.</para>
/// <para><em>lParam</em></para>
/// <para>
/// The <c>LOWORD</c> is a <c>BOOL</c> that indicates whether to press or release the specified button. If <c>TRUE</c>, the
/// button is pressed. If <c>FALSE</c>, the button is released.
/// </para>
/// <para>The <c>HIWORD</c> must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-pressbutton
TB_PRESSBUTTON = WindowMessage.WM_USER + 3,
/// <summary>
/// Hides or shows the specified button in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button to hide or show.</para>
/// <para><em>lParam</em></para>
/// <para>
/// The <c>LOWORD</c> is a <c>BOOL</c> that indicates whether to hide or show the specified button. If <c>TRUE</c>, the button is
/// hidden. If <c>FALSE</c>, the button is shown.
/// </para>
/// <para>The <c>HIWORD</c> must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-hidebutton
TB_HIDEBUTTON = WindowMessage.WM_USER + 4,
/// <summary>
/// Sets or clears the indeterminate state of the specified button in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button whose indeterminate state is to be set or cleared.</para>
/// <para><em>lParam</em></para>
/// <para>
/// The <c>LOWORD</c> is a <c>BOOL</c> that indicates whether to set or clear the indeterminate state. If <c>TRUE</c>, the
/// indeterminate state is set. If <c>FALSE</c>, the state is cleared.
/// </para>
/// <para>The <c>HIWORD</c> must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-indeterminate
TB_INDETERMINATE = WindowMessage.WM_USER + 5,
/// <summary>
/// Sets the highlight state of a given button in a toolbar control.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier for a toolbar button.</para>
/// <para><em>lParam</em></para>
/// <para>
/// The <c>LOWORD</c> is a <c>BOOL</c> that indicates the new highlight state. If <c>TRUE</c>, the button is highlighted. If
/// <c>FALSE</c>, the button is set to its default state.
/// </para>
/// <para>The <c>HIWORD</c> must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns nonzero if successful, or zero otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-markbutton
TB_MARKBUTTON = WindowMessage.WM_USER + 6,
/// <summary>
/// Determines whether the specified button in a toolbar is enabled.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns nonzero if the button is enabled, or zero otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-isbuttonenabled
TB_ISBUTTONENABLED = WindowMessage.WM_USER + 9,
/// <summary>
/// Determines whether the specified button in a toolbar is checked.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns nonzero if the button is checked, or zero otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-isbuttonchecked
TB_ISBUTTONCHECKED = WindowMessage.WM_USER + 10,
/// <summary>
/// Determines whether the specified button in a toolbar is pressed.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns nonzero if the button is pressed, or zero otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-isbuttonpressed
TB_ISBUTTONPRESSED = WindowMessage.WM_USER + 11,
/// <summary>
/// Determines whether the specified button in a toolbar is hidden.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns nonzero if the button is hidden, or zero otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-isbuttonhidden
TB_ISBUTTONHIDDEN = WindowMessage.WM_USER + 12,
/// <summary>
/// Determines whether the specified button in a toolbar is indeterminate.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns nonzero if the button is indeterminate, or zero otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-isbuttonindeterminate
TB_ISBUTTONINDETERMINATE = WindowMessage.WM_USER + 13,
/// <summary>
/// Checks the highlight state of a toolbar button.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier for a toolbar button.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns nonzero if the button is highlighted, or zero otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-isbuttonhighlighted
TB_ISBUTTONHIGHLIGHTED = WindowMessage.WM_USER + 14,
/// <summary>
/// Sets the state for the specified button in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button.</para>
/// <para><em>lParam</em></para>
/// <para>The <c>LOWORD</c> is a combination of values listed in Toolbar Button States. The <c>HIWORD</c> must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-setstate
TB_SETSTATE = WindowMessage.WM_USER + 17,
/// <summary>
/// Retrieves information about the state of the specified button in a toolbar, such as whether it is enabled, pressed, or checked.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier of the button for which to retrieve information.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>
/// Returns the button state information if successful, or -1 otherwise. The button state information can be a combination of the
/// values listed in <c>Toolbar Button States</c>.
/// </para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-getstate
TB_GETSTATE = WindowMessage.WM_USER + 18,
/// <summary>
/// Adds one or more images to the list of button images available for a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Number of button images in the bitmap. If lParam specifies a system-defined bitmap, this parameter is ignored.</para>
/// <para><em>lParam</em></para>
/// <para>
/// Pointer to a <c>TBADDBITMAP</c> structure that contains the identifier of a bitmap resource and the handle to the module
/// instance with the executable file that contains the bitmap resource.
/// </para>
/// <para><strong>Returns</strong></para>
/// <para>Returns the index of the first new image if successful, or -1 otherwise.</para>
/// </summary>
/// <remarks>
/// If the toolbar was created using the <c>CreateWindowEx</c> function, you must send the <c>TB_BUTTONSTRUCTSIZE</c> message to
/// the toolbar before sending <c>TB_ADDBITMAP</c>.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-addbitmap
TB_ADDBITMAP = WindowMessage.WM_USER + 19,
/// <summary>
/// Adds one or more buttons to a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Number of buttons to add.</para>
/// <para><em>lParam</em></para>
/// <para>
/// Pointer to an array of <c>TBBUTTON</c> structures that contain information about the buttons to add. There must be the same
/// number of elements in the array as buttons specified by wParam.
/// </para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
/// <remarks>
/// <para>
/// If the toolbar was created using the <c>CreateWindowEx</c> function, you must send the <c>TB_BUTTONSTRUCTSIZE</c> message to
/// the toolbar before sending <c>TB_ADDBUTTONS</c>.
/// </para>
/// <para>See <c>TB_SETIMAGELIST</c> for a discussion of how to assign bitmaps to toolbar buttons from one or more image lists.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-addbuttons
TB_ADDBUTTONSA = WindowMessage.WM_USER + 20,
/// <summary>
/// Inserts a button in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Zero-based index of a button. The message inserts the new button to the left of this button.</para>
/// <para><em>lParam</em></para>
/// <para>Pointer to a <c>TBBUTTON</c> structure containing information about the button to insert.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-insertbutton
TB_INSERTBUTTONA = WindowMessage.WM_USER + 21,
/// <summary>
/// Deletes a button from the toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Zero-based index of the button to delete.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-deletebutton
TB_DELETEBUTTON = WindowMessage.WM_USER + 22,
/// <summary>
/// Retrieves information about the specified button in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Zero-based index of the button for which to retrieve information.</para>
/// <para><em>lParam</em></para>
/// <para>Pointer to the <c>TBBUTTON</c> structure that receives the button information.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-getbutton
TB_GETBUTTON = WindowMessage.WM_USER + 23,
/// <summary>
/// Retrieves a count of the buttons currently in the toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Must be zero.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns the count of the buttons.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-buttoncount
TB_BUTTONCOUNT = WindowMessage.WM_USER + 24,
/// <summary>
/// Retrieves the zero-based index for the button associated with the specified command identifier.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Command identifier associated with the button.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns the zero-based index for the button or -1 if the specified command identifier is invalid.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-commandtoindex
TB_COMMANDTOINDEX = WindowMessage.WM_USER + 25,
/// <summary>
/// Send this message to initiate saving or restoring a toolbar state.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>
/// Save or restore flag. If this parameter is <c>TRUE</c>, the information is saved. If it is <c>FALSE</c>, the information is restored.
/// </para>
/// <para><em>lParam</em></para>
/// <para>
/// Pointer to a <c>TBSAVEPARAMS</c> structure that specifies the registry key, subkey, and value name for the toolbar state information.
/// </para>
/// <para><strong>Returns</strong></para>
/// <para>No return value.</para>
/// </summary>
/// <remarks>
/// <para>
/// For version 4.72 and earlier, to use this message to save or restore a toolbar, the parent window of the toolbar control must
/// implement a handler for the TBN_GETBUTTONINFO notification code. The toolbar issues this notification to retrieve information
/// about each button as it is restored.
/// </para>
/// <para>
/// Version 5.80 includes a new save/restore option. At the beginning of the process, and as each button is saved or restored,
/// your application will receive a TBN_SAVE or TBN_RESTORE notification. To use this option, you must implement notification
/// handlers to provide the Shell with the bitmap and state information it needs to successfully save or restore the toolbar state.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-saverestore
TB_SAVERESTOREA = WindowMessage.WM_USER + 26,
/// <summary>
/// Send this message to initiate saving or restoring a toolbar state.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>
/// Save or restore flag. If this parameter is <c>TRUE</c>, the information is saved. If it is <c>FALSE</c>, the information is restored.
/// </para>
/// <para><em>lParam</em></para>
/// <para>
/// Pointer to a <c>TBSAVEPARAMS</c> structure that specifies the registry key, subkey, and value name for the toolbar state information.
/// </para>
/// <para><strong>Returns</strong></para>
/// <para>No return value.</para>
/// </summary>
/// <remarks>
/// <para>
/// For version 4.72 and earlier, to use this message to save or restore a toolbar, the parent window of the toolbar control must
/// implement a handler for the TBN_GETBUTTONINFO notification code. The toolbar issues this notification to retrieve information
/// about each button as it is restored.
/// </para>
/// <para>
/// Version 5.80 includes a new save/restore option. At the beginning of the process, and as each button is saved or restored,
/// your application will receive a TBN_SAVE or TBN_RESTORE notification. To use this option, you must implement notification
/// handlers to provide the Shell with the bitmap and state information it needs to successfully save or restore the toolbar state.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-saverestore
TB_SAVERESTOREW = WindowMessage.WM_USER + 76,
/// <summary>
/// Displays the <c>Customize Toolbar</c> dialog box.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Must be zero.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>No return value.</para>
/// </summary>
/// <remarks>
/// <para>Note</para>
/// <para>
/// The toolbar must handle the TBN_QUERYINSERT and TBN_QUERYDELETE notifications for the <c>Customize Toolbar</c> dialog box to
/// appear. If the toolbar does not handle those notifications, <c>TB_CUSTOMIZE</c> has no effect.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-customize
TB_CUSTOMIZE = WindowMessage.WM_USER + 27,
/// <summary>
/// Adds a new string to the toolbar's string pool.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>
/// Handle to the module instance with an executable file that contains the string resource. If lParam instead points to a
/// character array with one or more strings, set this parameter to <c>NULL</c>.
/// </para>
/// <para><em>lParam</em></para>
/// <para>Resource identifier for the string resource, or a pointer to a TCHAR array. See Remarks.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns the index of the first new string if successful, or -1 otherwise.</para>
/// </summary>
/// <remarks>
/// <para>
/// If wParam is <c>NULL</c>, lParam points to a character array with one or more null-terminated strings. The last string in the
/// array must be terminated with two null characters.
/// </para>
/// <para>
/// If wParam is the HINSTANCE of the application or of another module containing a string resource, lParam is the resource
/// identifier of the string. Each item in the string must begin with an arbitrary separator character, and the string must end
/// with two such characters. For example, the text for three buttons might appear in the string table as "/New/Open/Save//". The
/// message returns the index of "New" in the toolbar's string pool, and the other items are in consecutive positions.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-addstring
TB_ADDSTRINGA = WindowMessage.WM_USER + 28,
/// <summary>
/// Adds a new string to the toolbar's string pool.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>
/// Handle to the module instance with an executable file that contains the string resource. If lParam instead points to a
/// character array with one or more strings, set this parameter to <c>NULL</c>.
/// </para>
/// <para><em>lParam</em></para>
/// <para>Resource identifier for the string resource, or a pointer to a TCHAR array. See Remarks.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns the index of the first new string if successful, or -1 otherwise.</para>
/// </summary>
/// <remarks>
/// <para>
/// If wParam is <c>NULL</c>, lParam points to a character array with one or more null-terminated strings. The last string in the
/// array must be terminated with two null characters.
/// </para>
/// <para>
/// If wParam is the HINSTANCE of the application or of another module containing a string resource, lParam is the resource
/// identifier of the string. Each item in the string must begin with an arbitrary separator character, and the string must end
/// with two such characters. For example, the text for three buttons might appear in the string table as "/New/Open/Save//". The
/// message returns the index of "New" in the toolbar's string pool, and the other items are in consecutive positions.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-addstring
TB_ADDSTRINGW = WindowMessage.WM_USER + 77,
/// <summary>
/// Retrieves the bounding rectangle of a button in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Zero-based index of the button for which to retrieve information.</para>
/// <para><em>lParam</em></para>
/// <para>Pointer to a <c>RECT</c> structure that receives the client coordinates of the bounding rectangle.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
/// <remarks>
/// This message does not retrieve the bounding rectangle for buttons whose state is set to the <c>TBSTATE_HIDDEN</c> value.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-getitemrect
TB_GETITEMRECT = WindowMessage.WM_USER + 29,
/// <summary>
/// Specifies the size of the <c>TBBUTTON</c> structure.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Size, in bytes, of the <c>TBBUTTON</c> structure.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>No return value.</para>
/// </summary>
/// <remarks>
/// <para>The system uses the size to determine which version of the common control dynamic-link library (DLL) is being used.</para>
/// <para>
/// If an application uses the <c>CreateWindowEx</c> function to create the toolbar, the application must send this message to
/// the toolbar before sending the <c>TB_ADDBITMAP</c> or <c>TB_ADDBUTTONS</c> message. The <c>CreateToolbarEx</c> function
/// automatically sends <c>TB_BUTTONSTRUCTSIZE</c>, and the size of the <c>TBBUTTON</c> structure is a parameter of the function.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-buttonstructsize
TB_BUTTONSTRUCTSIZE = WindowMessage.WM_USER + 30,
/// <summary>
/// Sets the size of buttons on a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Must be zero.</para>
/// <para><em>lParam</em></para>
/// <para>
/// The <c>LOWORD</c> specifies the width, in pixels, of the buttons. The <c>HIWORD</c> specifies the height, in pixels, of the buttons.
/// </para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
/// <remarks>
/// <para><c>TB_SETBUTTONSIZE</c> should generally be called after adding buttons.</para>
/// <para>
/// Use <c>TB_SETBUTTONWIDTH</c> to set the maximum and minimum allowed widths for buttons before they are added. Use
/// <c>TB_SETBUTTONSIZE</c> to set the actual size of buttons.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-setbuttonsize
TB_SETBUTTONSIZE = WindowMessage.WM_USER + 31,
/// <summary>
/// Sets the size of the bitmapped images to be added to a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Must be zero.</para>
/// <para><em>lParam</em></para>
/// <para>
/// The <c>LOWORD</c> specifies the width, in pixels, of the bitmapped images. The <c>HIWORD</c> specifies the height, in pixels,
/// of the bitmapped images.
/// </para>
/// <para><strong>Returns</strong></para>
/// <para>Returns <c>TRUE</c> if successful, or <c>FALSE</c> otherwise.</para>
/// </summary>
/// <remarks>
/// The size can be set only before adding any bitmaps to the toolbar. If an application does not explicitly set the bitmap size,
/// the size defaults to 16 by 15 pixels.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-setbitmapsize
TB_SETBITMAPSIZE = WindowMessage.WM_USER + 32,
/// <summary>
/// Causes a toolbar to be resized.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Must be zero.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>No return value.</para>
/// </summary>
/// <remarks>
/// An application sends the <c>TB_AUTOSIZE</c> message after causing the size of a toolbar to change either by setting the
/// button or bitmap size or by adding strings for the first time.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-autosize
TB_AUTOSIZE = WindowMessage.WM_USER + 33,
/// <summary>
/// Retrieves the handle to the tooltip control, if any, associated with the toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Must be zero.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns the handle to the tooltip control, or <c>NULL</c> if the toolbar has no associated tooltip.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-gettooltips
TB_GETTOOLTIPS = WindowMessage.WM_USER + 35,
/// <summary>
/// Associates a tooltip control with a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Handle to the tooltip control.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>No return value.</para>
/// </summary>
/// <remarks>
/// Any buttons added to a toolbar before sending the <c>TB_SETTOOLTIPS</c> message will not be registered with the tooltip control.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-settooltips
TB_SETTOOLTIPS = WindowMessage.WM_USER + 36,
/// <summary>
/// Sets the window to which the toolbar control sends notification messages.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Handle to the window to receive notification messages.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>
/// The return value is a handle to the previous notification window, or <c>NULL</c> if there is no previous notification window.
/// </para>
/// </summary>
/// <remarks>
/// The <c>TB_SETPARENT</c> message does not change the parent window that was specified when the control was created. Calling
/// the <c>GetParent</c> function for a toolbar control will return the actual parent window, not the window specified in
/// <c>TB_SETPARENT</c>. To change the control's parent window, call the <c>SetParent</c> function.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-setparent
TB_SETPARENT = WindowMessage.WM_USER + 37,
/// <summary>
/// Sets the number of rows of buttons in a toolbar.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>
/// The <c>LOWORD</c> specifies the number of rows requested. The minimum number of rows is one, and the maximum number of rows
/// is equal to the number of buttons in the toolbar.
/// </para>
/// <para>
/// The <c>HIWORD</c> is a <c>BOOL</c> that indicates whether to create more rows than requested when the system cannot create
/// the number of rows specified by wParam. If <c>TRUE</c>, the system creates more rows. If <c>FALSE</c>, the system creates
/// fewer rows.
/// </para>
/// <para><em>lParam</em></para>
/// <para>Pointer to a <c>RECT</c> structure that receives the bounding rectangle of the toolbar after the rows are set.</para>
/// <para><strong>Returns</strong></para>
/// <para>No return value.</para>
/// </summary>
/// <remarks>
/// Because the system does not break up button groups when setting the number of rows, the resulting number of rows might differ
/// from the number requested.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-setrows
TB_SETROWS = WindowMessage.WM_USER + 39,
/// <summary>
/// Retrieves the number of rows of buttons in a toolbar with the <c>TBSTYLE_WRAPABLE</c> style.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Must be zero.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>Returns the number of rows.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/controls/tb-getrows
TB_GETROWS = WindowMessage.WM_USER + 40,
/// <summary>
/// Retrieves the flags that describe the type of bitmap to be used.
/// <para><strong>Parameters</strong></para>
/// <para><em>wParam</em></para>
/// <para>Must be zero.</para>
/// <para><em>lParam</em></para>
/// <para>Must be zero.</para>
/// <para><strong>Returns</strong></para>
/// <para>
/// Returns a <c>DWORD</c> value that describes the type of bitmap that should be used. If this return value has the TBBF_LARGE
/// flag set, applications should use large bitmaps (24 x 24); otherwise, applications should use small bitmaps (16 x 16). All
/// other bits are reserved.
/// </para>
/// </summary>
/// <remarks>