Detecting the Windows Taskbar

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Detecting the Windows Taskbar

Post 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 :)
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post 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.
Skyzyx
Forum Commoner
Posts: 42
Joined: Fri Feb 14, 2003 1:53 am
Location: San Jose, CA

Post 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?
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post 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.
User avatar
d1223m
Forum Commoner
Posts: 80
Joined: Mon Mar 31, 2003 5:15 am
Location: UK, West Sussex

Post by d1223m »

does the screen object not hold the client screen size? does it include the startbar or not? just an idea..
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post 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 :?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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)
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post 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.
Post Reply