vb.net TopMost Windows Taskbar

triphen
triphen used Ask the Experts™
on
Hello Experts,

There is an application that is written in Delphi that is full screen and it is set to be the topmost window. I dont have any control over this application. I wrote an application in vb.net and in the form load event I put "me.topmost = true". This works very well for keeping my vb.net application on top of the Delphi application at all times. The problem is that when the vb.net application has focus, the Windows taskbar is also viable. When the Delphi application has focus, the vb.net is still top most window and the taskbar is not visible.

What I want is for the vb.net to be in focus and be on top and for the Windows taskbar not to be visible. Is this possible?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

Commented:
The only way I know of doing that is to set the FormBorderStyle to None and the WindowState to Maximized.

Author

Commented:
The problem is I dont want my vb.net app maximized. It only takes up 100 x 200 pixels. I just want it to be on top of the other full screen on top window without showing the taskbar...
Top Expert 2015

Commented:
If you mean that you do not want your application from showing in the taskbar, then simply set the ShowInTaskBar property of the Form to False.

Otherwise, unless you are doing something very special, there is a reason why Microsoft designed the Form as it did. Hiding the taskbar prevents the user from interacting as he sees fit with other applications. They also make sure that an application won't hide the taskbar and they close before unhiding it, preventing the user from moving from one opened application to another in the most common and easiest way to do so.

If you really want to hide the taskbar anyway, a simple search for "VB.NET hide taskbar" will give you the code to do it. Just be sure to unhide it when your application closes or if it crashes.
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Commented:
Ok thanks...I found this online to hide the taskbar, button the Start button stays....


  Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
    Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal ByValhWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer

    Public Const SWP_HIDEWINDOW = &H80
    Public Const SWP_SHOWWINDOW = &H40

Open in new window


    Sub ShowTaskBar()
        Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
        SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
    End Sub

    Sub HideTaskBar()
        Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
        SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
    End Sub

Open in new window

Top Expert 2015

Commented:
Expand your search with VB.NET hide taskbar start button

Author

Commented:
Ya I have done that, but still I am unable to find a solution that works for vb.net VS 2010

Author

Commented:
This code worked the best and came closest to what I needed.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial