Active Desktop Tutorial

OK I think I have found the bit in the javascript where it parses the url that you specify in the program that makes the menu.

The line goes like this:
s+="<A HREF="+addquo(item.url=="" ? "javascript:;" : item.url);

for the URL I originally had specified was exec(shortcut.vbs), I think that I need to modify the code to put in the URL after the <a and then have href="javascript:void(0)" in there by default, but I am not sure how to modify the above line to do that.
 
Actually if someone could just tell me what each section of that code does then I can do it myself
 
aaaaaaaaaaaaaaaaaaaaagggggggggggggggggggggggghhhhhhhhhhhhhhhhhhhhhhhhhh

I am going out of my mind tryin to get this to work, why wont it work.
 
This is definitely some cool stuff.. One question though, won't active desktop slow down or otherwise stifle performance on your machine?? Knowing me, I'll probably implement it just to see what happens lol!!

Neway, that's the only thing I can see as a drawback to this but nonetheless fantastic tweak!

SpiRiT :D
 
Didn't slow performance at all for me, if it did it certainly wasn't noticable.
 
Turning Active Desktop was one of the things you could do to squeeze that tiny drop of performance from your PC, back in the 400-700 MHz days, but that has all changed now, with these 1.5 GHz onwards CPUs, the Active Desktop is more like the tinyiest microscopic drop of water you can imagine, divided and infinte number of times, being dropped in the middle of the Atlantic Ocean were it to be only 100m deep at all places and spread as far as would be required.
The effect would be almost as minimal as that.
 
reading that makes me have to go to the bathroom Geffy...
 
this might have been posted before but what the hell

I added the ability to browse and load any .txt on the desktop notepad, simple but handy. Here's the code


<head>
<script language="VBSCRIPT">
<!--

Set fs = CreateObject("Scripting.FileSystemObject")
Const ForReading = 1, ForWriting = 2, ForAppending = 3

Sub SaveButton_OnClick
filename = Document.notes.TheFile.value
Set a = fs.CreateTextFile(filename, true)
a.Write(Document.notes.qnotes.value)
a.Close
End Sub

Sub LoadButton_OnClick
filename = Document.notes.TheFile.value
if fs.FileExists(filename) then
Set a = fs.OpenTextFile(filename,ForReading)
Document.notes.qnotes.value = a.ReadAll()
a.Close
else
Document.notes.qnotes.value = "Invalid Filename"
end if
End Sub
-->
</script>
</head>
<body>
<form name="notes">
<textarea name="qnotes" cols="20" rows="7" wrap="PHYSICAL"></textarea><br>
<input type=file name="TheFile"><br>
<input type=button name=SaveButton value=Save>
<input type=button name=LoadButton value=Load>
</form>
</body>
 
There may be an issue with Warcraft 3 and active desktop I downloaded and installed the newest patch out of warcraft 3 and after playing a game then turning it off none of my links on the desktop would work anymore to open programs. I restared, checked my code because I had been messing with it earlyer and thought maybe the page had just refreshed and it was hossed. nope that wasn't it, so I rolled my pc back one day and now it works fine again. but the only thing that I did other then chat on aim was play warcraft 3 thats it I did nothing else. So I was just trying to give some of you guys a heads up b4 u update your game. oh and after that the game thinks it isn't updated anymore so I'm thinking it must make some kind of registry entry that is screwing active desktop up. let me know if u guys have the same problem.



ps. sorry its late and im tired spelling and gramma aren't the best right now.
 
Originally posted by Krux
There may be an issue with Warcraft 3 and active desktop I downloaded and installed the newest patch out of warcraft 3 and after playing a game then turning it off none of my links on the desktop would work anymore to open programs. I restared, checked my code because I had been messing with it earlyer and thought maybe the page had just refreshed and it was hossed. nope that wasn't it, so I rolled my pc back one day and now it works fine again. but the only thing that I did other then chat on aim was play warcraft 3 thats it I did nothing else. So I was just trying to give some of you guys a heads up b4 u update your game. oh and after that the game thinks it isn't updated anymore so I'm thinking it must make some kind of registry entry that is screwing active desktop up. let me know if u guys have the same problem.



ps. sorry its late and im tired spelling and gramma aren't the best right now.

I had the same problem when i installed UT2K3, couldn't find a work around either
 
Launch problem

<script language="JavaScript">
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;
}
}
:::THEN:::

<a onClick="exec("navfit.vbs"); return false;" href="java.close.window()">Launch Navfit</a>

VBScript:
Dim oShell
Set oShell = WScript.CreateObject ("WScript.shell")
oShell.run "Navfit"
Set oShell = Nothing


Vbscript Name: "navfit"
Shortcut Name: "navfit"

No spaces in java and script either.

Tried the "<a onClick="exec(navfit.vbs'); return false;" href="java script:void(0)">"

All I get is a error on the page, then when clicking I get a new IE window with a page not displayed error.

What am I doing wrong??
 
Originally posted by djwhite
I had the same problem when i installed UT2K3, couldn't find a work around either


well I guess my work around is going to be to not play on bnet anymore tell the next patch and hopfully it won't do that anymore or if madmatt maybe thinks there is some other way to work the js so it dosn't do that I dunno.



Has anyone else here tryed patching there game to see what happens?
 
Program Execution

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.
 
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 awesome!
 
Hey team.

I've been lurking around the AD thread for a while now, and after throwing one together, I seem to have hit a brick wall.

I've downloaded a simple DHTML menu from dynamicdrive.com and have got it to work to some degree. However, my problem arises when I try and link the menu items to programs on my computer. I have been able to create shortcuts and the vbs files in the Windows directory, and they have worked perfectly. What I don't understand is how to link to programs via the menu itself.

For example, I want to have a shortcut in the menu that executes Notepad. This is the code from the menu:

Menu1=new Array("[ g o > > > > > ]","blank.htm","",15,20,138);
Menu1_1=new Array(">","blank.htm","",0,20,138);
Menu1_2=new Array("Notepad","****","",0,20,138);

The *'s indicate where I am supposed to put a link to either a web page, or, I am assuming, a program shortcut.

There is probably a very basic solution to this problem, but I have VERY limited knowledge of DHTML. Just wondering if any of you AD gurus can give me a hand on this one. The base code for the menu is at dynamicdrive.com, called hvmenu.

Thanks, and I seriously appreciate all the work you guys do on this site, not just in this thread, but in all the other ones as well.

Cheers,

sparti_kus.
 
sparti_kus you'll need to link the to the javascript which calls the vbs file (refer to the tutorial for that info) and make sure it is incorporated into the html page where you have the menu. Then when you want notepad you'll need to reference the javascript function for the link.

e.g.

Menu1_2=new Array("Notepad","javascript: exec('notepad.vbs')","",0,20,138);

or, as I haven't looked at the menu perhaps try

Menu1_2=new Array("Notepad",javascript: exec('notepad.vbs'),"",0,20,138);

the import thing is your linking to the exec command, not the shortcut or vbs itself, reread the program launch section as it explains everything. As an alternative you can use the code I posted previously to simplify matters so you won't need a vbs or shortcut and can simply link to the program directly
 
wow, that is some awesome code up there luminosity. must impliment....
 
Thanks luminosity. Went through the tutorial again and just used the simple exec command in the menu and it seems to work. For now. :huh: The damn thing has a tendency to disappear everytime I modify it!
 
Does anyone know of any cool pages for scrips and or code for active desktop ?

I know this has probably been asked a millino times, but this topic is like over 30 pages long and I don't have time to read through it.



I do know HTML, but after reading the tutorial I still feel like I am missing something.


Ah, don't hate me because I am stuipd. I am new to this AD thing and I find it really cool.

Just have not figured it out all the way yet.
 

Members online

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,495
Members
5,624
Latest member
junebutlertd
Back