 |

05-01-2004, 01:51 AM
|
|
Newcomer
|
|
Join Date: Apr 2004
Posts: 7
|
|
|
how can i open up a vb project?
atm i am using:
shell "explorer c:\project1.vbp"
this works, but it brings up the "download file" window (where it has "open", "save", "cancel", "more info...") (u know, like when you download a file off the net). this makes it so that you can save or open. what i want it to do is open automatically (ie. bypass the file download window and go straight to the result of clicking the 'open' button).
thanks,
Colt
|
|

05-01-2004, 09:51 AM
|
|
Newcomer
|
|
Join Date: Apr 2004
Posts: 7
|
|
ok i am now trying to invoke a keypress event for O or o (which automatically opens the file from the 'download file' window). is this the best way to do this? or is there a better way to just open it. i know there's probably a way to do it with the API but i don't know anything about API.
if possible can you show me how to do both? (ie invoke a keypress event, and show me how to open the file from the 'download file' window).
btw, just imagine that i am downloading a file off the internet and rather than saving it i wish to open it.
its too bad my project isn't online. then i could just use Inet  .
|
|

05-01-2004, 10:38 AM
|
 |
Junior Contributor
|
|
Join Date: May 2003
Location: Brussels/Alicante
Posts: 259
|
|
hi Colt,
these are two easy way's to do it
Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'with shell u add the path to the file as a "$command"
Private Sub CmdShell_click()
Dim x As Long
x = Shell("vb6 c:\project1.vbp", vbNormalFocus)
End Sub
'with the ShellExecute API the default program for ".vbp" will open it
Private Sub cmdShellExecute_Click()
Call ShellExecute(0, "Open", "c:\project1.vbp", vbNullString, vbNullString, vbNormalFocus)
End Sub
|
__________________
Keyboard error or no Keyboard present
Press F1 to continue, DEL to enter SETUP
|

05-05-2004, 06:35 AM
|
|
Newcomer
|
|
Join Date: Apr 2004
Posts: 7
|
|
Quote:
|
Originally Posted by Anz
hi Colt,
these are two easy way's to do it
Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'with shell u add the path to the file as a "$command"
Private Sub CmdShell_click()
Dim x As Long
x = Shell("vb6 c:\project1.vbp", vbNormalFocus)
End Sub
'with the ShellExecute API the default program for ".vbp" will open it
Private Sub cmdShellExecute_Click()
Call ShellExecute(0, "Open", "c:\project1.vbp", vbNullString, vbNullString, vbNormalFocus)
End Sub
|
thanks this code helped alot.
|
|

05-05-2004, 06:38 AM
|
 |
Martian In Disguise
Retired Moderator * Guru *
|
|
Join Date: May 2003
Location: Minneapolis, MN
Posts: 9,566
|
|
Split from this hijacked, archived thread.
|
__________________
The only stupid question is the one that goes un-asked.
|

05-05-2004, 08:26 AM
|
|
Newcomer
|
|
Join Date: Apr 2004
Posts: 7
|
|
Quote:
|
Originally Posted by colt_777
thanks this code helped alot.
|
ummmm actually on second thoughts i don't have a clue how to use these. can any1 explain them to me?
thnx,
Colt
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|