Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PLEASE!! Big help needed regarding taskbar 1

Status
Not open for further replies.

PoLaK

Programmer
Oct 1, 2001
15
0
0
AU
Hi
I am working on a project right now but i really wish to try to incorporate a function to hide an icon that is already in the taskbar and then to be able to reshow this icon. I have been searching for a while and have been unable to find any coding that can hide particular icons that are already there...

you help would be greatly appreciated
thanks

 
you can paint a clear icon:
m_IData5.hWnd = hWnd
m_IData5.cbSize = Len(m_IData5)
m_IData5.uFlags = NIF_ICON + NIF_MESSAGE
m_IData5.uCallbackMessage = NIF_CUSTOM_MSG
m_IData5.szTip = "message"
m_IData5.hIcon = m_hIcon'handle to a transparent icon
'example:
'' Set m_ClearIcon = LoadResPicture(101, vbResIcon)
'' m_IData5.hIcon = m_ClearIcon.Handle
End If
m_IData5.uVersion = NOTIFYICON_VERSION
m_IData5.uId = vbNull
Shell_NotifyIcon5(NIM_MODIFY, m_IData5)
 
Or:

[tt]Option Explicit

Const GWL_EXSTYLE = (-20)
Const WS_EX_APPWINDOW = &H40000

Private Const SW_HIDE = 0
Private Const SW_SHOW = 5

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex 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 ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long


Private Sub VisibleInTaskbar(hwndForm As Long, Visible As Boolean)
Dim CurrentStyle As Long
Dim NewStyle As Long

CurrentStyle = GetWindowLong(hwndForm, GWL_EXSTYLE)

If Not Visible Then
NewStyle = CurrentStyle And (Not WS_EX_APPWINDOW)
Else
NewStyle = CurrentStyle Or WS_EX_APPWINDOW
End If

ShowWindow hwndForm, SW_HIDE
SetWindowLong hwndForm, GWL_EXSTYLE, NewStyle
ShowWindow hwndForm, SW_SHOW

End Sub
 
Do these hide icons in the taskbar that are not associated with my project ie like icq or the volume icon???

sorry for getting a bit confused
 
Should do. You'll need a procedure to determine the hWnd of the application that you want to hide's window, which you can then pass to the VisibleInTaskBar procedure.
 
Thanks heaps... thats helped alot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top