NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page How do you detect resolution & launch an app with javascript?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-27-2003, 12:53 AM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



How do you detect resolution & launch an app with javascript?


Good Evening,

I created a CD presentation in Swish its just like Flash. It has an autorun file, & Im going to add 2 files to cater to different resolutions, 800x600 & 1024x760. What I would like to do is add a javascript that when the viewer puts the CD in, it would autroun and scan the systems resolution settings & launch the appropriate file:

IE: The viewers system is set @ 800x600, he/she puts CD in drive, the 800x600 version of the presentation is launched.


Ive searched around & read up but Im a BIG javascript rookie, how could I do this & could someone suggest a good script to use.


Thank you kindly
Rhino1616 is offline  
Old 11-27-2003, 11:28 AM THREAD STARTER               #2 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Hi I changed it & tried it again & it still doesnt seem to work. If you need to see my file I posted it at: http://uniteddistributorscanada.hypermart.net/ . the file is called "Java intro" & youll also see the files I want to launch there.

Thanks
Rhino1616 is offline  
Old 11-27-2003, 01:27 PM   #3 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Didn't you already figure this out here:

http://webdesigntalk.net/showthread....&threadid=1332

Or is there something else you're trying to do?
deadserious is offline  
Old 11-27-2003, 01:51 PM THREAD STARTER               #4 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Im assuming that only applied to web format. I thought web & producing .exe CD_ROM's are configured differently?
Rhino1616 is offline  
Old 11-27-2003, 02:00 PM   #5 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Doesn't your cd rom contain html? What type of file exactly are you trying to launch depending on the resolution?
deadserious is offline  
Old 11-27-2003, 02:47 PM THREAD STARTER               #6 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Ive created a cd with Swish (its like flash) I then convert my swish file to .swf format & use a 3rd party software called "SWF Studio" to convert it to a stand alone Flash projector
Rhino1616 is offline  
Old 12-01-2003, 12:23 AM THREAD STARTER               #7 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Hi deadserious,

I think I just stumbled across some info that "might" help. I just read that its possible to autorun an HTML file, and if so would it be possible to create a tiny html file with javascript in it that would detect the users resolution and launch the appropriate .exe.

I know the example below is for web redirecting, but couldnt something lalong this line be altered to check rez, then launch app (.exe), and then self close itself (I mean the original html file that autrun launched)? I really dont know Javascript or javascript launch commands, so I dont know how you would launch the .exe or if this is even possible?

IE:


if (screen.width==800||screen.height==600) //if 800x600
window.location.replace("http://www.someplace.com")

else if (screen.width==640||screen.height==480) //if 640x480
window.location.replace("http://www.someplace.com")
????: NamePros.com http://www.namepros.com/programming/15683-how-do-you-detect-resolution-launch.html

else if (screen.width==1024||screen.height==768) //if 1024x768
window.location.replace("http://www.someplace.com")

else //if all else
window.location.replace("http://www.someplace.com")



Thanks
Rhino1616 is offline  
Old 12-01-2003, 04:57 AM   #8 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



Hello.

I work with SWiSH a lot and have run into this problem before. I know from experience JavaScript is not the answer.

Reading your post, I decided to put my new copy of Visual Basic 6 into action, and made you a startup .exe file.

To make this file work with yours, tell the autorun.inf to run "launch.exe". "launch.exe" is attached in the next reply.

Depending on the screen size, it is programmed to redirect to:
1024x768CD.exe
or
800x600CD.exe

Export your projectors to the CD with this name, and there you go.

I hope this helps. If there is any problems, just ask.

P.S. THE DLL FILE REQUIRED TO RUN IS LOCATED HERE
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Old 12-01-2003, 04:58 AM   #9 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



launch.exe
has been zipped in this file:
Attached Files
File Type: zip launch.zip (3.8 KB, 7 views)
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Old 12-01-2003, 10:20 AM THREAD STARTER               #10 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Thanks Mp)Tarh, I'll try it out and get back to you.
Rhino1616 is offline  
Old 12-01-2003, 10:47 AM THREAD STARTER               #11 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Mp)Tarh it worked like a charm! Im so happy . Thank you "VERY" much!!
If there anything else I need to know about the file I'll get back to you.

Thanks again
Rhino1616 is offline  
Old 12-02-2003, 12:43 PM THREAD STARTER               #12 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Hi Mp)Tarh,

The file is great, but I was thinking of changing my file names. Im very new at this kind of stuff, is it possible for me to open the file and alter it myself? Im thinking it cant be too hard (I hope?). Ive altered minor things like Javascript & HTMl before, plus it'll be a learning experience. My friend has Visual basic 6, the files are .exe & dll files, how or what program should i use to open & alter it?

Thanks
Rhino1616 is offline  
Old 12-04-2003, 05:03 PM   #13 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



When Visual Basic saves programs, they are saved as .vbp files. An .exe file is a compiled .vbp file. You cannot alter .exe files. But if you ever want to change your filenames, I made a variation of the program for you. It is attached in my next post.

Here is what you do to change your filenames.

This .exe requires an extra file on the CD, name it "files.txt". Inside this file should be a simple line of text the looks like this:

file1.exe|file2.exe

Change that line of text to fit your filenames.

I included a sample "files.txt" in the .zip file.

I hope this helps!
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Old 12-04-2003, 05:09 PM   #14 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



attached in the post below
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Old 12-04-2003, 05:10 PM   #15 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



 
Attached Files
File Type: zip launch.zip (4.7 KB, 8 views)
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:24 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger