×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)
4

ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

4
(OP)
Hi erveryone,

Just as you can use the normal ProgressBar to create a progress bar on a form, the VFP developer can use this free DLL ProgressTaskbar.dll to visually spice up VFP Apps and create a progress bar in the taskbar of Windows 7 / 8 / 8.1 / 10 / 11 !!!

Just like e.g. the progress bar in the Windows Explorer taskbar when copying many folders and large files!!!

The DLL ProgessTaskBar.dll exports only one (!!!) function: SetProgressTaskbar(). This internally calls the two methods SetProgressValue() and SetProgressState() from the ITaskbarList3 interface (C++ source code attached, see: ProgressTaskbar.cpp).

1) Method SetProgressValue(): https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressvalue

2) Method SetProgressState(): https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressstate

The DLL ProgressTaskbar.dll can be used e.g. simply copy it into the folder of your own VFP program executable or install it there.


Before calling, you must of course declare the SetProgressTaskbar() function in your own program:

CODE -->

#DEFINE TBPF_NOPROGRESS    0
#DEFINE TBPF_INDETERMINATE 1
#DEFINE TBPF_NORMAL        2	&& green color
#DEFINE TBPF_ERROR         4	&& red color
#DEFINE TBPF_PAUSED        8	&& yellow color

DECLARE INTEGER SetProgressTaskbar IN PROGRESSTASKBAR.DLL;
	INTEGER hWnd,;
	INTEGER valueVal,;
	INTEGER maxVal,;
	INTEGER stateVal

SetProgressTaskbar( hWnd, valueVal, maxVal, stateVal ) 


hWnd: use the hWnd of Your Main Top Level Form

To create a normal display (green) of 30%: SetProgressTaskbar( hwnd, 30, 100, TBPF_NORMAL )

To create a pause indicator (yellow) of 50%: SetProgressTaskbar( hwnd, 50, 100, TBPF_PAUSED )

To generate an error display (red) of 100%: SetProgressTaskbar( hwnd, 100, 100, TBPF_ERROR )

To create a scrolling display: SetProgressTaskbar( hwnd, 0, 0, TBPF_INDETERMINATE )

To stop displaying: SetProgressTaskbar( hwnd, 0, 0, TBPF_NOPROGRESS )

Tip 1: in conjunction with a timer you can also make the taskbar flash! You call e.g. SetProgressTaskbar( hwnd, 100, 100, TBPF_PAUSED ) and SetProgressTaskbar( hwnd, 0, 0, TBPF_NOPROGRESS ) alternately every 500 msec.

Tip 2: You can achieve the greatest visual WOW effect if you let the normal ProgressBar on the form and the ProgressTaskbar in the Windows Taskbar progress at the same time.

For a detailed description of the parameters hwnd, valueVal, maxVal, stateVal and the flags TBFN_... see the two links 1) and 2) above.

You can see what the ProgressTaskbar can look like here: http://www.memotech.de/ProgressTaskbar/ProgressTaskbar.jpg

License conditions: none! no costs! no support! no warranty! free use! free distribution with your own programs!


Download: www.memotech.de/ProgressTaskbar/ProgressTaskbar.zip


Regards, Stefan

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

That looks really interesting, thank you.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

Hi Stefan,

Thanks for sharing.

Regards, Gerrit

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

Thanks for sharing.

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

(OP)
Thankx for Your feedback

I hope everyone has fun with this feature smile

Regards, Stefan


I have started developing with Visual FoxPro in 1997

under and for all Windows versions:

Windows 95
Windows 98
Windows 2000
Windows Me
Windows XP
Windows Vista
Windows 7
Windows 8
Windows 8.1
Windows 10
Windows 11
and Windows 12 can come ...

PS: Visual FoxPro will always be alive, now and in the future!

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

It works with any own top level form, I wonder why it doesn't work with the _screen.hwnd, though.

Chriss

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

(OP)
Hi Chris,

please try:

CODE -->

DECLARE INTEGER SetProgressTaskbar IN PROGRESSTASKBAR.DLL;
	LONG hWnd,;		&& <= LONG !!!
	INTEGER valueVal,;
	INTEGER maxVal,;
	INTEGER stateVal 

VFP Help:

INTEGER 32-bit integer
LONG 32-bit long integer

- I really don't know what should be the difference between integer and long integer, both are 32 bit ...

Regards, Stefan

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

The problem isn't the hwnd parameter type. I found the culprit, to make the taskbar progress work for the IDE itself, you have to use _Vfp.hwnd, not _screen.hwnd, even though _screen.ShowInTaskBar is .T. and suggests, that's the main IDE window represented in the taskbar.

Maybe it's also differing by Windows versions, but on Windows 10 the function will only work for the _vfp.hwnd.

Chriss

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

(OP)
Hi Chriss,

WOW! Thankx for this information smile

Regards, Stefan

RE: ProgressTaskbar: Show Your own ProgressBar in the Windows Taskbar (Windows 7 / 8 / 8.1 / 10 / 11)

Sure, good to know.

I should have tried that instantly, it's not the first time the _vfp vs _screen hwnd matters for using related Windows API functions or sending messages, etc.

Chriss

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close