Exemplo n.º 1
0
        private void SetStateInTB()
        {
            if (ownerForm == null)
            {
                return;
            }

            ThumbnailProgressState thmState = ThumbnailProgressState.Normal;

            if (!showInTaskbar)
            {
                thmState = ThumbnailProgressState.NoProgress;
            }
            else if (Style == ProgressBarStyle.Marquee)
            {
                thmState = ThumbnailProgressState.Indeterminate;
            }
            else if (m_State == ProgressBarState.Error)
            {
                thmState = ThumbnailProgressState.Error;
            }
            else if (m_State == ProgressBarState.Pause)
            {
                thmState = ThumbnailProgressState.Paused;
            }

            TaskbarProgress.SetProgressState(ownerForm.Handle, thmState);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Sets the progress RequestState of the specified window's taskbar button.
 /// </summary>
 /// <param name="hwnd">
 /// The window handle.
 /// </param>
 /// <param name="state">
 /// The progress RequestState.
 /// </param>
 public static void SetProgressState(IntPtr hwnd, ThumbnailProgressState state)
 {
     if (Windows7OrGreater && TaskbarList != null)
     {
         TaskbarList.SetProgressState(hwnd, state);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Sets the progress state of the specified window's
 /// taskbar button.
 /// </summary>
 /// <param name="hwnd">The window handle.</param>
 /// <param name="state">The progress state.</param>
 public static void SetProgressState(IntPtr hwnd, ThumbnailProgressState state)
 {
     if (Windows7OrGreater)
     {
         TaskbarList.SetProgressState(hwnd, state);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Sets the progress bar of this form's taskbar button to the
 /// specified state.
 /// </summary>
 /// <param name="form">The form.</param>
 /// <param name="state">The taskbar progress state.</param>
 public static void SetTaskbarProgressState(this Form form, ThumbnailProgressState state)
 {
     try
     {
         WindowsFormsExtensions.SetTaskbarProgressState(form, (Windows7Taskbar.ThumbnailProgressState)state);
     }
     catch (Exception) {}             // Library might fail in Windows Vista and before
 }
Exemplo n.º 5
0
 /// <summary>
 /// Sets the progress state of the specified window's
 /// taskbar button.
 /// </summary>
 /// <param name="hwnd">The window handle.</param>
 /// <param name="state">The progress state.</param>
 public static void SetProgressState(IntPtr hwnd,
                                     ThumbnailProgressState state)
 {
     if (TaskbarList != null)
     {
         TaskbarList.SetProgressState(hwnd, (TBPFLAG)state);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Sets the progress bar of this form's taskbar button to the
        /// specified state.
        /// </summary>
        /// <param name="form">The form.</param>
        /// <param name="state">The taskbar progress state.</param>
        public static void SetTaskbarProgressState(this Form form, ThumbnailProgressState state)
        {
			try
			{
				WindowsFormsExtensions.SetTaskbarProgressState(form, (Windows7Taskbar.ThumbnailProgressState)state);
			}
			catch (Exception) {} // Library might fail in Windows Vista and before
        }
Exemplo n.º 7
0
        public static void ShowTaskbarProgress(IntPtr hwnd, ThumbnailProgressState state)
        {
            if (disableTaskbarProgress || !isWindowsVistaOrGreater)
            {
                return;
            }

            HideTaskbarProgress();

            if (hwnd == IntPtr.Zero)
            {
                hwnd = GetHandleOfTheMainWindow();
            }

            if (hwnd != IntPtr.Zero)
            {
                LastHwnd = hwnd;
                TaskbarList.SetProgressState(LastHwnd, (TBPFLAG)state);
            }
        }
Exemplo n.º 8
0
 private void SetStateInTB()
 {
     if (ownerForm != null)
     {
         ThumbnailProgressState state = ThumbnailProgressState.Normal;
         if (!showInTaskbar)
         {
             state = ThumbnailProgressState.NoProgress;
         }
         else if (Style == ProgressBarStyle.Marquee)
         {
             state = ThumbnailProgressState.Indeterminate;
         }
         else if (m_State == ProgressBarState.Error)
         {
             state = ThumbnailProgressState.Error;
         }
         else if (m_State == ProgressBarState.Pause)
         {
             state = ThumbnailProgressState.Paused;
         }
         Windows7Taskbar.SetProgressState(ownerForm.Handle, state);
     }
 }
Exemplo n.º 9
0
 public static void SetTaskbarProgressState(IntPtr hwnd, ThumbnailProgressState state)
 {
     HResult result = TaskbarList.SetProgressState(hwnd, (uint)state);
     result.ThrowIf();
 }
Exemplo n.º 10
0
 /// <summary>
 /// Sets the progress state of the specified window's
 /// taskbar button.
 /// </summary>
 /// <param name="hwnd">The window handle.</param>
 /// <param name="state">The progress state.</param>
 public static void SetTaskbarProgressState(this Form form, ThumbnailProgressState state)
 {
     SetTaskbarProgressState(form.Handle, state);
 }
Exemplo n.º 11
0
 public static void ShowTaskbarProgress(object form, ThumbnailProgressState state)
 {
     ShowTaskbarProgress((form is Form) ? ((Form)form).Handle : IntPtr.Zero, state);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Sets the progress state of the specified window's
 /// taskbar button.
 /// </summary>
 /// <param name="hwnd">The window handle.</param>
 /// <param name="state">The progress state.</param>
 public static void SetProgressState(IntPtr hwnd, ThumbnailProgressState state)
 {
     if (SystemInfo.Instance.Windows7OrGreater)
         TaskbarList.SetProgressState(hwnd, state);
 }
Exemplo n.º 13
0
        public static void SetTaskbarProgressState(IntPtr hwnd, ThumbnailProgressState state)
        {
            HResult result = TaskbarList.SetProgressState(hwnd, (uint)state);

            result.ThrowIf();
        }
Exemplo n.º 14
0
 public static void RhinoSetProgressState(ThumbnailProgressState state)
 {
     SetProgressState(RhinoApp.MainWindowHandle(), state);
 }
Exemplo n.º 15
0
 public static void SetProgressState(IntPtr hwnd, ThumbnailProgressState state)
 {
     TaskbarList.SetProgressState(hwnd, state);
 }
Exemplo n.º 16
0
 /// <summary>
 /// Sets the progress state of the specified window's
 /// taskbar button.
 /// </summary>
 /// <param name="hwnd">The window handle.</param>
 /// <param name="state">The progress state.</param>
 public static void SetProgressState(IntPtr hwnd,
     ThumbnailProgressState state)
 {
     TaskbarList.SetProgressState(hwnd, (TBPFLAG)state);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Sets the progress state of the specified window's
 /// taskbar button.
 /// </summary>
 /// <param name="hwnd">The window handle.</param>
 /// <param name="state">The progress state.</param>
 public static void SetTaskbarProgressState(this Form form, ThumbnailProgressState state)
 {
     SetTaskbarProgressState(form.Handle, state);
 }