コード例 #1
0
        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
ファイル: Win7TaskBar.cs プロジェクト: dougrathbone/mbunit-v3
        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();
        }
コード例 #5
0
ファイル: Windows7TaskBar.cs プロジェクト: CHiiLD/net-toolkit
 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!");
     }
 }
コード例 #6
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();
        }
コード例 #7
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!");
     }
 }
コード例 #8
0
 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
     }
 }
コード例 #9
0
        private TaskbarThumbnailManager()
        {
            try
            {
                if (AppConfig.OSVersion >= AppConfig.VerWin7)
                {
                    _taskbarList = Activator.CreateInstance(Type.GetTypeFromCLSID(TaskbarListClass))
                                   as ITaskbarList4;

                    _taskbarList.HrInit();
                }
            }
            catch
            {
                _taskbarList = null;
                return;
            }
        }
コード例 #10
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);
                }
            }
        }
コード例 #11
0
 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
     }
 }
コード例 #12
0
 static Taskbar()
 {
     taskbarInstance.HrInit();
 }
コード例 #13
-1
        private TaskbarThumbnailManager()
        {
            try
            {
                if (AppConfig.OSVersion >= AppConfig.VerWin7)
                {

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

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