C # buttons for adding control to the taskbar
Windows7Taskbar usage: http://yunpan.cn/QauRaNK4H3BYW (extract code: fe58) encapsulated classes: Windows7Taskbar, ThumbButtonManager, ThumbButton, JumpListManager, RegistrationHelper Windows7Taskbar for registration and initialization, manage ThumbButton, steps include creating and adding buttons, JumpListManager history, and RegistrationHelper associated file types: 1. reference using Windows7.De SktopIntegration; using windows7.20.topintegration. windowsForms; 2. initialize Windows7Taskbar (when loading the form. allowTaskbarWindowMessagesThroughUIPI (); Windows7Taskbar. setCurrentProcessAppId ("TaskbarManaged"); // you can customize the parameters in step 3. create button copy code ThumbButtonManager buttonManager = this. createThumbButtonManager (); ThumbButton taskbarBtnPause = buttonManager. createThumbButton (101, Properties. resources. playtask, "play"); taskbarBtnPause. C Licked + = (sender, e) =>{ btnPlay_PictureClick (sender, e); if (IsPlay = true) // check whether the video is being played and update the icon {taskbarBtnPause. icon = Properties. resources. playtask;} else {taskbarBtnPause. icon = Properties. resources. pausetask ;}}; buttonManager. addThumbButtons (taskbarBtnPause); copy the Code 4. capture information copy Code protected override void WndProc (ref Message m) {if (buttonManager! = Null) buttonManager. dispatchMessage (ref m); base. wndProc (ref m);} a maximum of seven buttons. There is no way to add or delete a button. After initialization, you can only make it unavailable or hidden. you can call the ThumbBarAddButtons and ThumbBarUpdateButtons methods to control the toolbar. adding ThumbButton during the Load time of the form does not work, which is why I did not add ThumbButton when loading the form, and each ThumbButton has an ID, which is assigned by you, the problem that cannot be repeated: I gave taskbarBtnPause. clicked adds a processing event, that is, the change Icon. The result is that the ThumbButton attribute Icon is modified when the event is triggered, but the interface is not updated.