1
// ------------------------------------------------------------------
2 // Copyright (C) 2011-2015 Maruko Toolbox Project
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 // express or implied.
14 // See the License for the specific language governing permissions
15 // and limitations under the License.
16 // -------------------------------------------------------------------
20 using System
.Runtime
.InteropServices
;
25 /// ProgressTaskbar provides Windows 7 taskbar progress
28 [ComImportAttribute()]
29 [GuidAttribute("ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf")]
30 [InterfaceTypeAttribute(ComInterfaceType
.InterfaceIsIUnknown
)]
31 interface ITaskbarList3
36 void AddTab(IntPtr hwnd
);
38 void DeleteTab(IntPtr hwnd
);
40 void ActivateTab(IntPtr hwnd
);
42 void SetActiveAlt(IntPtr hwnd
);
45 void MarkFullscreenWindow(IntPtr hwnd
, [MarshalAs(UnmanagedType
.Bool
)] bool fFullscreen
);
47 void SetProgressValue(IntPtr hwnd
, UInt64 ullCompleted
, UInt64 ullTotal
);
48 void SetProgressState(IntPtr hwnd
, TBPFLAG tbpFlags
);
49 void RegisterTab(IntPtr hwndTab
, IntPtr hwndMDI
);
50 void UnregisterTab(IntPtr hwndTab
);
51 void SetTabOrder(IntPtr hwndTab
, IntPtr hwndInsertBefore
);
52 void SetTabActive(IntPtr hwndTab
, IntPtr hwndMDI
, TBATFLAG tbatFlags
);
53 void ThumbBarAddButtons(IntPtr hwnd
, uint cButtons
, [MarshalAs(UnmanagedType
.LPArray
)] THUMBBUTTON
[] pButtons
);
54 void ThumbBarUpdateButtons(IntPtr hwnd
, uint cButtons
, [MarshalAs(UnmanagedType
.LPArray
)] THUMBBUTTON
[] pButtons
);
55 void ThumbBarSetImageList(IntPtr hwnd
, IntPtr himl
);
56 void SetOverlayIcon(IntPtr hwnd
, IntPtr hIcon
, [MarshalAs(UnmanagedType
.LPWStr
)] string pszDescription
);
57 void SetThumbnailTooltip(IntPtr hwnd
, [MarshalAs(UnmanagedType
.LPWStr
)] string pszTip
);
58 void SetThumbnailClip(IntPtr hwnd
, ref RECT prcClip
);
60 [GuidAttribute("56FDF344-FD6D-11d0-958A-006097C9A090")]
61 [ClassInterfaceAttribute(ClassInterfaceType
.None
)]
62 [ComImportAttribute()]
63 class ProgressTaskbar { }
64 [StructLayout(LayoutKind
.Sequential
, CharSet
= CharSet
.Auto
)]
67 [MarshalAs(UnmanagedType
.U4
)]
68 public THBMASK dwMask
;
72 [MarshalAs(UnmanagedType
.ByValTStr
, SizeConst
= 260)]
74 [MarshalAs(UnmanagedType
.U4
)]
75 public THBFLAGS dwFlags
;
89 THBF_DISMISSONCLICK
= 0x2,
90 THBF_NOBACKGROUND
= 0x4,
96 TBPF_INDETERMINATE
= 0x1,
103 TBATF_USEMDITHUMBNAIL
= 0x1,
104 TBATF_USEMDILIVEPREVIEW
= 0x2
113 public RECT(int left
, int top
, int right
, int bottom
)
118 this.bottom
= bottom
;