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.)
I maked a taskbar class from this code like this:
The problem is, when I'm performing
after
My start button is no more activated (i can't open the startmenu, clicking on it dosen't causes everything). I'm using Windows 10. Does anyone know a solution about that?
This is a solution that I use: 7+ Taskbar Tweaker (http://rammichael.com/7-taskbar-tweaker). Kudos to the author!
A simple free program that makes it possible to toggle task bar auto-hide in one action - assigning it to double click or middle click on empty space of the task bar OR set it yourself (see advanced options + help, right click try icon).
This is essential for me as I use the task bar in vertical position and on a laptop I run out of space when I project to XVGA, which is frequent. And it was a real pain, so many clicks to toggle it.
It's a shame Microsoft has not developed this further since the 90's. Today, I think one option would be that it behaves as the ribbon in the office programs.
Cheers!
Marjan
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.
Here are the functions I use:
When the code above is implemented just set the Taskbar to autohide by:
SetTaskbarState(AppBarStates.AutoHide);
Get the current state by:
I followed @Quispie answer but it didn't worked at first in Windows 10, but gave me the foundation and source to solve it (so kudos) and also http://www.pinvoke.net/.
For all those who arrived here from Google and are using Windows 10, like me, the answers from @Quispie and @nicruo are OK but need an extra
if
.The reason for that is the class name differs from version to version (apparently, as I no longer have any other Windows but 10).