This might be interesting: http://blogs.msdn.com/b/oldnewthing/archive/2005/05/05/414910.aspx
Basically the task bar has some code behind it to notice if it should hide itself or stay visible, if you follow the blog entry you should find how to do it right.