Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / June 2008



Tip: Looking for answers? Try searching our database.

Lock Taskbar Updating

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TC - 18 Jun 2008 15:23 GMT
Hey All,

I would like to prevent the taskbar from updating.  I have seen code that
hides / unhides, like that below:

Dim handleW1 As Long

Private Declare Function FindWindowA Lib "user32" _
  (ByVal lpClassName As String, _
  ByVal lpWindowName As String) As Long

Private Declare Function SetWindowPos Lib "user32" _
  (ByVal handleW1 As Long, _
  ByVal handleW1InsertWhere As Long, ByVal w As Long, _
  ByVal x As Long, ByVal y As Long, ByVal z As Long, _
  ByVal wFlags As Long) As Long

Public Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As
Long) As Long

Const TOGGLE_HIDEWINDOW = &H80
Const TOGGLE_UNHIDEWINDOW = &H40

Function HideTaskbar()
  handleW1 = FindWindowA("Shell_traywnd", "")
  Call SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW)
End Function

Function UnhideTaskbar()
  Call SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW)
End Function

However, if I try to take that handle and use in a LockWindowUpdate call, it
does not lock the taskbar window and icons continue to appear and reappear.

Is there a way to lock the taskbar or prevent certain windows or
applications from adding icons?

Thanks,

Todd
Dean Earley - 18 Jun 2008 16:37 GMT
> Hey All,
>
[quoted text clipped - 33 lines]
> Is there a way to lock the taskbar or prevent certain windows or
> applications from adding icons?

Don't use LockWindowUpdate for that, it's not what it's designed for.
Try the WM_SETREDRAW message.
Check:
http://blogs.msdn.com/oldnewthing/archive/2007/02/19/1716211.aspx
And the following articles.

Signature

Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

TC - 18 Jun 2008 19:05 GMT
Hey Dean,

Thanks!

Todd

>> Hey All,
>>
[quoted text clipped - 40 lines]
> http://blogs.msdn.com/oldnewthing/archive/2007/02/19/1716211.aspx
> And the following articles.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.