C# implements locking the icon to the Windows taskbar or deleting the icon

大家讲道理
Release: 2016-11-10 14:54:54
Original
3505 people have browsed it

This function is sometimes used when testing installation and uninstallation on Windows

Shell shell = new Shell();  
Folder folder = shell.NameSpace(Path.GetDirectoryName(appPath));  
FolderItem app = folder.ParseName(Path.GetFileName(appPath));  
string sVerb = isLock ? "锁定到任务栏(&K)" : "从任务栏脱离(&K)";  
    
foreach (FolderItemVerb Fib in app.Verbs())  
{  
    if (Fib.Name == sVerb)  
    {  
       Fib.DoIt();  
       return true;  
    }  
}  
    
return false;
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template