Page 1 of 1

Detecting the Windows Taskbar

Posted: Wed Apr 02, 2003 12:02 pm
by Gen-ik
I imagine this is an IE / Windows only question but I was wondering if anyone knows if it's possible to detect if the Windows Taskbar (the bar at the bottom of the screen that holds the 'start' menu and the clock) using JavaScript.

I'm checking through the Microsoft DOM object at the moment but haven' seen anything about it so far.


Any help would be great :)

Posted: Wed Apr 02, 2003 1:53 pm
by daven
Nope. Sorry, but that is not possible. JS can only affect the browser window, not the OS. In order to affect the task bar, you need to write a program in C++, Delphi, etc., and have the user install it.

Posted: Sat Apr 05, 2003 4:09 am
by Skyzyx
Well, you might be able to use JScript (Microsoft's proprietary version of JavaScript with File System Access) or VBScript, but the user would need Internet Explorer, Windows, and it could not be a webpage. It'd have to be an HTA (Microsoft Hypertext Application).

Next question, I suppose, would be what do you mean by "detecting the taskbar"? That doesn't seem to make any sense to me. What for?

Posted: Sat Apr 05, 2003 4:32 am
by Gen-ik
Well.. if I know wether the task-bar is visible or hidden then I can adjust the height of the browser to suit. And I know it's only an IE/Win thing but that doesn't matter because the site is only compatible with IE/Win.

Posted: Sat Apr 05, 2003 5:47 am
by d1223m
does the screen object not hold the client screen size? does it include the startbar or not? just an idea..

Posted: Sat Apr 05, 2003 4:00 pm
by Gen-ik
I don't think so... using either screen.height or screen.availHeight both return the same values.

Time to inch my way through the Microsoft DOM site I think :?

Posted: Sat Apr 05, 2003 5:12 pm
by volka
strange

Code: Select all

<html>
	<body>
		<SCRIPT language="javascript">
			document.write(screen.height);
		</SCRIPT>
		<br />
		<SCRIPT language="javascript">
			document.write(screen.availHeight);
		</SCRIPT>
	</body>
</html>
shows the correct values here (ie6 and mozilla 1.2)

Posted: Sat Apr 05, 2003 5:36 pm
by Gen-ik
Ahhh.. things become clear.

The screen.availHeight will only take the Taskbar into account when the Taskbar is set to "Always on top"... otherwise IE just completely ignores it, which is stupid.