Skip to main content
GameDev.net gamedev.net
🔒 Locked

Visual Basic Question

Started by firefly2442 Apr 11, 2002 at 7:53 PM 10 replies 350+ views
Original Post
firefly2442
firefly2442
In Visual Basic how do you open up a file and launch it. I have an internet shortcut that I want to open in Visual Basic but I don''t know how. -Thanks http://abyssgames.cjb.net
http://www.rivetcode.com
VisualB4BigD
VisualB4BigD
To do that you use

Shell(pathname[,windowstyle])

WindowStyle:

vbHide Window is hidden and focus is passed to the hidden window.

vbNormalFocus Window has focus and is restored to its original size and position.

vbMinimizedFocus Window is displayed as an icon with focus.

vbMaximizedFocus Window is maximized with focus.

vbNormalNoFocus Window is restored to its most recent size and position. The currently active window remains active.

vbMinimizedNoFocus Window is displayed as an icon. The currently active window remains active.

Hope that helps

I sure hope this world isn't one big joke, because I don't get it.

[edited by - VisualB4BigD on April 11, 2002 9:09:03 PM]
firefly2442
firefly2442
Hmm... I''m not able to get it to work. I put in

Shell("C:\Kit Constructor\Abyss Software Website",[vbMaximizedFocus])

but it comes up with an error that says I need a "=" sign and that there''s a compile error. What am I doing wrong?

Thanks!

http://abyssgames.cjb.net
http://www.rivetcode.com
alexmoura
alexmoura
Use
Shell "C:\Kit Constructor\Abyss Software Website",[vbMaximizedFocus]

vb6 is very picky about using parentheses - you allways need to assign the result of something that has parentheses

You know, I never wanted to be a programmer...

Alexandre Moura
firefly2442
firefly2442
What is the file ending for IE shortcuts? Like installers have .exe, what is the ending for shortcuts?
-Thanks

http://abyssgames.cjb.net
http://www.rivetcode.com
eldee
eldee
quote:
Original post by firefly2442
What is the file ending for IE shortcuts? Like installers have .exe, what is the ending for shortcuts?
-Thanks

http://abyssgames.cjb.net


*.lnk

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

VisualB4BigD
VisualB4BigD
Shell "C:\Kit Constructor\Abyss Software Website",[vbMaximizedFocus]

When you use this function, you have add the file extention as part of the filename, it has to know what type of file it is. It will use windows settings to determine what program to open. And I think you already know this but you shouldn''t use the brackets ([]) when you give the last property.

Good Luck - Email me if you need help (I''ve used the function alot) - dildan2004@hotmail.com

I sure hope this world isn''t one big joke, because I don''t get it.
Lestat3D
Lestat3D
Hi,
I''m kinda Visual Basic Guru, and I will answer the firefly2442 question, just prepare yourselves.
In first place, in VB, you launch a program using the Shell function, but you cannot do a Shell "hola.txt", this causes an error. You only can use Shell to launch .exe files.
In second place, to open a file such as a .htm file but ignoring wether you open it by default with Netscape or Explorer, you just must do as follows
Shell "c:\WINNT\explorer.exe File.htm"
this statement will open the File.htm file with your default browser.
DaTroof
DaTroof
quote:
Original post by Lestat3D
Hi,
I''m kinda Visual Basic Guru, and I will answer the firefly2442 question, just prepare yourselves.
In first place, in VB, you launch a program using the Shell function, but you cannot do a Shell "hola.txt", this causes an error. You only can use Shell to launch .exe files.
In second place, to open a file such as a .htm file but ignoring wether you open it by default with Netscape or Explorer, you just must do as follows
Shell "c:\WINNT\explorer.exe File.htm"
this statement will open the File.htm file with your default browser.


You can open a file using its default association with the start command. Example:

Shell "start http://www.microsoft.com"

Shell "start hola.txt"
Post Extant Graphical MUD
eldee
eldee
quote:
Original post by Oluseyi
[Completely OT:]
eldee, just wanted to mention that your new logo in your sig is absolutely spiffy!



hah thanks
i''ll let you know when my new site is done.. it''s going to
have lots of that sorta stuff.


-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

henrym
henrym
The extension for Internet shortcuts is .URL

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.