Still looking for a solution to this.

  • Thread starter Thread starter Smoke
  • Start date Start date
S

Smoke

I have been asking this for so long and i wasnt able to find a solution yet.
The problem is that i have a program with ShowInTaskBar=False and i cant hide the program from ALT+TAB, so, when u switch programs
with alt+tab you always see the icon of my program, but even worst it dont show the correct icon, it show a default one
I really need to find a way so it never show on the alt+tab list of programs, is there a such way?

The main problem about this come, since my program is a desktop toolbar, its hidded on the right side of your screen, and its
suposed to show uponce you click on that side, but, since its already on the running task, once you close your last application my
programs comes active and its show up, and i dont want that to happend..

Is there a way to fix that?
 
I have been asking this for so long and i wasnt able to find a solution yet.
The problem is that i have a program with ShowInTaskBar=False and i cant hide the program from ALT+TAB, so, when u switch programs
with alt+tab you always see the icon of my program, but even worst it dont show the correct icon, it show a default one
I really need to find a way so it never show on the alt+tab list of programs, is there a such way?

The main problem about this come, since my program is a desktop toolbar, its hidded on the right side of your screen, and its
suposed to show uponce you click on that side, but, since its already on the running task, once you close your last application my
programs comes active and its show up, and i dont want that to happend..

Is there a way to fix that?


One way is to use a tool window style. This will hide your app icon
from the ALT-TAB list.


Me.FormBorderStyle = FormBorderStyle.FixedToolWindow
or
Me.FormBorderStyle = FormBorderStyle.SizableToolWindow

Don't know if that fits your needs. I'm sure there are other ways
around this too.

// CHRIS
 
Well, actually, my window has no border, and, since its going to be a toolbar, i cant add that border style...

any other solution?
 
Well, actually, my window has no border, and, since its going to be a toolbar, i cant add that border style...

any other solution?

Sure, I'm full of them!

I'll assume that you have Me.FormBorderStyle = FormBorderStyle.None

Then you can remove the icon from the ALT+TAB list by adding the
WS_EX_TOOLWINDOW style to your base win32 window.

I just fired up a test project and it worked fine for me.

Just do this:

'Import GetWindowLong()/SetWindowLong() from user32.dll

<System.Runtime.InteropServices.DllImport("user32.dll")> _
Public Shared Function GetWindowLong(ByVal hWnd As Integer, ByVal
nIndex As Integer) As Integer
End Function

<System.Runtime.InteropServices.DllImport("user32.dll")> _
Public Shared Function SetWindowLong(ByVal hWnd As Integer, ByVal
nIndex As Integer, ByVal dwNewLong As Integer) As Integer
End Function

In your Form Load Event:

Me.ShowInTaskbar = False
Me.FormBorderStyle = FormBorderStyle.None

'Get Handle To Window
Dim hWnd As Integer = Me.Handle().ToInt32()

'Get Extended Window Style (GWL_EXSTYLE = -20)
Dim nStyleEx As Integer = GetWindowLong(hWnd, -20)

'Add the WS_EX_TOOLWINDOW (0x80) Style
nStyleEx = nStyleEx Or &H80

'Update Window Style (GWL_EXSTYLE = -20)
SetWindowLong(hWnd, -20, nStyleEx)


Werked fur mee!

// CHRIS
 
Well, i dont know what im doing there, but it seems to work just fine.
i copy/paste the code and the icon is gone :)
Still dont understand what i did, but who cares! :)

Thanks a lot man
And, u said " I'm full of them!" , u mean full of solutions or full of programs that acts as toolbars?
if so, i would love to see them if possible, to learn :)
 
Well, i dont know what im doing there, but it seems to work just fine.
i copy/paste the code and the icon is gone :)
Still dont understand what i did, but who cares! :)

Well, basically, every window (in Windows) has some basic properties.
Among them are a set number of "STYLES" and "EXTENDED STYLES" that
govern things like Is it visible? and Does it have a sizeable border?
Well, one of the extended styles is called a WS_EX_TOOLWINDOW, and
it's used for pretty much exactly what you're doing.
Thanks a lot man
And, u said " I'm full of them!" , u mean full of solutions or full of programs that acts as toolbars?
if so, i would love to see them if possible, to learn :)

I meant I'm full of solutions.. Usually.. :) Haven't done much
toolbar programming, though.

Cheers!
// CHRIS
 
Back
Top