Action Windows7 shortcut to taskbar

Source: Internet
Author: User

Currently, there are methods that can be called directly. Directly through ShellExecute's taskbarpin verbs, such as:

1 ShellExecute (NULL, _t ("taskbarpin"),2     _t (" C:\\users\\titilima\\desktop\\test.lnk " ),3     null, NULL, SW_SHOWNORMAL);

It's been a while since Windows 7 was released, and today's topic is for this--Occupy Windows7 's taskbar, pin the application to the taskbar, or Unpin.
The specific method I also found some on the internet, but after a reverse of a program, find it is still elegant, so here is the method described. It should be explained that, due to various reasons, I can not give the source code. Here I only give a general step, I believe it is not a problem to understand. If you do not understand it, please check the MSDN documentation yourself based on your keywords.

      1. Consult the Shell32.dll string resource, find the ID of the PIN and Unpin command string, and write it down for later use;
      2. Create a Ishelldispatch interface;
      3. Get the Folder interface pointer corresponding to the path of the application via the Ishelldispatch interface;
      4. Get the FolderItem interface pointer for the application file name via the Folder interface;
      5. Get Folderitemverbs interface pointer via FolderItem interface;
      6. Enumerates the verb sets corresponding to the Folderitemverbs interface, obtains the name of each verb, obtains a string resource according to the string ID noted in step 1th, and pairs the verb name until the corresponding Folderitemverb interface pointer is found;
      7. Call Folderitemverb::D The Oit method, the application will be pin or unpin to the taskbar.

Action Windows7 shortcut to taskbar

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.