views:

917

answers:

2

Basically I want to make simple toggle program (that will be mapped to some keyboard shortcut) that set taskbar to auto-hide mode if in normal mode (and conversely, to normal show mode if in auto-hide).

Do You know how to implement it in C#? (or Win32 C++, but anything that will actually do it is fine.)

Thanks. Hope I've made myself clear.

--

I don't really want any full screen app that will overlap taskbar, only windowless program that toggles show mode and quit. I switch from auto-hide to normal view on regular basis and want to simplify it. (Using Win7.)

--

edited. For example

#include <windows.h>

int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    SetWindowPos(FindWindow(L"Shell_traywnd", NULL ), 0, 0, 0, 0, 0, 0x40);
}

will not do the trick, it only shows taskbar, which is already visible=true, but not switch it to/from auto-hide. (Same applies for 0x80.)

+1  A: 

Hiding the taskbar

It's a more WIN32 API related issue than C#. You can use this (needed to be translated to dot net of course) to hide the task bar.

You can use http://www.pinvoke.net to translate the WIN32 API calls to dot net.

Set auto-hide to the taskbar

You can achieve that by manipulating the registry using the keys that described here.

It should be an easy task, Good luck.

Eran Betzalel
That KB article does not allow you to toggle auto-hide
Anders
You're right, I added that too.
Eran Betzalel
Many thanks for re-edit, Eran!
DinGODzilla
+1  A: 

The taskbar is a appbar and you can control it with SHAppBarMessage

Anders