modify UI
[marukotoolbox.git] / mp4box / ProgressTaskbar.cs
blob55001da01bfd38f2b54cd43a7cab1a44b8489216
1 // ------------------------------------------------------------------
2 // Copyright (C) 2011-2015 Maruko Toolbox Project
3 //
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
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
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 // -------------------------------------------------------------------
19 using System;
20 using System.Runtime.InteropServices;
22 namespace mp4box
24 /// <summary>
25 /// ProgressTaskbar provides Windows 7 taskbar progress
26 /// </summary>
28 [ComImportAttribute()]
29 [GuidAttribute("ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf")]
30 [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
31 interface ITaskbarList3
33 [PreserveSig]
34 void HrInit();
35 [PreserveSig]
36 void AddTab(IntPtr hwnd);
37 [PreserveSig]
38 void DeleteTab(IntPtr hwnd);
39 [PreserveSig]
40 void ActivateTab(IntPtr hwnd);
41 [PreserveSig]
42 void SetActiveAlt(IntPtr hwnd);
44 [PreserveSig]
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)]
65 struct THUMBBUTTON
67 [MarshalAs(UnmanagedType.U4)]
68 public THBMASK dwMask;
69 public uint iId;
70 public uint iBitmap;
71 public IntPtr hIcon;
72 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
73 public string szTip;
74 [MarshalAs(UnmanagedType.U4)]
75 public THBFLAGS dwFlags;
77 enum THBMASK
79 THB_BITMAP = 0x1,
80 THB_ICON = 0x2,
81 THB_TOOLTIP = 0x4,
82 THB_FLAGS = 0x8
85 enum THBFLAGS
87 THBF_ENABLED = 0,
88 THBF_DISABLED = 0x1,
89 THBF_DISMISSONCLICK = 0x2,
90 THBF_NOBACKGROUND = 0x4,
91 THBF_HIDDEN = 0x8
93 enum TBPFLAG
95 TBPF_NOPROGRESS = 0,
96 TBPF_INDETERMINATE = 0x1,
97 TBPF_NORMAL = 0x2,
98 TBPF_ERROR = 0x4,
99 TBPF_PAUSED = 0x8
101 enum TBATFLAG
103 TBATF_USEMDITHUMBNAIL = 0x1,
104 TBATF_USEMDILIVEPREVIEW = 0x2
106 struct RECT
108 public int left;
109 public int top;
110 public int right;
111 public int bottom;
113 public RECT(int left, int top, int right, int bottom)
115 this.left = left;
116 this.top = top;
117 this.right = right;
118 this.bottom = bottom;