Windows 7 taskbar progress example
torhu
no at spam.invalid
Sat Jun 5 14:34:07 PDT 2010
I had to figure out how to do this for my app, so here's some sample
code for you enjoyment. :)
Needs a Tango and dwt-win install to build. The other required files
are in the attachment.
Here's the main file, that shows how the use the StatusbarProgress
wrapper class:
---
module taskbartest;
import tango.io.Stdout;
import tango.sys.win32.Types;
import dwt.DWT;
import dwt.widgets.Display;
import dwt.widgets.Shell;
import link;
import mswindows.taskbarprogress;
void main() {
auto display = new Display();
auto shell = new Shell(display);
shell.open();
TaskbarProgress tbProgress;
try {
tbProgress = new TaskbarProgress(shell.handle);
// try out setProgressValue and setProgressState
tbProgress.setProgressValue(33, 100);
tbProgress.setProgressState(TBPF_PAUSED);
Stdout.formatln("Nice, eh?");
}
catch (Exception e) {
Stdout.formatln("{}", e);
}
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
if (tbProgress)
tbProgress.dispose();
}
---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: win7taskbar.zip
Type: application/zip
Size: 3525 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-dwt/attachments/20100605/7991903b/attachment.zip>
More information about the Digitalmars-d-dwt
mailing list