Active Desktop Tutorial

all you need to do is use div layers with absolute positioning to have all your sections in 1 html file. Something like dreamweaver (mx), has them inbuilt and makes it really easy to use if you are having trouble. This of course allows for transparency, in that the background of the html file is your entire desktop(maximize to fill and lock web items), with all the divs just positioning stuff around the place.
 
Here is an example of what luminosity have addressed.
Also included a 'behaviour script' so that you can move the box on the fly. You can read more about this script here

Just make layers as many as you wish and named it Layer1, Layer2 etc by putting them as <div> and also add them between the <style> tag
 
Re: Program Execution

Originally posted by luminosity
I am not sure if anyone else has brought this up since I haven't read through the whole thread, but an alternate and perhaps easier way to execute programs through html is to use the inbuilt ShellExecute function. This way you hopefully shouldn't have any problems with long or short filenames and whatnot when using Shell.

There are two ways to do it, no need to use both of course but you can integrate it into whatever scripting language you are using most.

I used GordianKnot as an example

<html>
<head>
<title>Prog Launcher</title>
</head>
<script language="JScript">
function ShellExJ(filename)
{
var objShell = new ActiveXObject("Shell.Application");

objShell.ShellExecute(filename, "", "", "open", 1);
}
</script>
<script language="VBScript">
function ShellExVB(filename)
dim objShell

set objShell = CreateObject("Shell.Application")

objShell.ShellExecute filename, "", "", "open", 1

set objShell = nothing
end function
</script>
<body>
<a onClick="ShellExJ('D:\\Apps\\GordianKnot\\GordianKnot.exe')" href="javascript:;">GKnot Java Exec</a><br>
<a onClick="ShellExVB('D:\\Apps\\GordianKnot\\GordianKnot.exe')" href="javascript:;">GKnot VB Exec</a>
</body>
</html>


This works fine for me and saves the hassle of creating vbscripts for every program as you can simply pass the filename variable to the script. Also might make things a little faster but i haven't really tested it.

More info on the method is available from MSDN here - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/objects/ishelldispatch2/shellexecute.asp

Hope this helps some of you

EDIT: Keep in mind the above code can be used not only to launch exe but jpg, text and other files - it will simply load any file up in its default viewer/program.

This is working very well for me, and is much simpler than using individual files. As a little contribution, some programs require parameters, so I've modified the fn slightly to allow this:

Code:
<script language="JScript"> 
function ShellExJParam(filename, params) 
{ 
var objShell = new ActiveXObject("Shell.Application"); 

objShell.ShellExecute(filename, params, "", "open", 1);

history.back(); 
} 
</script>

and so the code to open a program is:

Code:
<a onClick="ShellExJ('D:\\Apps\\GordianKnot\\GordianKnot.exe', 'param1 param2')" href="javascript:;">GKnot Java Exec</a><br>


However, I am having trouble with opening programs such as My Computer using this method. I have tried simply putting "explorer /root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" in but this does not work. I've fiddled around a bit but have not manged to resolve this - any ideas?
 
Re: Re: Program Execution

Originally posted by robe
As a little contribution, some programs require parameters, so I've modified the fn slightly to allow this

Great idea, parameters are key. Unfortunately, I can't get your modified code to work but the original works fine. :confused:
 
That's a bit wierd - works fine for me. Here is a complete example:

Code:
<html> 

<script language="JScript"> 
function ShellExJParam(filename, params) 
{ 
var objShell = new ActiveXObject("Shell.Application"); 

objShell.ShellExecute(filename, params, "", "open", 3);

history.back(); 
} 
</script>

<body>

<b>WINAMP</b>
<br><br>
Now Playing: <script language="JScript" src="winamp.js"></script><br>
<a onClick=" ShellExJParam('C:\\Program Files\\Coolmon\\ActiveDesktop\\WinampRemote.exe', 'hide previous')" href="back.html" target="_self">Back</a>  
<a onClick=" ShellExJParam('C:\\Program Files\\Coolmon\\ActiveDesktop\\WinampRemote.exe', 'hide playpause')" href="back.html" target="_self">Play|Pause</a>  
<a onClick=" ShellExJParam('C:\\Program Files\\Coolmon\\ActiveDesktop\\WinampRemote.exe', 'hide next')" href="back.html" target="_self">Forward</a>

</body>
</html>

Let me know whether that works. Also, if anyone has any ideas on how to get "explorer /root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" etc to work let me know (although there is a workaround that I am using for some things like My Computer.

Additionally, I've attached a pic of my desktop so far for anyone that is interested.
 
Re: Re: Program Execution

Originally posted by robe
However, I am having trouble with opening programs such as My Computer using this method. I have tried simply putting "explorer /root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" in but this does not work. I've fiddled around a bit but have not manged to resolve this - any ideas? [/B]

Ahh yes, a good improvement to the code, thanks robe :). I forgot about the parameters options of shellex.

Funnily enough you actually solve the above problem with your own code, as you can see /root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D} is actually a parameter of explorer so all you need to do is use something like this

Code:
<a onClick="ShellExJParam('explorer', '/root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}' )" href="javascript:;">MyComp Java Param Exec</a><br>
 
hey robe, cool code for parameters. umm about your Winamp "dilly" do you get that file that you are executing from Coolmon, or did you have to dig it up elsewhere? i'm referring to WinampRemote (i think)
 
You can get the winamp thing through coolmon, but I am actually doing in with the active dektop (I wanted it on the left with the controls). WinampRemote is used to control winamp and this is separate from the 'Now Playing'.

The 'Now Playing' thing is a little thing in Winamp that outputs the current track to a txt file. However, as HTML can't import a text file I've had to make Winamp output the 'Now Playing' with a little bit of javascript and then make the active desktop refresh every few seconds. Not ideal (the refreshing) but it's a massive problem.

If you were wondering, the template that Winamp is using is:

Code:
var msg= ' %5 \n ';
document.write( msg );

where %5 is the current track.
 
n00b on your hands now!

Firstly let me say " Great walkthrough/tutorial!" It's finally gotten me off my butt to learn and try to do this and for that I thank you.

Secondly, I've gone as far as page 26 but the itch to start creating got the upper hand so off I went. I created a background made my boxes, started doing the HTML coding and have now run into a big road block. (remember I'm a complete n00b at this) In the tutorial it says to use
- SHUTDOWN: %windir%\system32\tsshutdn.exe 0 /DELAY:0 /POWERDOWN
- REBOOT: %windir%\System32\shutdown.exe -r -t 00
- LOCK PC: %windir%\System32\rundll32.exe user32.dll,LockWorkStation
- USER ACCOUNTS: %windir%\System32\control.exe userpasswords2
- SERVICES: C:\WINDOWS\system32\services.msc
- EVENT VIEWER: %SystemRoot%\system32\eventvwr.msc /s

However as I'm running Windows 2000 Pro ( I assume the tutorial was done on Win XP) my shutdown and such seems to either be named differently, or in another place entirely. My question is how do I track down the programs I'm looking for (IE shutdown) so I can make the correct shortcuts? I would like to know how to track them so I wont have to bug you fine Gents/Women about these pesky things ;o)

Thx for any help,
Idle Hands
 
Hey guys, I've been following the thread since the begining, And finally I started working on my own custome AD :)

anyway, i've got this problem with the following code, When I click it, it opens two windows, one with java script:; (without the space, ofcourse) in the address bar, and one with the actual my computer window, how can i prevent it from opening the additional unwanted window?

<a onClick="ShellExJParam('explorer', '/root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}' )" href="Javascript:;">My Computer</a>


while im at it, I tried making a link to the control panel, with
<a onClick="ShellExJParam('explorer', '/root,,::{21EC2020-3AEA-1069-A2DD-08002B30309D}' )" href="Javascript:;">My Computer</a>

and all I get is a pop up with ::{21EC2020-3AEA-1069-A2DD-08002B30309D} is not found, I was wondering, how can I tell whats the certain key for an action?

Thanks ;)

(and g'night)
 
Originally posted by Zil
Hey guys, I've been following the thread since the begining, And finally I started working on my own custome AD :)

anyway, i've got this problem with the following code, When I click it, it opens two windows, one with java script:; (without the space, ofcourse) in the address bar, and one with the actual my computer window, how can i prevent it from opening the additional unwanted window?




while im at it, I tried making a link to the control panel, with


and all I get is a pop up with ::{21EC2020-3AEA-1069-A2DD-08002B30309D} is not found, I was wondering, how can I tell whats the certain key for an action?

Thanks ;)

(and g'night)

try using target="_self" in the link tag, that helped supress the problem for me.

<a onClick="ShellExJParam('explorer', '/root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}' )" target="_self" href="java script:;">My Computer</a>
 
Yey! Many thanks! :)

it worked :D

any clue about the second question? :)

about the link to the control panel?
 
control panel link

Hi. I'm not sure about the reg key for control panel. But for a link, just point it to windows\system32\control.exe.
Hope I read your post right. :blink:
 
Looks like I need some help again....

Whenever I click on one of my links to either My Network Places or Internet Explorer, it sits there and does nothing. The mouse pointer turns to a hourglass for a second, but that's it. My Computer and Recycle Bin work fine, which is weird.
Here is my HTML source code for it....
Code:
<html>
<head>
<script>
function exec (command) {
  if (document.layers && navigator.javaEnabled()) {
    window._command = command;
    window.oldOnError = window.onerror;
    window.onerror = function (err) {
      if (err.indexOf ("User didn't grant") != -1) {
        alert('command execution of ' + window._command + 
              ' disallowed by user.'); 
        return true;
      }
      else return false;
    }
    netscape.security.PrivilegeManager.enablePrivilege
('UniversalExecAccess');
    java.lang.Runtime.getRuntime().exec(command);
    window.onerror = window.oldOnError;
  }
  else if (document.all) {
    window.oldOnError = window.onerror;
    window._command = command;
    window.onerror = function (err) {
      if (err.indexOf('utomation') != -1) {
        alert('command execution of ' + window._command + 
              ' disallowed by user.'); 
        return true;
      }
      else return false;
    };
    var wsh = new ActiveXObject('WScript.Shell');
    if (wsh)
      wsh.Run(command);
    window.onerror = window.oldOnError;
  }
}
</script>

<title>
Active Desktop 2.0
</title>
</head>
<body background="razorwall1600.jpg" link="#000000" vlink="#000000" alink="#000000">

<font face="Arial">

<br>
<h2>
.desktop<font color="#666666">system</font>
</h2>
<font color="#666666">
<ul>
<li><b><a onClick="exec('mycomputer.vbs'); return false;" href="javascript:void(0)" style="text-decoration:none">my computer</a></b>
<li><b><a onClick="exec('recyclebin.vbs'); return false;" href="javascript:void(0)" style="text-decoration:none">recycle bin</a></b>
<li><b><a onClick="exec('network.vbs'); return false;"    href="javascript:void(0)" style="text-decoration:none">network</a></b>
</ul>
</font>

<p>
<h2>
.desktop<font color="#666666">internet</font>
</h2>
<ul>
<li><b><a onClick="exec('ie.vbs'); return false;" href="javascript:void(0)" style="text-decoration:none">internet explorer</a></b>

</ul>
</p>
</body>
</html>
Any ideas?
 
mupp that code looks fine, but what about for the vbs files, what links are you using?
 
I actually fixed it myself - in the VBS files, some required a shortcut in the same folder, others required a path to the actual .exe file - it just took guess and check skills to find out :)
 
I'm trying to get links to specific control panel items to work, but the code below, for example, gives an error that the file doesn't have a program associated with it for the action. Does anyone know of a better way to make a link to specific control panel items?

<a target="_self" href="javascript:ShellExJ('C:\\WINDOWS\\system32\\desk.cpl');">Display Properties</a>

Also, is it possible to make links like this for the recycle bin and my network, or do I have to use vbscripts?

Edit:

I'm also having problems with a link to WinMX.
<a target="_self" href="javascript:ShellExJ('F:\\Program Files\\WinMX\\winmx.exe');">WinMX</a>
When I try to launch from this link, WinMX says that it can't find the incoming files folder. Anyone else who uses WinMX know how to fix this?
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back