forked from dahall/Vanara
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShObjIdl.INamespaceTreeControl.cs
2166 lines (2012 loc) · 110 KB
/
ShObjIdl.INamespaceTreeControl.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 System.Text;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>Indicates which button was clicked and the kind of click.</summary>
[PInvokeData("shobjidl.h", MSDNShortId = "a595ffd0-edc6-4726-b7b2-ad1aed9e9701")]
[Flags]
public enum NSTCECLICKTYPE
{
/// <summary>The left button was clicked.</summary>
NSTCECT_LBUTTON = 0x0001,
/// <summary>The middle button was clicked.</summary>
NSTCECT_MBUTTON = 0x0002,
/// <summary>The right button was clicked.</summary>
NSTCECT_RBUTTON = 0x0003,
/// <summary>A button was clicked.</summary>
NSTCECT_BUTTON = 0x0003,
/// <summary>The click was a double click. If this value is present, it is added to one of the other values.</summary>
NSTCECT_DBLCLICK = 0x0004,
}
/// <summary>The location on the IShellItem that was clicked.</summary>
[PInvokeData("shobjidl.h", MSDNShortId = "a595ffd0-edc6-4726-b7b2-ad1aed9e9701")]
[Flags]
public enum NSTCEHITTEST
{
/// <summary>The click missed the IShellItem.</summary>
NSTCEHT_NOWHERE = 0x0001,
/// <summary>The click was on the icon of the IShellItem.</summary>
NSTCEHT_ONITEMICON = 0x0002,
/// <summary>The click was on the label text of the IShellItem.</summary>
NSTCEHT_ONITEMLABEL = 0x0004,
/// <summary>The click was on the indented space on the leftmost side of the IShellItem.</summary>
NSTCEHT_ONITEMINDENT = 0x0008,
/// <summary>The click was on the expando button of the IShellItem.</summary>
NSTCEHT_ONITEMBUTTON = 0x0010,
/// <summary>The click was on the rightmost side of the text of the IShellItem.</summary>
NSTCEHT_ONITEMRIGHT = 0x0020,
/// <summary>The click was on the state icon of the IShellItem.</summary>
NSTCEHT_ONITEMSTATEICON = 0x0040,
/// <summary>The click was on the item icon or the item label or the state icon of the IShellItem.</summary>
NSTCEHT_ONITEM = 0x0046,
/// <summary>The click was on the tab button of the IShellItem.</summary>
NSTCEHT_ONITEMTABBUTTON = 0x1000,
};
/// <summary>
/// Specifies the state of a tree item. These values are used by methods of the INameSpaceTreeControlFolderCapabilities interface.
/// </summary>
/// <remarks>The <c>NSTCFOLDERCAPABILITIES</c> type is defined in Shobjidl.h beginning in Windows 7.</remarks>
// https://docs.microsoft.com/ja-jp/windows/win32/api/shobjidl_core/ne-shobjidl_core-nstcfoldercapabilities
[PInvokeData("shobjidl_core.h", MSDNShortId = "a5282277-85f5-494e-b994-efbf1116b519")]
[Flags]
public enum NSTCFOLDERCAPABILITIES
{
/// <summary>The property does not exist. Filtering is not supported.</summary>
NSTCFC_NONE = 0,
/// <summary>Property exists. Supports filtering based on the value specified in System.IsPinnedToNameSpaceTree.</summary>
NSTCFC_PINNEDITEMFILTERING = 1,
/// <summary>Delays registration for change notifications until the tree is expanded in the navigation pane.</summary>
NSTCFC_DELAY_REGISTER_NOTIFY = 2,
}
/// <summary>The type of the next item.</summary>
[PInvokeData("shobjidl_core.h", MSDNShortId = "71ede595-14b6-4e59-854a-af75c02093f8")]
public enum NSTCGNI
{
/// <summary>The next sibling of the given item.</summary>
NSTCGNI_NEXT = 0,
/// <summary>
/// The next visible item in the tree that has any relationship to the given item. This includes a child (if there is one), the
/// next sibling, or even one of the ancestor's siblings.
/// </summary>
NSTCGNI_NEXTVISIBLE = 1,
/// <summary>The previous sibling item of the given item.</summary>
NSTCGNI_PREV = 2,
/// <summary>The previous visible item that is a sibling item, sibling descendent item or a parent item.</summary>
NSTCGNI_PREVVISIBLE = 3,
/// <summary>The parent item of the given item.</summary>
NSTCGNI_PARENT = 4,
/// <summary>The first child item of the given item.</summary>
NSTCGNI_CHILD = 5,
/// <summary>The absolute first visible item in the tree (not relative to the given item).</summary>
NSTCGNI_FIRSTVISIBLE = 6,
/// <summary>The absolute last visible item in the tree (not relative to the given item).</summary>
NSTCGNI_LASTVISIBLE = 7,
}
/// <summary>Specifies the state of a tree item. These values are used by methods of the INameSpaceTreeControl interface.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/ne-shobjidl_core-_nstcitemstate typedef enum _NSTCITEMSTATE {
// NSTCIS_NONE, NSTCIS_SELECTED, NSTCIS_EXPANDED, NSTCIS_BOLD, NSTCIS_DISABLED, NSTCIS_SELECTEDNOEXPAND } ;
[PInvokeData("shobjidl_core.h", MSDNShortId = "1f3fd526-c044-41ff-9e05-c6d91d386b42")]
[Flags]
public enum NSTCITEMSTATE : uint
{
/// <summary>The item has default state; it is not selected, expanded, bolded or disabled.</summary>
NSTCIS_NONE = 0x0000,
/// <summary>The item is selected.</summary>
NSTCIS_SELECTED = 0x0001,
/// <summary>The item is expanded.</summary>
NSTCIS_EXPANDED = 0x0002,
/// <summary>The item is bold.</summary>
NSTCIS_BOLD = 0x0004,
/// <summary>The item is disabled.</summary>
NSTCIS_DISABLED = 0x0008,
/// <summary>Windows 7 and later. The item is selected, but not expanded.</summary>
NSTCIS_SELECTEDNOEXPAND = 0x0010,
}
/// <summary>Specifies the style of the root that is being appended.</summary>
[PInvokeData("shobjidl_core.h", MSDNShortId = "a280d183-9215-43c2-bba3-63c34ba33285")]
[Flags]
public enum NSTCROOTSTYLE : uint
{
/// <summary>The root is visible as well as the items. Mutually exclusive with NSTCRS_HIDDEN.</summary>
NSTCRS_VISIBLE = 0x0000,
/// <summary>The root is hidden so that the children only are visible. Mutually exclusive with NSTCRS_VISIBLE.</summary>
NSTCRS_HIDDEN = 0x0001,
/// <summary>The root is expanded upon initialization.</summary>
NSTCRS_EXPANDED = 0x0002,
}
/// <summary>Describes the characteristics of a given namespace tree control.</summary>
/// <remarks>
/// <para>
/// Three values have effect only in conjunction with NSTCS_CHECKBOXES: NSTCS_PARTIALCHECKBOXES, NSTCS_EXCLUSIONCHECKBOXES, and
/// NSTCS_DIMMEDCHECKBOXES. The icons associated with these states are inserted into the state image list as follows:
/// </para>
/// <list type="table">
/// <listheader>
/// <term>Image Slot</term>
/// <term>Image</term>
/// <term>Associated Flags</term>
/// </listheader>
/// <item>
/// <term>0</term>
/// <term>Blank</term>
/// <term>NSTCS_CHECKBOXES</term>
/// </item>
/// <item>
/// <term>1</term>
/// <term>Unchecked</term>
/// <term>NSTCS_CHECKBOXES</term>
/// </item>
/// <item>
/// <term>2</term>
/// <term>Checked</term>
/// <term>NSTCS_CHECKBOXES</term>
/// </item>
/// <item>
/// <term>3</term>
/// <term>Partial</term>
/// <term>NSTCS_CHECKBOXES | NSTCS_PARTIALCHECKBOXES</term>
/// </item>
/// <item>
/// <term>4</term>
/// <term>Exclusion (red X)</term>
/// <term>NSTCS_CHECKBOXES | NSTCS_EXCLUSIONCHECKBOXES</term>
/// </item>
/// </list>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/ne-shobjidl_core-_nstcstyle typedef enum _NSTCSTYLE {
// NSTCS_HASEXPANDOS, NSTCS_HASLINES, NSTCS_SINGLECLICKEXPAND, NSTCS_FULLROWSELECT, NSTCS_SPRINGEXPAND, NSTCS_HORIZONTALSCROLL,
// NSTCS_ROOTHASEXPANDO, NSTCS_SHOWSELECTIONALWAYS, NSTCS_NOINFOTIP, NSTCS_EVENHEIGHT, NSTCS_NOREPLACEOPEN, NSTCS_DISABLEDRAGDROP,
// NSTCS_NOORDERSTREAM, NSTCS_RICHTOOLTIP, NSTCS_BORDER, NSTCS_NOEDITLABELS, NSTCS_TABSTOP, NSTCS_FAVORITESMODE, NSTCS_AUTOHSCROLL,
// NSTCS_FADEINOUTEXPANDOS, NSTCS_EMPTYTEXT, NSTCS_CHECKBOXES, NSTCS_PARTIALCHECKBOXES, NSTCS_EXCLUSIONCHECKBOXES,
// NSTCS_DIMMEDCHECKBOXES, NSTCS_NOINDENTCHECKS, NSTCS_ALLOWJUNCTIONS, NSTCS_SHOWTABSBUTTON, NSTCS_SHOWDELETEBUTTON,
// NSTCS_SHOWREFRESHBUTTON } ;
[PInvokeData("shobjidl_core.h", MSDNShortId = "879af1be-2eea-4ebd-b9ea-64b1db40682d")]
[Flags]
public enum NSTCSTYLE : uint
{
/// <summary>
/// The control displays a triangle—known as an expando—on the leftmost edge of those items that have child items. Clicking on
/// the expando expands the item to reveal the children of the item. Has no effect when combined with NSTCS_SHOWTABSBUTTON,
/// NSTCS_SHOWDELETEBUTTON, or NSTCS_SHOWREFRESHBUTTON. Maps to the TVS_HASBUTTONS tree view control style.
/// </summary>
NSTCS_HASEXPANDOS = 0x00000001,
/// <summary>
/// The control draws lines to the left of the tree items that lead to their individual parent items. Has no effect when
/// combined with NSTCS_SHOWTABSBUTTON, NSTCS_SHOWDELETEBUTTON, or NSTCS_SHOWREFRESHBUTTON. Maps to the TVS_HASLINES tree view
/// control style.
/// </summary>
NSTCS_HASLINES = 0x00000002,
/// <summary>
/// An item expands to show its child items in response to a single mouse click. Maps to the TVS_SINGLEEXPAND tree view control style.
/// </summary>
NSTCS_SINGLECLICKEXPAND = 0x00000004,
/// <summary>
/// The selection of an item fills the row with inverse text to the end of the window area, regardless of the length of the
/// text. When this option is not declared, only the area behind text is inverted. This value cannot be combined with
/// NSTCS_HASLINES. Maps to the TVS_FULLROWSELECT tree view control style.
/// </summary>
NSTCS_FULLROWSELECT = 0x00000008,
/// <summary>
/// When one item is selected and expanded and you select a second item, the first selection automatically collapses. This is
/// the opposite of the TVS_EX_NOSINGLECOLLAPSE tree view control style.
/// </summary>
NSTCS_SPRINGEXPAND = 0x00000010,
/// <summary>
/// The area of the window that contains the tree of namespace items has a horizontal scroll bar. Maps to the WS_HSCROLL Windows style.
/// </summary>
NSTCS_HORIZONTALSCROLL = 0x00000020,
/// <summary>
/// The root item is preceded by an expando that allows expansion of the root item. Maps to the TVS_LINESATROOT tree view
/// control style.
/// </summary>
NSTCS_ROOTHASEXPANDO = 0x00000040,
/// <summary>
/// The node of an item is outlined when the control does not have the focus. Maps to the TVS_SHOWSELALWAYS tree view control style.
/// </summary>
NSTCS_SHOWSELECTIONALWAYS = 0x00000080,
/// <summary>
/// Do not display infotips when the mouse cursor is over an item. This is the opposite of the TVS_INFOTIP tree view control style.
/// </summary>
NSTCS_NOINFOTIP = 0x00000200,
/// <summary>
/// Sets the height of the items to an even height. By default, the height of items can be even or odd. This is the opposite of
/// the TVS_NONEVENHEIGHT tree view control style.
/// </summary>
NSTCS_EVENHEIGHT = 0x00000400,
/// <summary>Do not replace the Open command in the shortcut menu with a user-defined function.</summary>
NSTCS_NOREPLACEOPEN = 0x00000800,
/// <summary>
/// Do not allow drag-and-drop operations within the control. Note that you can still drag an item from outside of the control
/// and drop it onto the control. Maps to the TVS_DISABLEDRAGDROP tree view control style.
/// </summary>
NSTCS_DISABLEDRAGDROP = 0x00001000,
/// <summary>
/// Do not persist reordering changes. Used with NSTCS_FAVORITESMODE. If favorites mode is not specified, this flag has no effect.
/// </summary>
NSTCS_NOORDERSTREAM = 0x00002000,
/// <summary>
/// Use a rich tooltip. Rich tooltips display the item's icon in addition to the item's text. A standard tooltip displays only
/// the item's text. The tree view displays tooltips only for items in the tree that are partially visible. Maps to the
/// TVS_EX_RICHTOOLTIP tree view control style.NSTCS_RICHTOOLTIP has no effect unless it is combined with NSTCS_NOINFOTIP and/or
/// NSTCS_FAVORITESMODE. If NSTCS_NOINFOTIP is not specified, the tree view displays an infotip instead of a tooltip. If
/// NSTCS_FAVORITESMODE is not specified, the namespace tree control always sets the TVS_EX_RICHTOOLTIP style.
/// </summary>
NSTCS_RICHTOOLTIP = 0x00004000,
/// <summary>Draw a thin border around the control. Corresponds to WS_BORDER.</summary>
NSTCS_BORDER = 0x00008000,
/// <summary>
/// Do not allow creation of an in-place edit box, which would allow the user to rename the given item. This is the opposite of
/// the TVS_EDITLABELS tree view control style.
/// </summary>
NSTCS_NOEDITLABELS = 0x00010000,
/// <summary>If the control is hosted, you can tabstop into the control. Corresponds to WS_EX_CONTROLPARENT.</summary>
NSTCS_TABSTOP = 0x00020000,
/// <summary>The control has the appearance of the favorites band in Windows XP.</summary>
NSTCS_FAVORITESMODE = 0x00080000,
/// <summary>
/// When you hover the mouse pointer over an item that extends past the end of the control window, the control automatically
/// scrolls horizontally so that the item appears more fully in the window area. Maps to the TVS_EX_AUTOHSCROLL tree view
/// control style.
/// </summary>
NSTCS_AUTOHSCROLL = 0x00100000,
/// <summary>
/// If the control does not have the focus and there are items that are preceded by expandos, then these expandos are visible
/// only when the mouse pointer is near to the control. Maps to the TVS_EX_FADEINOUTEXPANDOS tree view control style.
/// </summary>
NSTCS_FADEINOUTEXPANDOS = 0x00200000,
/// <summary>
/// If an item has no children and is not expanded, then that item contains a line of text at the child level that says "empty".
/// </summary>
NSTCS_EMPTYTEXT = 0x00400000,
/// <summary>
/// Items have check boxes on their leftmost side. These check boxes can be of types partial, exclusion or dimmed, which
/// correspond to the flags NSTCS_PARTIALCHECKBOXES, NSTCS_EXCLUSIONCHECKBOXES, and NSTCS_DIMMEDCHECKBOXES. Maps to the
/// TVS_CHECKBOXES tree view control style.
/// </summary>
NSTCS_CHECKBOXES = 0x00800000,
/// <summary>
/// Adds a checkbox icon on the leftmost side of a given item with a square in the center, that indicates that the node is
/// partially selected. Must be combined with NSTCS_CHECKBOXES. Maps to the TVS_EX_PARTIALCHECKBOXES tree view control style.
/// </summary>
NSTCS_PARTIALCHECKBOXES = 0x01000000,
/// <summary>
/// Adds a checkbox icon on the leftmost side of a given item that contains a red X, which indicates that the item is excluded
/// from the current selection. Without this exclusion icon, selection of a parent item includes selection of its child items.
/// Must be combined with NSTCS_CHECKBOXES. Maps to the TVS_EX_EXCLUSIONCHECKBOXES tree view control style.
/// </summary>
NSTCS_EXCLUSIONCHECKBOXES = 0x02000000,
/// <summary>
/// Adds a checkbox on the leftmost side of a given item that contains an icon of a dimmed check mark, that indicates that a
/// node is selected because its parent is selected. Must be combined with NSTCS_CHECKBOXES. Maps to the TVS_EX_DIMMEDCHECKBOXES
/// tree view control style.
/// </summary>
NSTCS_DIMMEDCHECKBOXES = 0x04000000,
/// <summary>
/// Check boxes are located at the far left edge of the window area instead of being indented. Maps to the TVS_EX_NOINDENTSTATE
/// tree view control style.
/// </summary>
NSTCS_NOINDENTCHECKS = 0x08000000,
/// <summary>
/// Allow junctions. A junction point, or just junction, is a root of a namespace extension that is normally displayed by
/// Windows Explorer as a folder in both tree and folder views. For Windows Explorer to display your extension's files and
/// subfolders, you must specify where the root folder is located in the Shell namespace hierarchy. Junctions exist in the file
/// system as files, but are not treated as files. An example is a compressed file with a .zip file name extension, which to the
/// file system is just a file. However, if this file is treated as a junction, it can represent an entire namespace. This
/// allows the namespace tree control to treat compressed files and similar junctions as folders rather than as files.
/// </summary>
NSTCS_ALLOWJUNCTIONS = 0x10000000,
/// <summary>
/// Displays an arrow on the right side of an item if the item is a folder. The action associated with the arrow is
/// implementation specific. Cannot be combined with NSTCS_SHOWDELETEBUTTON or NSTCS_SHOWREFRESHBUTTON.
/// </summary>
NSTCS_SHOWTABSBUTTON = 0x20000000,
/// <summary>
/// Displays a red X on the right side of an item. The action associated with the X is implementation specific. Cannot be
/// combined with NSTCS_SHOWTABSBUTTON or NSTCS_SHOWREFRESHBUTTON.
/// </summary>
NSTCS_SHOWDELETEBUTTON = 0x40000000,
/// <summary>
/// Displays a refresh button on the right side of an item. The action associated with the button is implementation specific.
/// Cannot be combined with NSTCS_SHOWTABSBUTTON or NSTCS_SHOWDELETEBUTTON.
/// </summary>
NSTCS_SHOWREFRESHBUTTON = 0x80000000,
}
/// <summary>Used by methods of the INameSpaceTreeControl2 to specify extended display styles in a Shell namespace treeview.</summary>
/// <remarks>
/// The value NSTCS2_ALLMASK can be used to mask for the NSTCS2_INTERRUPTNOTIFICATIONS, NSTCS2_SHOWNULLSPACEMENU, and
/// NSTCS2_DISPLAYPADDING values.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/ne-shobjidl-nstcstyle2 typedef enum NSTCSTYLE2 { NSTCS2_DEFAULT,
// NSTCS2_INTERRUPTNOTIFICATIONS, NSTCS2_SHOWNULLSPACEMENU, NSTCS2_DISPLAYPADDING, NSTCS2_DISPLAYPINNEDONLY,
// NTSCS2_NOSINGLETONAUTOEXPAND, NTSCS2_NEVERINSERTNONENUMERATED } ;
[PInvokeData("shobjidl.h", MSDNShortId = "0bfa6900-71c0-44b7-8157-662bee58e6c9")]
[Flags]
public enum NSTCSTYLE2
{
/// <summary>Displays the tree nodes in default mode, which includes none of the following values.</summary>
NSTCS2_DEFAULT = 0x00000000,
/// <summary>Displays interrupt notifications.</summary>
NSTCS2_INTERRUPTNOTIFICATIONS = 0x00000001,
/// <summary>Displays the context menu in the padding space.</summary>
NSTCS2_SHOWNULLSPACEMENU = 0x00000002,
/// <summary>Inserts spacing (padding) between top-level nodes.</summary>
NSTCS2_DISPLAYPADDING = 0x00000004,
/// <summary>
/// Filters items based on the System.IsPinnedToNameSpaceTree value when INameSpaceTreeControlFolderCapabilities is implemented.
/// </summary>
NSTCS2_DISPLAYPINNEDONLY = 0x00000008,
/// <summary/>
NTSCS2_NOSINGLETONAUTOEXPAND = 0x00000010,
/// <summary>Do not insert nonenumerated (SFGAO_NONENUMERATED) items in the tree.</summary>
NTSCS2_NEVERINSERTNONENUMERATED = 0x00000020,
}
/// <summary>Exposes methods that perform accessibility actions on a Shell item from a namespace tree control.</summary>
/// <remarks>This interface is used only by INameSpaceTreeControl (CLSID_NameSpaceTreeControl).</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-inamespacetreeaccessible
[PInvokeData("shobjidl.h", MSDNShortId = "b14dfe40-e21a-4208-835f-e0febef60783")]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("71f312de-43ed-4190-8477-e9536b82350b"), CoClass(typeof(NameSpaceTreeControl))]
public interface INameSpaceTreeAccessible
{
/// <summary>Gets the default accessibility action for a Shell item.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>Pointer to the IShellItem.</para>
/// </param>
/// <param name="pbstrDefaultAction">
/// <para>Type: <c>BSTR*</c></para>
/// <para>When this method returns, contains a BSTR that specifies the default, accessibility action.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>Returns S_OK if successful, or E_OUTOFMEMORY otherwise.</para>
/// </returns>
/// <remarks>This method is called when the default accessibililty action for a Shell item is retrieved.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-inamespacetreeaccessible-ongetdefaultaccessibilityaction
// HRESULT OnGetDefaultAccessibilityAction( IShellItem *psi, BSTR *pbstrDefaultAction );
[PreserveSig]
HRESULT OnGetDefaultAccessibilityAction([In] IShellItem psi, [MarshalAs(UnmanagedType.BStr)] out string pbstrDefaultAction);
/// <summary>Invokes the default accessibility action on a Shell item.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>Pointer to the IShellItem.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-inamespacetreeaccessible-ondodefaultaccessibilityaction
// HRESULT OnDoDefaultAccessibilityAction( IShellItem *psi );
[PreserveSig]
HRESULT OnDoDefaultAccessibilityAction([In] IShellItem psi);
/// <summary>Gets the accessibility role for a Shell item.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>Pointer to the IShellItem.</para>
/// </param>
/// <param name="pvarRole">
/// <para>Type: <c>VARIANT*</c></para>
/// <para>When this method returns, contains a VARIANT that specifies the role.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>This method is called when the accessibility role for a Shell item is retrieved.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-inamespacetreeaccessible-ongetaccessibilityrole
// HRESULT OnGetAccessibilityRole( IShellItem *psi, VARIANT *pvarRole );
[PreserveSig]
HRESULT OnGetAccessibilityRole([In] IShellItem psi, out object pvarRole);
}
/// <summary>Exposes methods used to view and manipulate nodes in a tree of Shell items.</summary>
/// <remarks>To implement this interface use class ID CLSID_NameSpaceTreeControl.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-inamespacetreecontrol
[PInvokeData("shobjidl_core.h", MSDNShortId = "2072cb3c-e540-4708-bfe8-33fff3a190bd")]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("028212A3-B627-47e9-8856-C14265554E4F"), CoClass(typeof(NameSpaceTreeControl))]
public interface INameSpaceTreeControl
{
/// <summary>Initializes an INameSpaceTreeControl object.</summary>
/// <param name="hwndParent">
/// <para>Type: <c>HWND</c></para>
/// <para>The handle of the parent window.</para>
/// </param>
/// <param name="prc">
/// <para>Type: <c>RECT*</c></para>
/// <para>A pointer to a RECT structure that describes the size and position of the control in the client window.</para>
/// </param>
/// <param name="nsctsFlags">
/// <para>Type: <c>NSTCSTYLE</c></para>
/// <para>The characteristics of the given namespace tree control. One or more of the following values from the NSTCSTYLE enumeration.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-initialize HRESULT
// Initialize( HWND hwndParent, RECT *prc, NSTCSTYLE nsctsFlags );
[PreserveSig]
HRESULT Initialize(HWND hwndParent, in RECT prc, NSTCSTYLE nsctsFlags);
/// <summary>Enables a client to register with the control.</summary>
/// <param name="punk">
/// <para>Type: <c>IUnknown*</c></para>
/// <para>A pointer to the client IUnknown that registers with the control.</para>
/// </param>
/// <param name="pdwCookie">
/// <para>Type: <c>DWORD*</c></para>
/// <para>A pointer to the cookie that is passed back for registration.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>The pointer to the cookie that is passed back is used to unregister the control later with INameSpaceTreeControl::TreeUnadvise.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-treeadvise HRESULT
// TreeAdvise( IUnknown *punk, DWORD *pdwCookie );
[PreserveSig]
HRESULT TreeAdvise([MarshalAs(UnmanagedType.IUnknown)] object punk, out uint pdwCookie);
/// <summary>Enables a client to unregister with the control.</summary>
/// <param name="dwCookie">
/// <para>Type: <c>DWORD*</c></para>
/// <para>A pointer to the cookie that is to be unregistered.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>The pointer to the cookie that is passed in is the one that was passed back in INameSpaceTreeControl::TreeAdvise.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-treeunadvise HRESULT
// TreeUnadvise( DWORD dwCookie );
[PreserveSig]
HRESULT TreeUnadvise(uint dwCookie);
/// <summary>Appends a Shell item to the list of roots in a tree.</summary>
/// <param name="psiRoot">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>Pointer to the Shell item that is being appended.</para>
/// </param>
/// <param name="grfEnumFlags">
/// <para>Type: <c>SHCONTF</c></para>
/// <para>
/// Enumerates the qualities of the root and all of its children. One or more of the values of type SHCONTF. These flags can be
/// combined using a bitwise OR.
/// </para>
/// </param>
/// <param name="grfRootStyle">
/// <para>Type: <c>NSTCROOTSTYLE</c></para>
/// <para>Specifies the style of the root that is being appended. One or more of the following values:</para>
/// <para>NSTCRS_VISIBLE (0x0000)</para>
/// <para>The root is visible as well as the items. Mutually exclusive with NSTCRS_HIDDEN.</para>
/// <para>NSTCRS_HIDDEN (0x0001)</para>
/// <para>The root is hidden so that the children only are visible. Mutually exclusive with NSTCRS_VISIBLE.</para>
/// <para>NSTCRS_EXPANDED (0x0002)</para>
/// <para>The root is expanded upon initialization.</para>
/// </param>
/// <param name="pif">
/// <para>Type: <c>IShellItemFilter*</c></para>
/// <para>
/// Pointer to the IShellItemFilter that enables you to filter which items in the tree are displayed. If supplied, every item is
/// customizable with a SHCONTF flag. This value can be <c>NULL</c> if no filter is required.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-appendroot HRESULT
// AppendRoot( IShellItem *psiRoot, SHCONTF grfEnumFlags, NSTCROOTSTYLE grfRootStyle, IShellItemFilter *pif );
[PreserveSig]
HRESULT AppendRoot(IShellItem psiRoot, SHCONTF grfEnumFlags, NSTCROOTSTYLE grfRootStyle, [In, Optional] IShellItemFilter pif);
/// <summary>Inserts a Shell item on a root item in a tree.</summary>
/// <param name="iIndex">
/// <para>Type: <c>int</c></para>
/// <para>The index at which to insert the root.</para>
/// </param>
/// <param name="psiRoot">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the Shell item that is being inserted.</para>
/// </param>
/// <param name="grfEnumFlags">
/// <para>Type: <c>SHCONTF</c></para>
/// <para>Enumerates the qualities of the root and all of its children. One of the values of type SHCONTF.</para>
/// </param>
/// <param name="grfRootStyle">
/// <para>Type: <c>NSTCROOTSTYLE</c></para>
/// <para>
/// The style of the root that is being inserted. One or more of the following values (flags can be combined using a bitwise OR).
/// </para>
/// <para>NSTCRS_VISIBLE (0x0000)</para>
/// <para>The root is visible as well as the items. Mutually exclusive with NSTCRS_HIDDEN.</para>
/// <para>NSTCRS_HIDDEN (0x0001)</para>
/// <para>The root is hidden so that only the children are visible. Mutually exclusive with NSTCRS_VISIBLE.</para>
/// <para>NSTCRS_EXPANDED (0x0002)</para>
/// <para>The root is expanded upon initialization.</para>
/// </param>
/// <param name="pif">
/// <para>Type: <c>IShellItemFilter*</c></para>
/// <para>
/// A pointer to the IShellItemFilter that enables you to filter which items in the tree are displayed. If supplied, every item
/// is customizable with a SHCONTF flag. This value can be <c>NULL</c> if no filter is required.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-insertroot HRESULT
// InsertRoot( int iIndex, IShellItem *psiRoot, SHCONTF grfEnumFlags, NSTCROOTSTYLE grfRootStyle, IShellItemFilter *pif );
[PreserveSig]
HRESULT InsertRoot(int iIndex, IShellItem psiRoot, SHCONTF grfEnumFlags, NSTCROOTSTYLE grfRootStyle, [In, Optional] IShellItemFilter pif);
/// <summary>Removes a root and its children from a tree.</summary>
/// <param name="psiRoot">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the root that is to be removed.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-removeroot HRESULT
// RemoveRoot( IShellItem *psiRoot );
[PreserveSig]
HRESULT RemoveRoot(IShellItem psiRoot);
/// <summary>Removes all roots and their children from a tree.</summary>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-removeallroots
// HRESULT RemoveAllRoots();
[PreserveSig]
HRESULT RemoveAllRoots();
/// <summary>Gets an array of the root items.</summary>
/// <param name="ppsiaRootItems">
/// <para>Type: <c>IShellItemArray**</c></para>
/// <para>A pointer to an array of root items.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-getrootitems HRESULT
// GetRootItems( IShellItemArray **ppsiaRootItems );
[PreserveSig]
HRESULT GetRootItems(out IShellItemArray ppsiaRootItems);
/// <summary>Sets state information for a Shell item.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the Shell item for which to set the state.</para>
/// </param>
/// <param name="nstcisMask">
/// <para>Type: <c>NSTCITEMSTATE</c></para>
/// <para>Specifies which information is being set, in the form of a bitmap. One or more of the NSTCITEMSTATE constants.</para>
/// </param>
/// <param name="nstcisFlags">
/// <para>Type: <c>NSTCITEMSTATE</c></para>
/// <para>A bitmap that contains the values to set for the flags specified in nstcisMask.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// The nstcisMask value specifies which bits in the value pointed to by pnstcisFlags are to be set. Other bits are ignored. As
/// a simple example, if nstcisMask=NSTCIS_SELECTED, then the first bit in the nstcisFlags value determines whether that flag is
/// set (1) or removed (0).
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-setitemstate HRESULT
// SetItemState( IShellItem *psi, NSTCITEMSTATE nstcisMask, NSTCITEMSTATE nstcisFlags );
[PreserveSig]
HRESULT SetItemState(IShellItem psi, NSTCITEMSTATE nstcisMask, NSTCITEMSTATE nstcisFlags);
/// <summary>Gets state information about a Shell item.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the Shell item from which to retrieve the state.</para>
/// </param>
/// <param name="nstcisMask">
/// <para>Type: <c>NSTCITEMSTATE</c></para>
/// <para>Specifies which information is being requested, in the form of a bitmap. One or more of the NSTCITEMSTATE constants.</para>
/// </param>
/// <param name="pnstcisFlags">
/// <para>Type: <c>NSTCITEMSTATE*</c></para>
/// <para>When this method returns, points to a bitmap that contains the values requested in nstcisMask.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// The nstcisMask value specifies which bits in the value pointed to by pnstcisFlags are requested. As a simple example, if
/// nstcisMask=NSTCIS_SELECTED, then only the first bit in the value pointed to by pnstcisFlags is valid when this method
/// returns. If the first bit in the value pointed to by pnstcisFlags is 1, then the NSTCIS_SELECTED flag is set. If the first
/// bit in the value pointed to by pnstcisFlags is 0, then the NSTCIS_SELECTED flag is not set.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-getitemstate HRESULT
// GetItemState( IShellItem *psi, NSTCITEMSTATE nstcisMask, NSTCITEMSTATE *pnstcisFlags );
[PreserveSig]
HRESULT GetItemState(IShellItem psi, NSTCITEMSTATE nstcisMask, out NSTCITEMSTATE pnstcisFlags);
/// <summary>Gets an array of selected Shell items.</summary>
/// <param name="psiaItems">
/// <para>Type: <c>IShellItemArray**</c></para>
/// <para>A pointer to an array of selected Shell items.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-getselecteditems
// HRESULT GetSelectedItems( IShellItemArray **psiaItems );
[PreserveSig]
HRESULT GetSelectedItems(out IShellItemArray psiaItems);
/// <summary>Gets the state of the checkbox associated with a given Shell item.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the Shell item for which checkbox state is being retrieved.</para>
/// </param>
/// <param name="piStateNumber">
/// <para>Type: <c>int*</c></para>
/// <para>A pointer to the state of the checkbox for the Shell item.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-getitemcustomstate
// HRESULT GetItemCustomState( IShellItem *psi, int *piStateNumber );
[PreserveSig]
HRESULT GetItemCustomState(IShellItem psi, out int piStateNumber);
/// <summary>Sets the state of the checkbox associated with the Shell item.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the Shell item for which checkbox state is being set.</para>
/// </param>
/// <param name="iStateNumber">
/// <para>Type: <c>int</c></para>
/// <para>The desired state of the checkbox for the Shell item.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-setitemcustomstate
// HRESULT SetItemCustomState( IShellItem *psi, int iStateNumber );
[PreserveSig]
HRESULT SetItemCustomState(IShellItem psi, int iStateNumber);
/// <summary>Ensures that the given item is visible.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the Shell item for which the visibility is being ensured.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-ensureitemvisible
// HRESULT EnsureItemVisible( IShellItem *psi );
[PreserveSig]
HRESULT EnsureItemVisible(IShellItem psi);
/// <summary>Sets the desktop theme for the current window only.</summary>
/// <param name="pszTheme">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>The name of the desktop theme to which the current window is being set.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-settheme HRESULT
// SetTheme( LPCWSTR pszTheme );
[PreserveSig]
HRESULT SetTheme([MarshalAs(UnmanagedType.LPWStr)] string pszTheme);
/// <summary>Retrieves the next item in the tree according to which method is requested.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>The Shell item for which the next item is being retrieved. This value can be <c>NULL</c>.</para>
/// </param>
/// <param name="nstcgi">
/// <para>Type: <c>NSTCGNI</c></para>
/// <para>The type of the next item. This value can be one of the following flags:</para>
/// <para>NSTCGNI_NEXT (0)</para>
/// <para>The next sibling of the given item.</para>
/// <para>NSTCGNI_NEXTVISIBLE (1)</para>
/// <para>
/// The next visible item in the tree that has any relationship to the given item. This includes a child (if there is one), the
/// next sibling, or even one of the ancestor's siblings.
/// </para>
/// <para>NSTCGNI_PREV (2)</para>
/// <para>The previous sibling item of the given item.</para>
/// <para>NSTCGNI_PREVVISIBLE (3)</para>
/// <para>The previous visible item that is a sibling item, sibling descendent item or a parent item.</para>
/// <para>NSTCGNI_PARENT (4)</para>
/// <para>The parent item of the given item.</para>
/// <para>NSTCGNI_CHILD (5)</para>
/// <para>The first child item of the given item.</para>
/// <para>NSTCGNI_FIRSTVISIBLE (6)</para>
/// <para>The absolute first visible item in the tree (not relative to the given item).</para>
/// <para>NSTCGNI_LASTVISIBLE (7)</para>
/// <para>The absolute last visible item in the tree (not relative to the given item).</para>
/// </param>
/// <param name="ppsiNext">
/// <para>Type: <c>IShellItem**</c></para>
/// <para>The address of a pointer to the IShellItem that fits the criteria for the next item that was requested.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// If there is no next item for the type selected, this function returns E_FAIL with <c>NULL</c> for the returned item, ppsiNext.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-getnextitem HRESULT
// GetNextItem( IShellItem *psi, NSTCGNI nstcgi, IShellItem **ppsiNext );
[PreserveSig]
HRESULT GetNextItem([In] IShellItem psi, NSTCGNI nstcgi, out IShellItem ppsiNext);
/// <summary>Retrieves the item that a given point is in, if any.</summary>
/// <param name="ppt">
/// <para>Type: <c>POINT*</c></para>
/// <para>A pointer to the point to be tested.</para>
/// </param>
/// <param name="ppsiOut">
/// <para>Type: <c>IShellItem**</c></para>
/// <para>The address of a pointer to the item in which the point exists, or <c>NULL</c> if the point does not exist in an item.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>This function returns <c>S_FALSE</c> with a <c>NULL</c> item if the point does not exist in an item.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-hittest HRESULT
// HitTest( POINT *ppt, IShellItem **ppsiOut );
[PreserveSig]
HRESULT HitTest(in POINT ppt, out IShellItem ppsiOut);
/// <summary>Gets the RECT structure that describes the size and position of a given item.</summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the item for which the RECT structure is being retrieved.</para>
/// </param>
/// <param name="prect">
/// <para>Type: <c>RECT*</c></para>
/// <para>A pointer to the RECT structure that describes the size and position of the item.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-getitemrect HRESULT
// GetItemRect( IShellItem *psi, RECT *prect );
[PreserveSig]
HRESULT GetItemRect(IShellItem psi, out RECT prect);
/// <summary>Collapses all of the items in the given tree.</summary>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-collapseall HRESULT CollapseAll();
[PreserveSig]
HRESULT CollapseAll();
}
/// <summary>
/// Extends the INameSpaceTreeControl interface by providing methods that get and set the display styles of treeview controls for
/// use with Shell namespace items.
/// </summary>
/// <remarks>
/// <para>This interface also provides the methods of the INameSpaceTreeControl interface, from which it inherits.</para>
/// <para>Use class identifier (CLSID) CLSID_NameSpaceTreeControl to instantiate an instance of this interface.</para>
/// <para>When to Implement</para>
/// <para>An implementation of this interface is provided with Windows. Third parties should not implement their own versions.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-inamespacetreecontrol2
[PInvokeData("shobjidl.h", MSDNShortId = "5f9514db-35fe-44c7-9324-d69022628913")]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("7cc7aed8-290e-49bc-8945-c1401cc9306c"), CoClass(typeof(NameSpaceTreeControl))]
public interface INameSpaceTreeControl2 : INameSpaceTreeControl
{
/// <summary>Initializes an INameSpaceTreeControl object.</summary>
/// <param name="hwndParent">
/// <para>Type: <c>HWND</c></para>
/// <para>The handle of the parent window.</para>
/// </param>
/// <param name="prc">
/// <para>Type: <c>RECT*</c></para>
/// <para>A pointer to a RECT structure that describes the size and position of the control in the client window.</para>
/// </param>
/// <param name="nsctsFlags">
/// <para>Type: <c>NSTCSTYLE</c></para>
/// <para>The characteristics of the given namespace tree control. One or more of the following values from the NSTCSTYLE enumeration.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-initialize HRESULT
// Initialize( HWND hwndParent, RECT *prc, NSTCSTYLE nsctsFlags );
[PreserveSig]
new HRESULT Initialize(HWND hwndParent, in RECT prc, NSTCSTYLE nsctsFlags);
/// <summary>Enables a client to register with the control.</summary>
/// <param name="punk">
/// <para>Type: <c>IUnknown*</c></para>
/// <para>A pointer to the client IUnknown that registers with the control.</para>
/// </param>
/// <param name="pdwCookie">
/// <para>Type: <c>DWORD*</c></para>
/// <para>A pointer to the cookie that is passed back for registration.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>The pointer to the cookie that is passed back is used to unregister the control later with INameSpaceTreeControl::TreeUnadvise.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-treeadvise HRESULT
// TreeAdvise( IUnknown *punk, DWORD *pdwCookie );
[PreserveSig]
new HRESULT TreeAdvise([MarshalAs(UnmanagedType.IUnknown)] object punk, out uint pdwCookie);
/// <summary>Enables a client to unregister with the control.</summary>
/// <param name="dwCookie">
/// <para>Type: <c>DWORD*</c></para>
/// <para>A pointer to the cookie that is to be unregistered.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>The pointer to the cookie that is passed in is the one that was passed back in INameSpaceTreeControl::TreeAdvise.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-treeunadvise HRESULT
// TreeUnadvise( DWORD dwCookie );
[PreserveSig]
new HRESULT TreeUnadvise(uint dwCookie);
/// <summary>Appends a Shell item to the list of roots in a tree.</summary>
/// <param name="psiRoot">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>Pointer to the Shell item that is being appended.</para>
/// </param>
/// <param name="grfEnumFlags">
/// <para>Type: <c>SHCONTF</c></para>
/// <para>
/// Enumerates the qualities of the root and all of its children. One or more of the values of type SHCONTF. These flags can be
/// combined using a bitwise OR.
/// </para>
/// </param>
/// <param name="grfRootStyle">
/// <para>Type: <c>NSTCROOTSTYLE</c></para>
/// <para>Specifies the style of the root that is being appended. One or more of the following values:</para>
/// <para>NSTCRS_VISIBLE (0x0000)</para>
/// <para>The root is visible as well as the items. Mutually exclusive with NSTCRS_HIDDEN.</para>
/// <para>NSTCRS_HIDDEN (0x0001)</para>
/// <para>The root is hidden so that the children only are visible. Mutually exclusive with NSTCRS_VISIBLE.</para>
/// <para>NSTCRS_EXPANDED (0x0002)</para>
/// <para>The root is expanded upon initialization.</para>
/// </param>
/// <param name="pif">
/// <para>Type: <c>IShellItemFilter*</c></para>
/// <para>
/// Pointer to the IShellItemFilter that enables you to filter which items in the tree are displayed. If supplied, every item is
/// customizable with a SHCONTF flag. This value can be <c>NULL</c> if no filter is required.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inamespacetreecontrol-appendroot HRESULT
// AppendRoot( IShellItem *psiRoot, SHCONTF grfEnumFlags, NSTCROOTSTYLE grfRootStyle, IShellItemFilter *pif );
[PreserveSig]
new HRESULT AppendRoot(IShellItem psiRoot, SHCONTF grfEnumFlags, NSTCROOTSTYLE grfRootStyle, [In] IShellItemFilter pif);
/// <summary>Inserts a Shell item on a root item in a tree.</summary>
/// <param name="iIndex">
/// <para>Type: <c>int</c></para>
/// <para>The index at which to insert the root.</para>
/// </param>
/// <param name="psiRoot">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the Shell item that is being inserted.</para>
/// </param>
/// <param name="grfEnumFlags">