-
4
- #1
StefanFoerner
Programmer
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(): [URL unfurl="true"]https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressvalue[/url]
2) Method SetProgressState(): [URL unfurl="true"]https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressstate[/url]
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:
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: [URL unfurl="true"]http://www.memotech.de/ProgressTaskbar/ProgressTaskbar.jpg[/url]
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
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(): [URL unfurl="true"]https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressvalue[/url]
2) Method SetProgressState(): [URL unfurl="true"]https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressstate[/url]
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: [URL unfurl="true"]http://www.memotech.de/ProgressTaskbar/ProgressTaskbar.jpg[/url]
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