|
-
Apr 24th, 2007, 08:23 PM
#1
Thread Starter
New Member
visual basic 6 taskbar
I'm planning to make a task bar and really need help on a number of things. I'll ask each thing I need help with instead of asking for how to make the whole thing.
just found out how to make a clock.
how can I open image files (jpg, gif, etc) using visual basic? I'm guessing it's sort of the same as opening exe files.
shell "path and file" is basically how you open exe files. Is opening image files similar to that?
Last edited by Spectacle; Apr 24th, 2007 at 08:27 PM.
-
Apr 24th, 2007, 08:39 PM
#2
Re: visual basic 6 taskbar
If you use the ShellExecute API, it will launch the file in the windows default viewer.
-
Apr 24th, 2007, 08:47 PM
#3
Hyperactive Member
Re: visual basic 6 taskbar
Well, if you have a specific extension of the file that a certain program of yours you know will open, you could use something like this... given that you got the actual file path of the picture.. For example, if you had the file
mypicture.exe
and wanted to change it from .exe to .jpg, you could write like::
vb Code:
aa = "mypicture.exe"
bb = Left(aa, 9)
cc = bb & ".jpg"
MsgBox cc
To get it back to a jpeg.. Just an example
"Remember, remember the 5th of November, the gun powder treason and plot. I know of no reason why the gun powder treason should ever be forgot."
-
Apr 24th, 2007, 08:47 PM
#4
Thread Starter
New Member
Re: visual basic 6 taskbar
 Originally Posted by Negative0
If you use the ShellExecute API, it will launch the file in the windows default viewer.
Not sure what you mean. I tried
Code:
ShellExecute "C:\Documents and Settings\Charlie\My Documents\untitled.JPG"
but it didn't work
-
Apr 24th, 2007, 10:30 PM
#5
Re: visual basic 6 taskbar
-
Apr 25th, 2007, 07:49 AM
#6
Thread Starter
New Member
Re: visual basic 6 taskbar
 Originally Posted by iPrank
that seems a bit complicated to run. Also I think those are for a different version of visual basic.
-
Apr 25th, 2007, 08:05 AM
#7
Re: visual basic 6 taskbar
Perhaps we are getting stuck on terminology.
What do you mean by "Open"?
If you simply want to display them, then using a Picturebox control or an Image control should do the trick.
-
Apr 25th, 2007, 08:45 AM
#8
Thread Starter
New Member
Re: visual basic 6 taskbar
 Originally Posted by Hack
Perhaps we are getting stuck on terminology.
What do you mean by "Open"?
If you simply want to display them, then using a Picturebox control or an Image control should do the trick.
I mean opem them in the windows image viewer.
-
Apr 25th, 2007, 09:54 AM
#9
Re: visual basic 6 taskbar
The links IPrank provided show you how to use the shellexecute function as I stated.
Look at this link in particular, it does exactly what you are trying to do:
http://support.microsoft.com/kb/q170918/
You could easily get by without declaring all of those SE_ERR constants and you don't need the case statement, it just helps you figure out what the error was if you got one.
-
Apr 25th, 2007, 12:24 PM
#10
Thread Starter
New Member
Re: visual basic 6 taskbar
 Originally Posted by Negative0
The links IPrank provided show you how to use the shellexecute function as I stated.
Look at this link in particular, it does exactly what you are trying to do:
http://support.microsoft.com/kb/q170918/
You could easily get by without declaring all of those SE_ERR constants and you don't need the case statement, it just helps you figure out what the error was if you got one.
ok I'll take a look at that.
is there a way to close programs? like
close "C:\WINDOWS\calc.exe"
or something.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|