public ClipboardThumbnailItem(BitmapSource icon, BitmapSource preview, string title, ClipboardSnapshot snapshot)
        {
            ShowActivated = false;
            Focusable = false;
            Icon = icon;
            WindowStyle = WindowStyle.None;
            ResizeMode = ResizeMode.NoResize;
            Title = title;
            Width = 0;
            Height = 0;
            Owner = GlobalMessageListener.Instance;
            Top = -short.MaxValue;
            Left = -short.MaxValue;

            var bitmap = new BitmapImage();
            bitmap.BeginInit();
            bitmap.UriSource = new Uri("pack://application:,,,/Shapeshifter;component/Images/Overlay.png");
            bitmap.EndInit();

            TaskbarItemInfo = new TaskbarItemInfo()
            {
                Overlay = bitmap
            };

            _snapshot = snapshot;

            _preview = BitmapFromBitmapSource(preview);

            _taskbarList = (ITaskbarList4)new TaskbarList();
            _taskbarList.HrInit();
        }
Пример #2
0
 static WindowsTaskbar()
 {
     if (WindowsUtils.IsWindows7)
     {
         _taskbarList = (ITaskbarList4)new CTaskbarList();
         _taskbarList.HrInit();
     }
 }
Пример #3
0
 static WindowsTaskbar()
 {
     if (WindowsUtils.IsWindows7)
     {
         _taskbarList = (ITaskbarList4) new CTaskbarList();
         _taskbarList.HrInit();
     }
 }
Пример #4
0
            static TaskbarList()
            {
                var tb = new CTaskbarList();

                taskbar2 = (ITaskbarList2)tb;
                try { taskbar4 = (ITaskbarList4)tb; } catch { taskbar4 = null; }
                taskbar2?.HrInit();
            }
Пример #5
0
 public void Dispose()
 {
     if (taskbarList == null)
     {
         return;
     }
     Marshal.ReleaseComObject(taskbarList);
     taskbarList = null;
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TaskDialog"/> class.
 /// </summary>
 public TaskDialog()
 {
     progressBarMinimum = 0;
     progressBarMaximum = 100;
     progressBarValue = 0;
     updatedStrings = new IntPtr[Enum.GetNames( typeof( TaskDialogElement ) ).Length];
     hWndOwner = FindWindow( "MsiDialogCloseClass", 0 );
     if ( SupportsTaskbarProgress ) taskbarList = (ITaskbarList4) new CTaskbarList();
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TaskDialog"/> class.
 /// </summary>
 public TaskDialog()
 {
     progressBarMinimum = 0;
     progressBarMaximum = 100;
     progressBarValue   = 0;
     updatedStrings     = new IntPtr[Enum.GetNames(typeof(TaskDialogElement)).Length];
     hWndOwner          = FindWindow("MsiDialogCloseClass", 0);
     if (SupportsTaskbarProgress)
     {
         taskbarList = (ITaskbarList4) new CTaskbarList();
     }
 }
Пример #8
0
 static Windows7TaskBar()
 {
     try
     {
         LOG.Info("Try to initialize Windows 7 Taskbar...");
         taskbar = (ITaskbarList4)new TaskbarList();
         taskbar.HrInit();
         LOG.Info(">>> OK");
     }
     catch (Exception e)
     {
         taskbar = null;
         LOG.Warn("WARN: Cannot create windows 7 taskbar:\n" + e.Message);
         LOG.Info("Ignore commands for windows 7 taskbar!");
     }
 }
Пример #9
0
        public Win7TaskBar(IntPtr windowHandle, ITaskbarList4 taskBarList, ITestTreeModel testTreeModel, 
            ITestStatistics testStatistics)
        {
            this.windowHandle = windowHandle;
            
            this.testTreeModel = testTreeModel;

            this.testStatistics = testStatistics;
            testStatistics.Passed.PropertyChanged += UpdateTaskbar;
            testStatistics.Failed.PropertyChanged += UpdateTaskbar;
            testStatistics.Skipped.PropertyChanged += UpdateTaskbar;
            testStatistics.Inconclusive.PropertyChanged += UpdateTaskbar;

            this.taskBarList = taskBarList;
            taskBarList.HrInit();
        }
Пример #10
0
        public Win7TaskBar(IntPtr windowHandle, ITaskbarList4 taskBarList, ITestTreeModel testTreeModel,
                           ITestStatistics testStatistics)
        {
            this.windowHandle = windowHandle;

            this.testTreeModel = testTreeModel;

            this.testStatistics = testStatistics;
            testStatistics.Passed.PropertyChanged       += UpdateTaskbar;
            testStatistics.Failed.PropertyChanged       += UpdateTaskbar;
            testStatistics.Skipped.PropertyChanged      += UpdateTaskbar;
            testStatistics.Inconclusive.PropertyChanged += UpdateTaskbar;

            this.taskBarList = taskBarList;
            taskBarList.HrInit();
        }
Пример #11
0
 static Windows7TaskBar()
 {
     try
     {
         LOG.Info("Try to initialize Windows 7 Taskbar...");
         taskbar = (ITaskbarList4) new TaskbarList();
         taskbar.HrInit();
         LOG.Info(">>> OK");
     }
     catch (Exception e)
     {
         taskbar = null;
         LOG.Warn("WARN: Cannot create windows 7 taskbar:\n" + e.Message);
         LOG.Info("Ignore commands for windows 7 taskbar!");
     }
 }
 static WindowsTaskbar()
 {
     if (WindowsUtils.IsWindows7)
     {
         try
         {
             // ReSharper disable once SuspiciousTypeConversion.Global
             _taskbarList = (ITaskbarList4) new CTaskbarList();
             _taskbarList.HrInit();
         }
         #region Error handling
         catch (Exception ex)
         {
             Log.Warn(ex);
         }
         #endregion
     }
 }
        private TaskbarThumbnailManager()
        {
            try
            {
                if (AppConfig.OSVersion >= AppConfig.VerWin7)
                {
                    _taskbarList = Activator.CreateInstance(Type.GetTypeFromCLSID(TaskbarListClass))
                                   as ITaskbarList4;

                    _taskbarList.HrInit();
                }
            }
            catch
            {
                _taskbarList = null;
                return;
            }
        }
Пример #14
0
 private void EstablishContext()
 {
     windowHandle = new IntPtr();
     taskBarList = MockRepository.GenerateStub<ITaskbarList4>();
     testTreeModel = MockRepository.GenerateStub<ITestTreeModel>();
     testCount = new Observable<int>();
     testTreeModel.Stub(ttm => ttm.TestCount).Return(testCount);
     var testStatistics = MockRepository.GenerateStub<ITestStatistics>();
     passed = new Observable<int>();
     failed = new Observable<int>();
     skipped = new Observable<int>();
     inconclusive = new Observable<int>();
     testStatistics.Stub(ts => ts.Passed).Return(passed);
     testStatistics.Stub(ts => ts.Failed).Return(failed);
     testStatistics.Stub(ts => ts.Skipped).Return(skipped);
     testStatistics.Stub(ts => ts.Inconclusive).Return(inconclusive);
     new Win7TaskBar(windowHandle, taskBarList, testTreeModel, testStatistics);
 }
Пример #15
0
        private void EstablishContext()
        {
            windowHandle  = new IntPtr();
            taskBarList   = MockRepository.GenerateStub <ITaskbarList4>();
            testTreeModel = MockRepository.GenerateStub <ITestTreeModel>();
            testCount     = new Observable <int>();
            testTreeModel.Stub(ttm => ttm.TestCount).Return(testCount);
            var testStatistics = MockRepository.GenerateStub <ITestStatistics>();

            passed       = new Observable <int>();
            failed       = new Observable <int>();
            skipped      = new Observable <int>();
            inconclusive = new Observable <int>();
            testStatistics.Stub(ts => ts.Passed).Return(passed);
            testStatistics.Stub(ts => ts.Failed).Return(failed);
            testStatistics.Stub(ts => ts.Skipped).Return(skipped);
            testStatistics.Stub(ts => ts.Inconclusive).Return(inconclusive);
            new Win7TaskBar(windowHandle, taskBarList, testTreeModel, testStatistics);
        }
Пример #16
0
        static void Main(string[] args)
        {
            var opts = new Args(args);
            var wnds = FindWindow(opts.Title);

            if (wnds.Length == 0)
            {
                Environment.Exit(2);
            }

            ITaskbarList4 inst = null;

            try
            {
                inst = (ITaskbarList4) new CTaskbarList();
                inst.HrInit();
            }
            catch (Exception e)
            {
                Console.WriteLine("Failed to create ITaskbarList4 interface, usually because you are not on Windows 7.");
                Console.WriteLine("");
                Console.WriteLine(e.Message);
                Environment.Exit(3);
            }

            foreach (var wnd in wnds)
            {
                if (opts.Value.HasValue)
                {
                    inst.SetProgressValue(wnd, (ulong)opts.Value.Value, 100);
                }
                if (opts.State.HasValue)
                {
                    inst.SetProgressState(wnd, opts.State.Value);
                }
            }
        }
Пример #17
0
 static Taskbar()
 {
     try { Instance = (ITaskbarList4)new CTaskbarList(); }
     // This will fail if the OS doesn't support taskbar progress (that's okay)
     catch { }
 }
Пример #18
0
 static TaskbarList()
 {
     taskbar2 = new ITaskbarList2();
     taskbar2.HrInit();
     taskbar4 = taskbar2 as ITaskbarList4;
 }
Пример #19
0
 static TaskbarList()
 {
     taskbar2 = new ITaskbarList2();
     taskbar2.HrInit();
     try { taskbar4 = (ITaskbarList4)taskbar2; } catch { }
 }
 static WindowsTaskbar()
 {
     if (WindowsUtils.IsWindows7)
     {
         try
         {
             // ReSharper disable once SuspiciousTypeConversion.Global
             _taskbarList = (ITaskbarList4)new CTaskbarList();
             _taskbarList.HrInit();
         }
             #region Error handling
         catch (Exception ex)
         {
             Log.Warn(ex);
         }
         #endregion
     }
 }
Пример #21
0
 static Taskbar()
 {
     try { Instance = (ITaskbarList4) new CTaskbarList(); }
     // This will fail if the OS doesn't support taskbar progress (that's okay)
     catch { }
 }
Пример #22
-1
        private TaskbarThumbnailManager()
        {
            try
            {
                if (AppConfig.OSVersion >= AppConfig.VerWin7)
                {

                    _taskbarList = Activator.CreateInstance(Type.GetTypeFromCLSID(TaskbarListClass))
                        as ITaskbarList4;

                    _taskbarList.HrInit();
                }
            }
            catch
            {
                _taskbarList = null;
                return;
            }
        }