Preparing
Windows 7 Beta has been released publicly from http://www.microsoft.com/windows/windows-7/beta -download.aspx download. W7 has made a lot of improvements on the taskbar. For the new features of the taskbar, you can check out http://blogs.msdn.com/e7/archive/2008/11/20/happy-anniversary-windows-on-the -evolution-of-the-taskbar.aspx. If you want to develop Windows 7, it is best to look at the white paper, available from http://code.msdn.microsoft.com/PDC08WhitePapers/Release/ProjectReleases.aspx? ReleaseId=1797 download. We will use Windows 7 Taskbar Enhancements for our development of the taskbar. Here we mainly implement Overlay Icons and Progress Bars in the icon of the taskbar. The Windows 7 SDK Beta may also be required during the implementation process.
Getting Started
First find the ShObjIdl.idl file in the Windows SDK. If you don't have the SDK installed, you can download it later. This is an interface definition language file. For convenience of calling, we can similarly
1HRESULT SetProgressValue(2 [in] HWND hwnd,3 [in] ULONGLONG ullCompleted,4 [in] ULONGLONG ullTotal);
Such an interface declaration is changed to
1HRESULT SetProgressValue(2 [in] long hwnd,3 [in] ULONGLONG ullCompleted,4 [in] ULONGLONG ullTotal);
That is HWND Type is changed to long. Then use midl to convert the modified idl file to a binary tlb file, ShObjTlb.tlb is the generated file, and ShObjIdl.idl is the original file.
Then use tlbimp to generate the managed dll file for the tlb file.
Add a reference to the dll in your project, and then you can call the methods like a managed dll.
To achieve progress in the taskbar icon, two functions, SetProgressState and SetProgressState, are used.
The first parameter of the SetProgressState method is the handle, the second parameter is an enumeration variable, indicating the state of the current icon, we can define an enumeration to represent these states
1private enum TbpFlag2 {3 TBPF_ERROR = 1,4 TBPF_PAUSED = 2,5 TBPF_NORMAL = 3,6 TBPF_INDETERMINATE = 4,7 };
Then you can use SetProgressState( (int)this.Handle , TBPFLAG.TBPF_NORMAL); The icon status is set to the normal state.
SetProgressValue((int)this.Handle, 50, 100); You can set the progress, the first parameter is the handle, the second parameter is the completed quantity, and the third parameter is the total amount.
For details on how to use these functions, please check the Windows 7 SDK or the English version of the MSDN Library.
Effects
When 20% is completed:
When 50% is completed:
100% completed Time:
Others
According to this method and with reference to the PDC2008 white paper, you can implement other new Windows 7 features in a managed language.
Unmanaged code
If you implement this feature in C++, it will be easier. You can refer to the Windows SDK. The path is Microsoft SDKsWindowsv7.0SampleswinuiShellTaskbarIntegrationPeripheralStatus
This article code or material download
We all know that the time displayed on the computer is affected
On November 12th, Maxthons browser R&D center and Jinshan Internet Security jointly launched the 2.5
1. Put the wav format music file into the computer – win7(C) – Media folder. As shown be
Win7 system fixed web page font size skills
Clean and shut down redundant Windows 7 system services
Windows 7 prompts that Ping is not a solution to internal or external commands.
How to set up graphic tutorial for Win7 system router
Windows7 uses IE11 to respond to blue screens
Tips for using Thunder/Express downloads under Windows 7 sleep state
Win8.1 Professional Edition IE browser to remove hyperlink underline specific skills
How to uninstall Win7 system Windows Search service
Win7 system damage can not open the machine response measures
Windows 8 system how to set up subsequent operations when inserting certain media and devices
How does Windows 8 system perform disk management to free up disk space
Win7 detects a hard disk error after booting. Please backup the file immediately.
Win10 official version update error prompt error code 0x80240016 solution
The countermeasures for the folder in the Windows 10 Start menu cannot be deleted
Solution to the win10 system notification area network icon yellow exclamation point method
In-depth analysis of Windows 7 device driver management
Win7 can't copy the contents of one IE browser window to another window. What should I do?