Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I have an winform application that has forms for performing various operations in the background. These forms show an icon in the taskbar and have background workers and progress bars to show the progress of the operation.

I've implemented the Windows 7 Taskbar APIs and successfully coded it to show the Indeterminate and Normal states with progress for the Application's icon.

What I'd like to do is show the progress on the taskbar icon for the form.

I'm passing the handle of the current form to the SetProgressState method like this:

C#
SetProgressState(TaskbarProgressBarState.Indeterminate, this.Handle);

or
C#
SetProgressState(TaskbarProgressBarState.Normal, this.Handle);

but it still changes the application's taskbar icon.

One thing that makes me believe this is possible is that the Indeterminate state does show the marquee on the form's taskbar icon, even though the application's taskbar icon shows as if I had set it to normal.
Posted
Comments
BillWoodruff 13-Nov-13 17:24pm    
I have never tried this before, but I remember that Scott Hanselmann had a blog way back when where he talked about doing this:

http://www.hanselman.com/blog/TheWeeklySourceCode46JeffKeyRocksTaskbarMetersThatMonitorYourWindows7CPUAndMemoryAndDiskInTheTaskbar.aspx

And the code example he describes by Jeff Key is here:

http://taskbarmeters.codeplex.com/

Hopefully one of CP's gurus will be along shortly who's had hands-on with this.

In Win 8 the download application I use, Internet Download Manager, shows progress with the green-swarm in the TaskBar; it's a cool effect.
Member 4598407 14-Nov-13 19:41pm    
Thanks, I'm was doing the same thing with my main window. I'm trying to do it with a form launched from the main window that also shows an icon in the taskbar, but the TaskbarManager only seems to want to work with the main window's icon.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900