C # buttons for adding control to the taskbar

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.