I saw many questions and answers related to this topic But I didn't find any better solution. Few solution are lengthy and few doesn't work. Now I want to share a nice and easy solution for this
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
How to make application invisible in WPF. just add this XAML code
<Window x:Class="temp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="350" Width="525" ResizeMode="NoResize" WindowState="Minimized" IsTabStop="False" Visibility="Hidden" WindowStyle="None" ShowInTaskbar="False">
<Grid>
</Grid>
</Window>
Height and width dosn't matter only Visibility, WindowStyle and ShowInTaskbar
will hide the application from Alt +Tab and from task manager's application tab
Now for Winform: Use Form load event and put this code
private void Form1_Load(object sender, EventArgs e)
{
this.Opacity = 0; //Declear Opacity = 0 on top
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; //This is most Important part don't use FormBorderStyle.None or something else
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
}
This will Hide Winform Application form Alt+tab as well as from task manager's application tab