The API you want is SHAppBarMessage.

Code:
Public Declare Function SHAppBarMessage Lib "shell32.dll" Alias "SHAppBarMessage" (ByVal dwMessage As Long, pData As APPBARDATA) As Long
and you need this udt and some constants

Code:
Public Type APPBARDATA
        cbSize As Long
        hwnd As Long
        uCallbackMessage As Long
        uEdge As Long
        rc As Rect
        lParam As Long '  message specific
End Type
Public Const ABM_ACTIVATE = &H6               
Public Const ABM_GETAUTOHIDEBAR = &H7
Public Const ABM_GETSTATE = &H4
Public Const ABM_GETTASKBARPOS = &H5
Public Const ABM_NEW = &H0
Public Const ABM_QUERYPOS = &H2
Public Const ABM_REMOVE = &H1
Public Const ABM_SETAUTOHIDEBAR = &H8          
Public Const ABM_SETPOS = &H3
Public Const ABM_WINDOWPOSCHANGED = &H9
I've never actually used it bafore, there's a lot to do, you need to set up an extra message handler to handle some messages specific to docked windows.

Here's What MSDN has to say.

And there's a couple of examples in Planet Source code, but one's cheating and I havn't downloaded the other one, but It looks promissing as it's complex.


Cheating Way With Timer
This Might be the SHAppBarMessage Meathod but I havn't downloaded it