Hiding Borderless Window from ALT+TAB menu

Sudhakar Tillapudi

I'm developing a Tray application with Borderless Form which runs in the background. if user wants to perform different operations, they can open context menu by right clicking on the tray icon(NotifyIcon).

so my requirements are :

1.Application always starts in minimized mode and trayicon willbe displayed.
2.Application should not be appeared from the Taskbar.
3.Application should not be visible from ALT+TAB menu.

I have implemented above two requirements but while trying to hide the application from ALT+Tab menu it is working (not visible from ALT+TAB) but its creating small edged window with application title at left side corner on top of Taskbar as shown in below image: enter image description here

I want to remove that small edged window.

Here is my code:

    public Form1()
    {
        InitializeComponent();
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        HideThisForm();
    }

    protected override CreateParams CreateParams
    {
        get
        {
            // Turn on WS_EX_TOOLWINDOW style bit
            CreateParams cp = base.CreateParams;
            cp.ExStyle |= 0x80;
            return cp;
        }
    }

    private void HideThisForm()
    {

        this.ShowInTaskbar = false;
        this.WindowState = FormWindowState.Minimized;
        this.Hide();

        notifyApp.Visible = true;
        notifyApp.ShowBalloonTip(2000, "BackgroundApp", 
                    "This APP is running @ Background", ToolTipIcon.Info);
    }

P.S: i have gone through few similar posts in StackOverflow but none of them facing similar issue.

rory.ap

I've accomplished this before using this.Opacity=0;. Kind of hackish, but with WinForms, it might be the only way.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related