Tricky Taskbar Teaser

Portal111
Portal111 used Ask the Experts™
on
Hi there, well basically im trying to create an MSN manager kinda thingy, and I was wondering, is it possible to hide a window in the taskbar, but not the actual window itself.
...
I cant try it at the moment because im under 98 - soon to XP, possibly tonight, but would it work if you hid the window, and then made the window fully opaque? The Hiding part and the Transparency part might be completely different but just an idea.

Thanks, Jack.
Comment
Watch Question

Do more with

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

Commented:
Erm, I could be mistaken, but you want to display the Form, like you would do normally, but you don't want to display it in the taskbar?

If so, that's really easy. Simply set the "ShowInTaskbar" Property of the form to False.
Commented:
If you want to remove ANOTHER window, thus not a window you are the owner of from the taskbar, you should use something like this:

Option Explicit

Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long

Private Const GWL_EXSTYLE = (-20)

Private Const SW_SHOW = 5
Private Const SW_HIDE = 0

Private Const WS_EX_APPWINDOW = &H40000

Private Sub HideFromTaskbar(ByVal hWnd As Long)

    Dim dwStyle As Long
   
    'Hide the window (only way to remove it from the taskbar)
    Call ShowWindow(hWnd, SW_HIDE)
   
    'Remove the WS_EX_APPWINDOW style from the extended window style
    dwStyle = GetWindowLong(hWnd, GWL_EXSTYLE)
    dwStyle = dwStyle And Not WS_EX_APPWINDOW
    Call SetWindowLong(hWnd, GWL_EXSTYLE, dwStyle)
   
    'Show the window
    Call ShowWindow(hWnd, SW_SHOW)

End Sub

In the above code I simply delete the WS_EX_APPWINDOW style, which simply is there to display the window in the taskbar.

Author

Commented:
lol yeah, i want to do it to another window. Hmmm, strange, it does not seem to work, thats odd. Thanks anyway, Jack.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Im just thinking, do i need XP or 2000 for that?

Author

Commented:
Im just thinking, do i need XP or 2000 for that?

Author

Commented:
Im just thinking, do i need XP or 2000 for that?

Author

Commented:
woops. Jack.

Author

Commented:
excellent, thanks, Jack.

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