Пример #1
0
        private void SetStateInTB()
        {
            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;
            }

            if (ownerForm == null)
            {
                return;
            }
            Windows7Taskbar.SetProgressState(ownerForm.Handle, thmState);
        }
Пример #2
0
        private void SetValueInTB()
        {
            if (showInTaskbar)
            {
                ulong maximum  = (ulong)(Maximum - Minimum);
                ulong progress = (ulong)(Value - Minimum);

                Windows7Taskbar.SetProgressValue(ownerForm.Handle, progress, maximum);
            }
        }