PDA

View Full Version : Interesting things to do to your Desktop.


Sithdarth
06-13-2004, 12:56 AM
Now I have a hard time making decisions; so when I ended up downloading 60 different wallpapers I had a bit of a problem. I just couldn't pick one. So remembering something I read in Maximum PC and my JavaScript book. I formulated a plan. I would simply make my PC load a random background every 2 minutes. I would post a pic but it wouldn't look special. Instead you get to see the code.

<html>
<head>
<title>

</title>
<script language="JavaScript">
var b60=new Image()
var b59=new Image()
var b58=new Image()
var b57=new Image()
var b56=new Image()
var b55=new Image()
var b54=new Image()
var b53=new Image()
var b52=new Image()
var b51=new Image()
var b50=new Image()
var b49=new Image()
var b48=new Image()
var b47=new Image()
var b46=new Image()
var b45=new Image()
var b44=new Image()
var b43=new Image()
var b42=new Image()
var b41=new Image()
var b40=new Image()
var b39=new Image()
var b38=new Image()
var b37=new Image()
var b36=new Image()
var b35=new Image()
var b34=new Image()
var b33=new Image()
var b32=new Image()
var b31=new Image()
var b30=new Image()
var b29=new Image()
var b28=new Image()
var b27=new Image()
var b26=new Image()
var b25=new Image()
var b24=new Image()
var b23=new Image()
var b22=new Image()
var b21=new Image()
var b20=new Image()
var b19=new Image()
var b18=new Image()
var b17=new Image()
var b16=new Image()
var b15=new Image()
var b14=new Image()
var b13=new Image()
var b12=new Image()
var b11=new Image()
var b10=new Image()
var b9=new Image()
var b8=new Image()
var b7=new Image()
var b6=new Image()
var b5=new Image()
var b4=new Image()
var b3=new Image()
var b2=new Image()
var b1=new Image()

b1.src="inuyasha_9_1024.jpg";
b2.src="trigun_28_1024.jpg";
b3.src="wolfsrain_1_1024.jpg";
b4.src="trigun_9_1024.jpg";
b5.src="kenshin_11_1024.jpg";
b6.src="inuyasha_1_1024.jpg";
b7.src="trigun_1_1024.jpg";
b8.src="kenshin_1_1024.jpg";
b9.src="yyh_1_1024.jpg";
b10.src="inuyasha_2_1024.jpg";
b11.src="trigun_2_1024.jpg";
b12.src="kenshin_2_1024.jpg";
b13.src="yyh_2_1024.jpg";
b14.src="inuyasha_3_1024.jpg";
b15.src="trigun_3_1024.jpg";
b16.src="kenshin_3_1024.jpg";
b17.src="trigun_4_1024.jpg";
b18.src="inuyasha_4_1024.jpg";
b19.src="trigun_5_1024.jpg";
b20.src="kenshin_5_1024.jpg";
b21.src="trigun_6_1024.jpg";
b22.src="trigun_7_1024.jpg";
b23.src="inuyasha_5_1024.jpg";
b24.src="trigun_8_1024.jpg";
b25.src="trigun_29_1024.jpg";
b26.src="kenshin_6_1024.jpg";
b27.src="trigun_10_1024.jpg";
b28.src="trigun_11_1024.jpg";
b29.src="inuyasha_6_1024.jpg";
b30.src="trigun_12_1024.jpg";
b31.src="trigun_13_1024.jpg";
b32.src="trigun_14_1024.jpg";
b33.src="kenshin_7_1024.jpg";
b34.src="trigun_15_1024.jpg";
b35.src="trigun_16_1024.jpg";
b36.src="trigun_17_1024.jpg";
b37.src="inuyasha_7_1024.jpg";
b38.src="trigun_18_1024.jpg";
b39.src="trigun_19_1024.jpg";
b40.src="trigun_20_1024.jpg";
b41.src="kenshin_8_1024.jpg";
b42.src="trigun_21_1024.jpg";
b43.src="trigun_23_1024.jpg";
b44.src="trigun_24_1024.jpg";
b45.src="inuyasha_8_1024.jpg";
b46.src="trigun_25_1024.jpg";
b47.src="trigun_26_1024.jpg";
b48.src="trigun_27_1024.jpg";
b49.src="kenshin_9_1024.jpg";
b50.src="trigun_30_1024.jpg";
b51.src="yyh_3_1024.jpg";
b52.src="inuyasha_11_1024.jpg";
b53.src="kenshin_10_1024.jpg";
b54.src="inuyasha_10_1024.jpg";
b55.src="trigun_31_1024.jpg";
b56.src="trigun_22_1024.jpg";
b57.src="kenshin_4_1024.jpg";
b58.src="inuyasha_12_1024.jpg";
b59.src="trigun_32_1024.jpg";
b60.src="kenshin_12_1024.jpg";


var pos = 0;

function backhoe()
{
pos = (Math.round((Math.random()*59)+1))
if(pos==60){pos=1;}
document.body.background=eval("b"+pos+".src");
setTimeout("backhoe()",120000);
}
setTimeout("backhoe()",0);

function moved()
{
var y = (Math.round((Math.random()*692)+1))
var x = (Math.round((Math.random()*948)+1))
follower.style.pixelTop = y
follower.style.pixelLeft = x
follower.style.background = ""
setTimeout("moved()",3000);
}
setTimeout("moved()",0);

function winOpen()
{
win1=window.open('file:///D:/desktop/untitled.html','Error','z-lock=1,fullscreen=1,directories=no,location=no,men ubar=no,scrollbars=0,status=no,toolbar=no,resizabl e=no,dependant=1,alwaysRaised=1');
}
</script>
</head>
<body bgcolor=black onMousemove = " " onClick = "moved()">
<p id="follower" style="height: 45px; width: 45px; position: absolute; z-index:1" onMouseover="winOpen()">
</p>
</body>
</html>

Oh yeah, I also threw in a box that randomly moves every 3 seconds. When you mouseover the box it throw up a blue screen that will look exactly like a error screen. Eventually the only way to get back will be to type in the right password. Although the password box will be disguised as one of those enter file location boxes and the pass will be a filename.

Anyone else do anything cool with their desktop. Throw up a picture if you feel like it and a picture will do it justice. It occurs to me that I might have to much time on my hands.

Dragonsbane
06-13-2004, 03:43 AM
wow, that's incredibly cool..........though I can't understand a WORD of it.

Living Bobbeh
06-13-2004, 04:01 AM
Erm....I put a rather funky Background image on mine?
I moved my stuff (My boxes of stuff) in a differant corner?
Meh, My Desktop stinks(Need to clean it)

Funka Genocide
06-13-2004, 04:10 AM
Sithdarth, that is the geekiest thing I have ever seen in my entire tenure on this planet! *suplicates himself before the awesome dorkiness of Sithdarth* I just started teaching myself javascript, but I still have no idea how it works. The simple fact that you would post the actual code here is beyond my comprehension. "my mind is blown away!" :fighter:

Meister
06-13-2004, 06:41 AM
Now that's cool, although I can't really understand it, apart from very basic principles (= you read from left to right).

If I had a better graphics card, I'd set my Winamp visualization (Milkdrop) to desktop mode, but whenever I try that, everything goes into snail mode. It's really good on faster PCs, though.

Stover
06-13-2004, 09:51 AM
Why would you use javascript to make a program that constantly runs in the background of Windows?

LeefRyder
06-13-2004, 11:30 AM
well there used to be a prank me and my husband would play on eachother, we'd take a screenshot of the desktop, hide all the icons, start menu and tool bar, and then put the screen shot as the desktop image so we'd think our computer was frozen. kind of amusing. :D

Ren
06-13-2004, 11:53 AM
Sith, Zoa's right. That's pathetically geeky.

...

....Can I have your babies?

cellar_door
06-13-2004, 12:03 PM
while i cant get why someone would spend so much time doing all that i gotta admit its kinda cool, well done

Bombshell
06-13-2004, 12:11 PM
Didn't understand any of it but still it seems cool.

synkr0nized
06-13-2004, 01:16 PM
And here I would have just installed a wallpaper-randomizer instead of making use of the Active Desktop and webpage content feature.

How about a screensaver that looks as if it's formatting the system disk? That was a fun one.

AndyBloodredMage
06-13-2004, 02:01 PM
For those reasons and more are EXACTLY why I need to teach myself some form of computer language.

Sithdarth
06-13-2004, 03:19 PM
With cut and paste it take me all of 15 minutes to do that. Plus by using JavaScript and html it simplified the program and minimized the cpu usage. The thing that does the switching is like 5 or 6 lines of code. The rest is just variables. I once had a script that caused an image to start out in the corner and try to catch the mouse pointer. Then when it did it went back where it began and started over. I could never get it to work smoothly though and after awhile it was a little annoying.

You think this is geeky. I have a TI92+ which has a clock feature, thats right a clock on a calculator. Anyway I wrote a program for it that displayed a running countdown until my senior graduation down to the second. It actually ticked away while to program ran. All my classmates thought that was funny.

Dragonsbane
06-13-2004, 05:13 PM
Dude, that is cool beyond all mortal comprehension........I want a program like that!

Sithdarth
06-13-2004, 05:31 PM
Which program is that Dragonsbane?

I seem to have a knack for programing. I find that the hardest part is simply coming up with an ideal for a program. I can't wait till college starts again. Then I get to learn C+ and the like which is going to be super easy with all my experience with other programing language. I'm also in the process of enabling my computer to run CGI scripts. Once I get that running and learn Perl then my desktop will do all sorts of cool things. At some point I may throw in some flash as well. Its just I don't know exactly what I'm going to do with the CGI or flash yet.

AndyBloodredMage
06-13-2004, 05:54 PM
How exactly do you go about programming? That is, once you learn the programming language, what sort of program would you run your code?

Sithdarth
06-13-2004, 06:00 PM
With C+ and other programs you compile the code and it sortof runs itself with a little help from windows. With CGI its a special enabled folder that processes the scripts, hence why I have to set my computer up for it. With JavaScript the browser juts runs it if it understands it. Most programing actualy ends up consisting of half math operations and half predefined commands. Its how you put it all together. As to how a programing language works and how a computer knows what you mean when you use commands I have no ideal.

Stover
06-13-2004, 09:32 PM
I would have thought javascript more inefficient because it needs a browser, or other program of some sort, to run the programs, while Windows will run a C++ .exe file by itself.

Or can you make an .exe-like file with javascript?

Edit: I ask this because I've only ever taken BASIC and C++, and both were a long time ago. I've had only minor experiences with HTML (I can build you a very basic website with a little effort), and almost none with javascript.

Sithdarth
06-13-2004, 09:37 PM
Windows has the nice little feature that lets you set your desktop as a webpage or an html document you happen to have saved. When you do that your desktop acts like what ever version of IE you have. Thus it actually takes much less code and cpu usage to do things like my background changer.

Zweihander
06-13-2004, 09:55 PM
I think Andy is looking for a compiler. While most bare-bones compilers are just something run from the command prompt, you can download (or buy, if you're a sucker) an IDE (Integrated Developtment Environment), which adds all sorts of neat stuff to make your life easier. The only languages I know are C++, Java, and a smattering of noncomplex HTML. If I had the time, I'd learn more stuff about scripts, but I don't. The links below will take you to places where you can get the compliers, IDE's, and such.

Dev-C++, an open-source C++ IDE (http://bloodshed.net/dev/devcpp.html)
The Java environment, needed to run a compiled Java program (http://java.sun.com/j2se/1.4.2/index.jsp)
The Java SDK, needed to make and compile Java programs, scroll down to where it says "Download" (http://java.sun.com/j2ee/1.4/download.html)

The C++ compiler I linked to is different than what you might find in the more expensive and popular Visual C++ (EDIT: which uses the Borland C++ compiler, also very popular) or whatever they sell. The syntax remains the same, but some class files (mainly conio.h and some other stuff) aren't included in Dev-C++. And JAva is weird; when it compiles, it creates a .class file, which needs the runtime environment to actually be used. In this way, JAva is slower, but much more cross-platform compatible, meaning that a .exe file can't be run on Mac or Linux, but any OS with the environment installed can run a .class file.

I also violently recommend googling some tutorials up. The Dev-C++ page has some links to decent ones, including one on how to use C++ and its GUI stuff. HTML and Javascript only needs a text editor (Word, notepad, etc.) and a browser. Have fun, and as someone once said, "Programming is the act of applying logic to creativity."

Stover
06-13-2004, 09:57 PM
I would think that having IE always running in the background running a javascript application would take up more reasources than the Windows shell running an .exe. I could be wrong, I've never actually taken a look at how memory usuage would stack up in a case like that.


But the real problem is that you'll have IE running. And that's never good.





Ever.

Sithdarth
06-13-2004, 10:01 PM
No No. IE doesn't run at all. Your desktop acts like its IE. It decodes and treats the data as IE whould but that is as far is it goes. It doesn't open a new program. Your desktop acts like its a browser but no new programs are opened.

Stover
06-13-2004, 10:04 PM
Oh, ok, I remeber what you're talking about. Its just that this is the first time I've ever about it in about a year.

But the point about IE still stands.

synkr0nized
06-14-2004, 12:25 AM
Windows Explorer and Internet Explorer are extremely closely related to one another. Ever browse to a website from your C:\ folder?

Anyway, Explorer.exe, the shell (desktop, icons, start menu, taskbar, system tray) that most Windows users employ, will then hook the appropriate aspects of IE/Windows to run Active Desktop items.

As you may guess, it's a good idea to know what you are putting on an Active Desktop. But, within the frame of this thread and its topic, it's perfectly fine.

Sithdarth
06-14-2004, 11:54 AM
Ok so I'm about to do something really nice here. Anyone that wants there desktop to switch backrounds and doesn't want to go through a lot of trouble here is what you do:

1) Take all the pictures you want to use for your desktop and put them into one folder and name it something like desktop wallpapers.
2) Somehow get a list of all the image files you just put into that folder and PM it to me.
3) Then wait for me to PM you back with some html code
4) Copy and paste the code into a blank notepad document and click file save as. Then select all files in the save as field and change the extension to html instead of .txt
5) Then in the explorer window find that folder with your desktop image files in it and save the file there as index.html
6) Go into display then the desktop tab and click the browse button next to the background selection field.
7) Then find the folder with the file you just saved and the desktop images and open it.
8) Select the html file you saved and click Open then hit the Apply button and close the display box

Then that should do it. Wait two minutes and your background will change, or if you want a different time delay just include it in the PM with the file list and I'll change it accordingly. I'm doing all this in my spare time but you should have your response within the day if something unforseen doesn't happen.

Grandmaster_Skweeb
06-14-2004, 09:40 PM
well there used to be a prank me and my husband would play on eachother, we'd take a screenshot of the desktop, hide all the icons, start menu and tool bar, and then put the screen shot as the desktop image so we'd think our computer was frozen. kind of amusing. :D


my friends and I would do stuff like that to our computer art teacher on the stupid crap Macs (poorly set up. and i mean hideously poorly set up). We'd also change the error boxes to say random things like You know you hurt the computer's feelings when you blame all the errors on it. or Its not the computer being stupid. Your just an idiot.

this one she actually believed Critical Error: the radiation belt has been deactivated due to a virus attack. Please vacate an area of 6 feet around to avoid radioactive contamination. she made everybody back away from the computers and all my friends and I did was laugh and laugh and laugh. oh those were the days

AndyBloodredMage
06-15-2004, 05:08 AM
Skweeb, how did you alter the error messages? My bro has an old imac somewhere, is it possible to change it on those?