Win7 Taskbar Masher

When you're not using the taskbar or start menu, this program keeps the taskbar behind other windows. It simulates the effect of unchecking the box "Keep taskbar on top" which was an option in Windows XP and Vista, but taken away in Windows 7.

Before Mashing


After Mashing

UPDATE: I've been surpassed: RaMMicHaeL's "7+ Taskbar Tweaker" does this job better than my code and I recommend that you install his program instead:

7+ Taskbar Tweaker

After installing "7+ Taskbar Tweaker", there is no obvious way to change the taskbar behavior. It is done by following this path:

  1. Open the settings windows.
  2. Right-click on the title bar and select Advanced options.
  3. Change the value of the disable_topmost parameter to 2.

I like his program better because it has fewer side-effects on software that draws custom GUI elements. Such problems are rare, but I (and others) have seen them. The Tweaker fixes these issues by Explorer code injection, which is beyond the scope of my interest in this problem. If he ever gets tired of maintaining his code, my program might be useful again.

Why would someone want to cover up the pretty taskbar?

I started to write a essay here, but I think it's really something you either "get" or you don't. Many people love the trend in Microsoft GUI design exhibited in the progression from Windows 2000 to Windows 8. I am not one of them.

Download

Win7 Taskbar Masher Version 1.4

Install

Unzip the archive and put the folder anywhere you like. A conventional choice would be:

C:\Program Files\Win7TaskbarMasher

Next, create a shortcut to the executable file:

Win7TaskbarMasher.exe

Put the shortcut in the Start Menu/Startup folder so the program will run when Windows boots. To run the program immediately, simply double-click on Win7TaskbarMasher.exe. You won't see anything. The program has no user interface.

If not already configured, you need to UNCHECK "Auto-hide the taskbar" in in the Taskbar and Start Menu Properties window. To access, right-click on a blank area of the taskbar and select "Properties" from the pop-up menu.

Uninstall

If for some reason you need to stop the program, use the Task Manager:

Frequently asked questions

Q: Why don't you have a nifty taskbar icon to show when the program is running? (And provide a menu so users can stop it without using the Task Manager.)
A: I don't like to see lots of taskbar icons. I associate them with machines infested with Value-Subtracted Software. Except when developing the program, I haven't found it necessary to stop Win7TaskbarMasher. If you find a defect that makes this necessary, please write and let me know. Also (for now) I want to keep the program as simple as possible so others can understand and improve it. In the future, it might be more suitable to code it as a system service.

Q: Does this program run all the time eating up system resources?
A: Yes, although it uses very little CPU time and it's very small program.

Q: Why did the Microsoft Windows 7 design team force the taskbar to be on top?
A: Did I hear you say Niagara Falls?

Q: Sometimes I can't drag a window completely over the taskbar...
A: There's a race condition which I don't yet know how to fix: When you grab a window that's not on top, it must process an update event. If you quickly drag it over the taskbar before the update event has completed, the operating system won't let you cover the taskbar. If you let go and drag the window again, the problem doesn't occur. I hope you'll study the source code and help me fix this.

Q: The pictures on this web page don't look like the Windows 7 taskbar...
A: I use a truly marvelous program Classic Shell that makes my start menu look and act like it did in Windows XP (or even Windows 2000.)

Q: I love Win7 Taskbar Masher! How can I make you rich and famous?
A: I prefer anonymity, but donations are appreciated!

Show me the source

You may, like me, not like the idea of downloading and running an .exe file from some unknown obscure website. Here's the source code so you can see it's safe. The follow section shows how you can built it yourself.

// Win7TaskbarMasher.c - Keep the taskbar behind other windows.
// Version 1.4 Copyright 2012 by Hugh Sparks. Specific rights are granted
// by Apache License 2.0: http://www.opensource.org/licenses/Apache-2.0
// Documentation and updates: http://www.csparks.com/Win7TaskbarMasher

#include <windows.h>

#define INTERVAL 50
#define CLASSNAME "Win7TaskbarMasher"
#define NOCHANGE 0,0,0,0, SWP_NOSIZE | SWP_NOMOVE

static HWND topmost = NULL ;

static VOID CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime )
{	HWND fg = GetForegroundWindow() ;
	if (fg && (fg != topmost)) {
		if (IsWindow(topmost))
			SetWindowPos(topmost, HWND_NOTOPMOST, NOCHANGE) ;
		topmost = fg ;
		SetWindowPos(fg, HWND_TOPMOST, NOCHANGE) ;
	}
}

static void registerClass(HINSTANCE instance)
{	WNDCLASS class ;
	class.style = CS_HREDRAW | CS_VREDRAW ;
	class.lpfnWndProc = DefWindowProc ;
	class.cbClsExtra = 0 ;
	class.cbWndExtra = 0 ;
	class.hInstance = instance ;
	class.hIcon = NULL ;
	class.hCursor = NULL ;
	class.hbrBackground = NULL ;
	class.lpszMenuName = NULL ;
	class.lpszClassName= CLASSNAME ;
	RegisterClass(&class) ;
}

int APIENTRY WinMain(
	HINSTANCE hInstance,
	HINSTANCE hPrevInstance,
	LPTSTR lpCmdLine,
	int  nCmdShow)
{	MSG msg ;
	HWND myWindow = FindWindow(CLASSNAME, NULL) ;
	if (myWindow) return 0;
	registerClass(hInstance) ;
	myWindow = CreateWindow(
		CLASSNAME, NULL, 0, 0, 0, 0, 0,
		NULL, NULL, hInstance, NULL
	) ;
	SetTimer(myWindow, 1, INTERVAL, timerProc) ;
	while (GetMessage(&msg, myWindow, 0, 0))
		DispatchMessage(&msg) ;
	if (IsWindow(topmost))
		SetWindowPos(topmost, HWND_TOPMOST, NOCHANGE) ;
	return msg.wParam ;
}

How do I build the program?

The sources are included in the download. There are only three files: Win7TaskbarMasher.c, Masher.ico, and resources.rc which contains the copyright blurb and a reference to the icon.

If you actually want to work on the software, you'll probably prefer set it up in a development environment. If you just want to compile the program with no fuss, install Mingw and execute these commands:

	windres resources.rc -o resources.o
	gcc -mwindows Win7TaskbarMasher.c resources.o -o Win7TaskbarMasher.exe 

Complain or rejoice

If you have questions, comments or suggestions, please feel free to write.

References