Click here to Skip to main content
12,077,096 members (46,426 online)
Click here to Skip to main content
Add your own
alternative version

Stats

204.7K views
3.2K downloads
93 bookmarked
Posted

Taskbar Progressbar Control

, 3 Apr 2007
Rate this:
Please Sign up or sign in to vote.
How to put a progressbar control into the taskbar.

Introduction

This article describes how to put a progress bar control into the taskbar.

Sample screenshot

Sample screenshot

How does it work?

First, we need to create an instance of the progress control. The progress bar control will be automatically attached to the taskbar. At startup, the program searches for three specific HWnds. These are Shell_TrayWnd, ReBarWindow32 and TrayNotifyWnd. The program tasks, shortcut bar etc.. are all included into this window using the ReBarWindow32 class. ReBarWindow32 is directly placed beside the TrayNotifyWnd window. All we need to do now is to create the progress bar using the method Create but we don't add it to our main window, we add it to the taskbar. An important fact is, that the control needs its own message map, else you will get a 100% CPU usage due to the message handling when we click on the control in the taskbar.

Facts

  • The progress control is directly attached into the taskbar. When you have enabled the Auto Hide option of the Windows Taskbar, the control moves with it.
  • We need to renew the control when we:
    • add an icon into the tray notify bar.
    • change/move the taskbar from horizontal to vertical and vice versa.
    • * etc..
  • To renew the control, we need a timer at this time (I haven't found a kind of broadcast message yet).
  • Parent window of the control is the Shell_TrayWnd of the Taskbar.

Other classes used

  • CTextProgressCtrl by Chris Maunder.

Where does it work?

It's tested on:

  • WinXP
  • Win2000 Prof.
  • Win2003 Server

Use this program / source code at your own risk. The author of this program is not responsible for any damage on your or another computer caused by this program.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Nautilus Master
Austria Austria
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionControl is transparent in Vista. How to make it non transparent? Pin
dima polyakov5-May-07 15:48
memberdima polyakov5-May-07 15:48 
AnswerRe: Control is transparent in Vista. How to make it non transparent? Pin
dima polyakov6-May-07 8:48
memberdima polyakov6-May-07 8:48 
Generaldisplay progress bar Pin
anu jaggi25-Apr-07 0:21
memberanu jaggi25-Apr-07 0:21 
GeneralUPDATE: TTaskbarContainer [modified] Pin
Nautilus Master31-Mar-07 10:03
memberNautilus Master31-Mar-07 10:03 
GeneralBug in NProgressBar.cpp with m_bCreated Pin
Port233227-Feb-07 4:24
memberPort233227-Feb-07 4:24 
GeneralRe: Bug in NProgressBar.cpp with m_bCreated Pin
Nautilus Master27-Feb-07 8:25
memberNautilus Master27-Feb-07 8:25 
Generalneed a C# version Pin
goldli24-Feb-07 16:16
membergoldli24-Feb-07 16:16 
GeneralRe: need a C# version Pin
Nautilus Master2-Mar-07 8:43
memberNautilus Master2-Mar-07 8:43 
GeneralRe: need a C# version Pin
quin5815-Mar-10 21:13
memberquin5815-Mar-10 21:13 
Generalseparate TaskBarHandling & ProgressCtrl Pin
JimmyO17-Jan-07 15:01
memberJimmyO17-Jan-07 15:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.160212.1 | Last Updated 3 Apr 2007
Article Copyright 2005 by Nautilus Master
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid