コード例 #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;
            }

            Windows7Taskbar.SetProgressState(ownerForm.Handle, thmState);
        }
コード例 #2
0
        public static void CalculateAndSet(IntPtr hwnd, int allInList, int current)
        {
            if (current == 0)
            {
                return;
            }
            ulong   newVal = 0;
            ulong   max    = applicationProgressMax;
            decimal d      = allInList / Convert.ToInt32(applicationProgressMax);

            if (d != 0)
            {
                newVal = Convert.ToUInt64(current / d);
            }

            if ((ulong)allInList < applicationProgressMax)
            {
                max    = (ulong)allInList;
                newVal = (ulong)current;
            }

            if (newVal != applicationProgress)
            {
                applicationProgress = newVal;
                Windows7Taskbar.SetProgressValue(hwnd, applicationProgress, max);
            }
        }
コード例 #3
0
        private void SetValueInTB()
        {
            if (showInTaskbar)
            {
                ulong maximum  = (ulong)(Maximum - Minimum);
                ulong progress = (ulong)(Value - Minimum);

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