Lock Taskbar Updating

June 18th, 2008 - 10:23 am ET by TC | Report spam
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
email Follow the discussionReplies 4 repliesReplies Make a reply

Replies

#1 TC
June 18th, 2008 - 02:05 pm ET | Report spam
Hey Dean,

Thanks!

Todd


"Dean Earley" wrote in message
news:%
TC wrote:
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?



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/a...16211.aspx
And the following articles.

Dean Earley ()
i-Catcher Development Team

iCode Systems


Similar topics