If the taskbar is visible, hides it and set it not to be always on top. If it is hidden, shows it and sets it to be always on top. Does not affect the autohide state.

Works properly only on Windows XP.

[download]

The code (windows.h must be included):

	APPBARDATA abd;
	abd.cbSize = sizeof(APPBARDATA);
	abd.hWnd = FindWindow(_T("Shell_TrayWnd"), NULL);
	abd.lParam = (UINT) SHAppBarMessage(ABM_GETSTATE, &abd);

	if (ShowWindow(abd.hWnd, SW_SHOW)) {
		ShowWindow(abd.hWnd, SW_HIDE);
		abd.lParam &= ~ABS_ALWAYSONTOP;
	} else {
		abd.lParam |= ABS_ALWAYSONTOP;
	}
	SHAppBarMessage(ABM_SETSTATE, &abd);