Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to <a href="https://stackoverflow.com/questions/6378098/how-to-prevent-an-app-from-being-pinned-in-windows-7">this post</a>, you can use the <a href="http://archive.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=4906" rel="nofollow noreferrer">Windows API Code Pack</a> but the required classes are internal. The OP said that they copied 50k lines of code to get it working. I'm not sure if it's improved since that post but here's a workaround I just thought of. Since you can only pin EXE files (and shortcuts as per comment) to the taskbar, you could rename your application to a non-exe extension (most non-exe extensions cannot be pinned). </p> <p>When you want to call it from your other app, rename it to <code>.exe</code>, launch it, then rename it back again. For example:</p> <pre><code>Process p = new Process(); //fake extension so it can't be drag/dropped to taskbar string fakeExtensionName = @"C:\MyFile\myProgram.test"; //what it's actually called string exeExtensionName = @"C:\MyFile\myProgram.exe"; //rename the fake one to the real one File.Move(fakeExtensionName, exeExtensionName); p.StartInfo.FileName = exeExtensionName; //launch the real one p.Start(); //rename it back to the fake extension File.Move(exeExtensionName, fakeExtensionName); </code></pre> <p>Anyone can rename it to an exe if they really wanted to, so your program should assume that a user can launch it directly and handle that scenario, but any file can be pinned to the taskbar by renaming it to an exe so there's no protection around that.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload