Page 1 of 1

HTML desktop

Posted: Thu Apr 01, 2004 12:45 pm
by Will Robinson
I would like to try to make a desktop that functions like a web site.
Mouse over graphics and sub menus appear to select icons that are the shortcuts to different applications, games, utilities etc.

Does anyone have this and would you let me download an example of it so I can study the HTML code so I can try to build my own?

I'm a rookie to HTML so it would help to see how someone put the theory to use in a real world application rather than just use my HTML book.
Things like how you arranged the graphics, centering, borders, links to shortcuts...the folder arrangement that will contain all the components that make up what you see on the desktop etc.

Posted: Thu Apr 01, 2004 1:36 pm
by SuperSheep
http://coolmon.arsware.org/

There was a site called ntfs.org that had a great article on html desktops.

Here's a little something I wrote for experimenting with displaying system stuff in HTML...

Code: Select all

<HTML><HEAD><TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript">
// System Constants
var ssfDESKTOP          = 0;    // Windows Desktop
var ssfPROGRAMS         = 0x2;  // User's program groups
var ssfCONTROLS         = 0x3;  // Icons for the Control Panel applications
var ssfPRINTERS         = 0x4;  // Installed printers
var ssfPERSONAL         = 0x5;  // User's documents
var ssfFAVORITES        = 0x6;  // User's favorite items
var ssfSTARTUP          = 0x7;  // User's Startup program group
var ssfRECENT           = 0x8;  // User's most recently used documents
var ssfSENDTO           = 0x9;  // Send To menu items
var ssfBITBUCKET        = 0xa;  // Recycle Bin
var ssfSTARTMENU        = 0xb;  // Directory containing Start menu items
var ssfDESKTOPDIRECTORY = 0x10; // File objects that are displayed on the desktop
var ssfDRIVES           = 0x11; // My Computer
var ssfNETWORK          = 0x12; // Network Neighborhood
var ssfNETHOOD          = 0x13; // Link objects that may exist in the My Network Places 
var ssfFONTS            = 0x14; // Installed fonts
var ssfTEMPLATES        = 0x15; // Document templates
var ssfCOMMONSTARTMENU  = 0x16; // Programs and folders that appear on Start menu for all users
var ssfCOMMONPROGRAMS   = 0x17; // Directories for common program groups that appear on Start menu for all users
var ssfCOMMONSTARTUP    = 0x18; // Programs that appear in the Startup folder for all users
var ssfCOMMONDESKTOPDIR = 0x19; // Files and folders that appear on the desktop for all users
var ssfAPPDATA          = 0x1a; // Application-specific data
var ssfPRINTHOOD        = 0x1b; // Link objects that may exist in the Printers virtual folder
var ssfLOCALAPPDATA     = 0x1c; // Local (non-roaming) applications
var ssfALTSTARTUP       = 0x1d; // User's nonlocalized Startup program group
var ssfCOMMONALTSTARTUP = 0x1e; // Nonlocalized Startup program group for all users
var ssfCOMMONFAVORITES  = 0x1f; // All users' favorite items
var ssfINTERNETCACHE    = 0x20; // Temporary Internet files
var ssfCOOKIES          = 0x21; // Internet cookies
var ssfHISTORY          = 0x22; // Internet history items
var ssfCOMMONAPPDATA    = 0x23; // Application data for all users
var ssfWINDOWS          = 0x24; // Windows directory or SYSROOT
var ssfSYSTEM           = 0x25; // System folder
var ssfPROGRAMFILES     = 0x26; // Program Files folder
var ssfMYPICTURES       = 0x27; // My Pictures folder
var ssfPROFILE          = 0x28; // User's profile folder

// Variables
var sa  = new ActiveXObject("Shell.Application");
var ssf = new Array(0x28);

var locator = new ActiveXObject("WbemScripting.SWbemLocator"); // Get locator object
var service = locator.ConnectServer();
var infoID = null;

function PopulateAll() {
	Populate(ssfCONTROLS,'ocpanel');
	Populate(ssfDRIVES,'odrives');
	Populate(ssfFONTS,'ofonts');
	Populate(ssfMYPICTURES,'omypictures');
}

function Populate(ssfItem,cID) {
	ssf[ssfItem] = new Object(sa.NameSpace(ssfItem));
	var ssfItems = new Object(ssf[ssfItem].Items());
	eval("document.all."+cID+".Name=ssfItem");
	for(i=0; i<ssfItems.Count; i++) {
		var oOption  = document.createElement("OPTION");
		oOption.text = ssfItems.Item(i).Name;
		eval("document.all."+cID+".add(oOption)");
	}
}
function RunSpecial(ssfItem, index) {
	var ssfItems = new Object(ssf[ssfItem].Items());
	ssfItems.Item(index).InvokeVerb();
}


function updateinfo() {
	if(infoID !=null) clearInterval(infoID);
	window.setTimeout("displayInfo()",10); infoID=window.setInterval("displayInfo()",1000);
}

function displayInfo() {
	var objinst = service.InstancesOf("Win32_OperatingSystem");
	var netinst = service.ExecQuery("SELECT * from Win32_POTSModem");
	for(n = new Enumerator(netinst); !n.atEnd(); n.moveNext())
	{
		nProfile=n.item();
		prop = new Array(nProfile.Properties);
		INFO5.innerText="Network Speed: "+prop[3];
	}
	for(e = new Enumerator(objinst) ; !e.atEnd() ; e.moveNext())
	{
		Profile=e.item();
		INFO1.innerText="Free Physical Memory: "+getformatted(Profile.FreePhysicalMemory)+"KB";
		INFO2.innerText="Free Virtual Memory: "+getformatted(Profile.FreeVirtualMemory)+"KB";
		INFO3.innerText="Number of Processes: "+Profile.NumberOfProcesses;
	}
	//var objinst = service.Get("Win32_LogicalDisk=\"C:\"");
	//INFO4.innerText="Free Disk Space: "+getformatted(objinst.FreeSpace/1048576)+"MB";
}

function stopupdateinfo() {
	window.clearInterval(infoID);
	infoID=null;
}

function getformatted(inputval) {
	// Set wholePart equal to the whole portion of the value
	wholePart = Math.floor(inputval).toString();
	// Set decimalPart equal to the decimal portion of the value
	decimalPart = inputval-wholePart;
	// Set lineLength equal to the number of characters in wholePart
	lineLength = wholePart.length;

	if(lineLength>9)      returnval=wholePart.substr(0,lineLength-9)+","+wholePart.substr(lineLength-9,3)+","+wholePart.substr(lineLength-6,3)+","+wholePart.substr(lineLength-3,3);
	else if(lineLength>6) returnval=wholePart.substr(0,lineLength-6)+","+wholePart.substr(lineLength-6,3)+","+wholePart.substr(lineLength-3,3);
	else if(lineLength>3) returnval=wholePart.substr(0,lineLength-3)+","+wholePart.substr(lineLength-3,3);
	else                  returnval=wholePart;

	// Add 3 decimal digits + the decimal to the value returned
	returnval+=decimalPart.toString().substr(1,4);
	return returnval;
}

</SCRIPT>
</HEAD>
<BODY ONLOAD="PopulateAll()" onmouseover="updateinfo()" onmouseout="stopupdateinfo()"> -->
<DIV CLASS="SYSINFO" ID="INFO1" STYLE="position: absolute; left: 30px; top: 220px;"></DIV>
<DIV CLASS="SYSINFO" ID="INFO2" STYLE="position: absolute; left: 30px; top: 232px;"></DIV>
<DIV CLASS="SYSINFO" ID="INFO4" STYLE="position: absolute; left: 30px; top: 256px;"></DIV>
<DIV CLASS="SYSINFO" ID="INFO3" STYLE="position: absolute; left: 30px; top: 244px;"></DIV>
<DIV CLASS="SYSINFO" ID="INFO5" STYLE="position: absolute; left: 30px; top: 268px;"></DIV>
<FORM>
<SELECT ID="ocpanel" SIZE="10"
 ONDBLCLICK="RunSpecial(this.Name, this.selectedIndex)"></SELECT>
<SELECT ID="odrives" SIZE="10"
 ONDBLCLICK="RunSpecial(this.Name, this.selectedIndex)"></SELECT>
<SELECT ID="ofonts" SIZE="10"
 ONDBLCLICK="RunSpecial(this.Name, this.selectedIndex)"></SELECT>
<SELECT ID="omypictures" SIZE="10"
 ONDBLCLICK="RunSpecial(this.Name, this.selectedIndex)"></SELECT>
</FORM>
</BODY></HTML>
Just do a search for "Active desktop" and HTML and you should find a lot of sample pages all over the place. :)