Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > open other exe's


Reply
 
Thread Tools Display Modes
  #1  
Old 05-01-2004, 01:51 AM
colt_777 colt_777 is offline
Newcomer
 
Join Date: Apr 2004
Posts: 7
Default


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
Reply With Quote
  #2  
Old 05-01-2004, 09:51 AM
colt_777 colt_777 is offline
Newcomer
 
Join Date: Apr 2004
Posts: 7
Default

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 .
Reply With Quote
  #3  
Old 05-01-2004, 10:38 AM
Anz's Avatar
Anz Anz is offline
Junior Contributor
 
Join Date: May 2003
Location: Brussels/Alicante
Posts: 259
Default

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
Reply With Quote
  #4  
Old 05-05-2004, 06:35 AM
colt_777 colt_777 is offline
Newcomer
 
Join Date: Apr 2004
Posts: 7
Default

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.
Reply With Quote
  #5  
Old 05-05-2004, 06:38 AM
00100b's Avatar
00100b 00100b is offline
Martian In Disguise

Retired Moderator
* Guru *
 
Join Date: May 2003
Location: Minneapolis, MN
Posts: 9,566
Default

Split from this hijacked, archived thread.
__________________
The only stupid question is the one that goes un-asked.
Reply With Quote
  #6  
Old 05-05-2004, 08:26 AM
colt_777 colt_777 is offline
Newcomer
 
Join Date: Apr 2004
Posts: 7
Default

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
Reply With Quote
Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->