Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Launch A Program And Wait For It To End!! How??


I have made an autorun program for my friend that automatically detects whether a certain codecs is installed. If not, it will launch a setup EXE file which installs the codecs. Now I want the program to wait for the setup program to end, and then continue launching the application... How do I do this??

I have found an article here on VB World but it generates errors.

WinME : Overflow
W2K : Says something like the entry does not exist in the library (using API)

HELP ME PLEASE!!!!!!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Launch External App And Wait
Hi,

I can shell execute a programme, but I want to wait until that program is finished running before continuing on to the next line of code, is this possible?

Thanks in advance.

Launch App And Wait - URGENT
I have a VB app that launches an installation patch file. The installation may or may not begin other processes. I need to know how to wait until ALL processes started by the patch installation before ending the VB application. Here is the code I have, but in certain cases where the patch installation begins another process, the VB application attempts to end prematurely.

'get the task id of the patch installation file
process_id = Shell(file_name)

'get the process handle
process_handle = OpenProcess(SYNCHRONIZE, 0, process_id)

'wait for patch to finish
If process_handle <> 0 Then
WaitForSingleObject process_handle, INFINITE
CloseHandle process_handle
End If

'restore the registration values that were erased by the patch
VB_R_set_registration

End

THANKS!

Launch An App And Wait Until It Has Completed Loading
I have a .net app I have written and wish VB6 to launch the app (so that a status bar can be shown whilst it is loading ever so slowly being a .net application).

No I want this app to be used to launch various applications, depending on which app exe name is clicked. Only problem is I may not know the app title name for launching it/finding out if it has completed loading.

Here is the code I have:


Code:

Dim ApllicationHasLoaded As Boolean
Dim ApplicationEXEName As String
Dim ApplicationEXEPath As String
ApllicationHasLoaded = False

tmrStartApp.Enabled = False

ApplicationEXEName = App.EXEName
ProgressBar.Value = 4
ApplicationEXEPath = App.Path

Select Case ApplicationEXEName

Case "Application 1"

ProgressBar.Value = 5

sAppName = "App 1" 'This is the only thing I dont neccessaraly knw
sAppPath = ApplicationEXEPath & ApplicationEXEName & "_.exe"

Case "Application 2"

ProgressBar.Value = 5

sAppName = "App 2" 'This is the only thing I dont neccessaraly knw
sAppPath = ApplicationEXEPath & "" & ApplicationEXEName & "_.exe"

Case "Application 3"

ProgressBar.Value = 5

sAppName = "App 3" 'This is the only thing I dont neccessaraly knw
sAppPath = ApplicationEXEPath & ApplicationEXEName & "_.exe"


End Select

'start an application
Shell sAppPath, vbMinimizedFocus

ProgressBar.Value = 6

Do Until ApllicationHasLoaded = True


'check if application is running
If IsTaskRunning(sAppName) Then
ApllicationHasLoaded = True
Else
ApllicationHasLoaded = False
End If

ProgressBar.Value = 7

Loop

ProgressBar.Value = 8

End

Public Function IsTaskRunning(sWindowName As String) As Boolean

Dim hwnd As Long, hWndOffline As Long
On Error GoTo IsTaskRunning_Eh 'get handle of the application
'if handle is 0 the application is currently not running
hwnd = FindWindow(0&, sWindowName)
If hwnd = 0 Then
IsTaskRunning = False
Exit Function
Else
IsTaskRunning = True
End If
IsTaskRunning_Exit:
Exit Function
IsTaskRunning_Eh:
Call ShowError(sWindowName, "IsTaskRunning")

I.e. if I double click Application1.exe - application1_.exe starts (which is the .net app).

Any ideas - I want to autmate this to remove the case so it is generic for any application but the only thing stopping me is not knowing what the app title could be.

Launch New Process And Wait For It... Example In Vb-world.net Seems Not To Compile
Launch new process and wait for it... example in vb-world.net seems not to compile

1st of all, I'm a beginner so please bear with me incase there's something I'm missing completely...

I wish to launch a process from within my program written in vb6. I am unable to use the code shown when searching for 'shell' on vb-world.com

This uses the API process functions to launch and wait for it to return. It does launch, but does not wait for the process to terminate, leaving me no better off than 'Shell'.

And.. I can only get the example to work if I place the declarations in the module declaration area rather than the frmMain declaration area, and even then I have to replace the private cast with public to allow my code to 'see' these functions from elsewhere. If the declarations are placed in my frmMain code, I am presented with an error such as 'cannot use private enums in a public call' or somesuch.

Help!


Regards

Gary Thomlinson

Launch CR11 Report From VB6? [RESOLVED? Wait And See]
I have generated a CR 11 report based on a SQL Server stored procedure. Can I launch this report from vb6?



Edited by - steal on 7/11/2005 2:41:13 PM

Hide Dos Window -launch And Wait For Finished
I am using code below to launch my application. If lauched application is DOS based then a dos window appears. What i have to do for hide dos window.


Code:
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type

Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type

Private Declare Function WaitForSingleObject Lib _
"kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds _
As Long) As Long

Declare Function CreateProcessA Lib "kernel32" _
(ByVal lpApplicationName As Long, ByVal lpCommandLine As _
String, ByVal lpProcessAttributes As Long, ByVal _
lpThreadAttributes As Long, ByVal bInheritHandles As Long, _
ByVal dwCreationFlags As Long, ByVal lpEnvironment As Long, _
ByVal lpCurrentDirectory As Long, lpStartupInfo As _
STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) _
As Long

Declare Function CloseHandle Lib "kernel32" (ByVal hObject _
As Long) As Long

Private Const NORMAL_PRIORITY_CLASS = &H20&
Private Const INFINITE = -1&


Public Sub ExecCmd(cmdline$)
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
Dim ret&

'Initialize the STARTUPINFO structure:
start.cb = Len(start)

'Start the shelled application:
ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)

'Wait for the shelled application to finish:
ret& = WaitForSingleObject(proc.hProcess, INFINITE)
ret& = CloseHandle(proc.hProcess)
MsgBox "finished!"
End Sub

Problem: Starting A Program From Within A Program And Wait Till It Finishes
Hi,

I've the following problem: in the CreateProcessA codeline I got a typematch error.

The code is:
Code:
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
Const SW_SHOWNORMAL = 1

Private Type STARTUPINFO
    cb As Long
    lpReserved As String
    lpDesktop As String
    lpTitle As String
    dwX As Long
    dwY As Long
    dwXSize As Long
    dwYSize As Long
    dwXCountChars As Long
    dwYCountChars As Long
    dwFillAttribute As Long
    dwFlags As Long
    wShowWindow As Integer
    cdReserved2 As Integer
    lpReserved2 As Long
    hStdInput As Long
    hStdOutput As Long
    hStdError As Long
End Type

Private Type PROCESS_INFORMATION
    hProcess As Long
    hThread As Long
    dwProcessID As Long
    dwThreadID As Long
End Type

Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

Declare Function CreateProcessA Lib "kernel32" ( _
    ByVal lpApplicationName As Long, _
    ByVal lpCommandLine As String, _
    ByVal lpProcessAttributes As Long, _
    ByVal lpThreadAttributes As Long, _
    ByVal bInheritHandles As Long, _
    ByVal dwCreationFlags As Long, _
    ByVal lpEnvironment As Long, _
    ByVal lpCurrentDirectory As Long, _
    lpStartupInfo As STARTUPINFO, _
    lpProcessInformation As PROCESS_INFORMATION) As Long

Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Private Const NORMAL_PRIORITY_CLASS = &H20&

Private Const INFINITE = -1&

Public strCmdLine As String


Sub Main()

    intFileLog = FreeFile
    
    strLogFile = App.Path & "Rel_Mens.log"

    If Dir$(strLogFile) <> "" Then
        Kill strLogFile
    End If
    
    Open strLogFile For Append As intFileLog
    
    strLinha = Format(Now(), "d m yyyy hh:mm:ss") + " - Ini."
    Print #intFileLog, strLinha
       
    strIniFile = App.Path & "Acesso.ini"
    strLinha = "strIniFile: " + strIniFile
    Print #intFileLog, strLinha
        
    Dim User As String
    Dim Pass As String
    Dim Database As String
    Dim Source As String
    Dim strConnect As String

    Source = IniGet(strIniFile, "General", "Source")
    Database = IniGet(strIniFile, "General", "Database")
    User = IniGet(strIniFile, "General", "User")
    Pass = IniGet(strIniFile, "General", "Pass")
    
              
    strConnect = "Provider=SQLNCLI; " & _
                "Data Source = " & Source & "; " & _
                "Initial Catalog = " & Database & "; " & _
                "User Id = " & User & "; " & _
                "Password= " & Pass & ";"


    Dim objConn As ADODB.Connection
    
    Dim rstPedidos As ADODB.Recordset
    Dim rstB As ADODB.Recordset
    
    Dim strSQL As String
    Dim strParams As String
    Dim strData As String
    Dim strDias As String
    Dim strSQL2 As String
    Dim strB As String
    Dim intPos As Integer
    
    Set objConn = New ADODB.Connection
    objConn.Open strConnect
       
    Set rstB = New ADODB.Recordset
    
    strSQL = "SELECT distinct B FROM Perf WHERE Perfil='1'"
     
    rstB.Open strSQL, objConn
    
    rstB.MoveFirst
    
    Do While Not rstB.EOF
        strB = Trim(rstB!B)
        
        Set rstPedidos = New ADODB.Recordset
    
        strSQL2 = "SELECT Params FROM Pedidos WHERE B='" & strB
        strSQL2 = strSQL2 + "' and Activo='S' and Obs='Solicitado'"
        
        rstPedidos.Open strSQL2, objConn
        
        If rstPedidos.RecordCount = 0 Then
            strLinha = Format(Now(), "d m yyyy hh:mm:ss") + " - No records for B " + strB
            Print #intFileLog, strLinha
        Else
            Do While Not rstPedidos.EOF
                strParams = rstPedidos!Params
                intPos = InStr(1, strParams, ";")
                strData = Mid(strParams, 1, intPos - 1)
                strDias = Mid(strParams, intPos + 1)
                        
                strLogFile2 = App.Path & "Reports.ini"

                If Dir$(strLogFile2) <> "" Then
                    Kill strLogFile2
                End If
            
                intFileLog3 = FreeFile
                strLogFile3 = App.Path & "Reports.model"
            
                Open strLogFile3 For Input As intFileLog3
                
                intFileLog2 = FreeFile
            
                Open strLogFile2 For Append As intFileLog2
                
                Do While Not EOF(intFileLog3)
            
                    strLinhaIn = ""
                    Line Input #intFileLog3, strLinhaIn
                    
                    If InStr(strLinhaIn, "Data=") <> 0 Then
                        strLinhaOut = Trim(strLinhaIn) + strData
                    ElseIf InStr(strLinhaIn, "Dias") <> 0 Then
                        strLinhaOut = Trim(strLinhaIn) + strDias
                    Else
                        strLinhaOut = strLinhaIn
                    End If
                    
                    Print #intFileLog2, strLinhaOut
                    
                Loop
        
                Close intFileLog3
                Close intFileLog2
            
            
                strSQL2 = "UPDATE BES_PEDIDOS SET Obs='Fase1 (CSV)' WHERE B='" & strB
                strSQL2 = strSQL2 + "' and substring(Params,1,8)='" & strData
                strSQL2 = strSQL2 + "' and Activo='S' and Obs='Solicitado'"
                
                objConn.Execute (strSQL2)
                
                'Call Relat_Mens.exe
                strCmdLine = App.Path & "Relat_Mens.exe"
                ExecuteCommandA strCmdLine, True
                
                rstPedidos.MoveNext
           Loop
           rstPedidos.Close
        End If
        
        rstB.MoveNext
    Loop
    
    rstB.Close
       
    Close #intFileLog
    objConn.Close
    
    Set rstPedidos = Nothing
    Set rstB = Nothing
    Set objConn = Nothing
    
End Sub



Public Sub ExecuteCommandA(ByVal sCommandLine As String, Optional ByVal bWaitForObject As Boolean = False)

Dim tProcess As PROCESS_INFORMATION
Dim tStartUp As STARTUPINFO
Dim ret As Long

    tStartUp.cb = Len(tStartUp)
    ret = CreateProcessA(0&, sCommandLine, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, tStartUp, tProcess)
<<<error received here>>>>>


     
     ' Wait for the shelled application to finish:
    ret = WaitForSingleObject(proc.hProcess, INFINITE)
    ret = CloseHandle(proc.hProcess)

End Sub


 

Can anyone give me a help with this?

Thanks.

Cheers,
Paulo




Edited by - bespjl on 3/22/2007 4:53:43 AM

Launch/close Program For Another Program
I help out at a Boys & Girls Club in their computer lab. They recently got a copy of Sim City 3000 donated, but this program is having issues with their Windows XP OS. If you go here, "SimCity 3000 restarts spontaneously when exiting", you can see the problem we are encountering. I was wondering if writing a small program to launch SimCity 3000, then catch it when it exits and force it to close down programmatically is possible? If so, how difficult would it be? I assume it would require several various API calls.

Launch A Program Withing Vb Program
Can anyone tell me how to launch an outside program by clicking on a button or something within a vb program that I am writing?

Launch A Program By Opening Another Program?
I made a application which works with IE. i want to make it launched automatically when IE is opened.? is this possible ?

a novice

How To Launch A Program From Vb
HI,

i have done an vb interface of a program for a vision system, but of course i would need to launch it from another interface containing the list of all the program that i will do.

Could you help me to lauch my program, lets say from a combo list.

Thanks,

chatoon.

Launch Program
How can you launch control panel from a command button?

Launch Program From VB
Is there a command where you just use a stringed file name to launch (or open) any program? (EXE)

Launch A Program From VB6
I am trying to develop a program that will launch Adobe reader to read a form that I made. I have a common dialog box opening up the pdf files, butmy problem is that I can't get it to launch once I select a file. I'm relatively new to the VB programming so it might be something simple, but I do not know how to resolve this. Can anyone help out please??

This is the only code that I have on the form so far. This works, but will not launch the adobe program.

Private Sub CmdFind_Click()
CommonDialog1.Filter = "PDF Files(*.pdf)|*.pdf|Word Documents (*.doc)|*.doc"
CommonDialog1.ShowOpen

End Sub

Thanks for any help..

Launch Another Program
How to launch another program in VB when i click a button?

Launch A Program ...
I want to make a program vb as cd autorun. how do I let launch a program that is on the CD, in the same directory of my prog VB, without specifying the unity of destination therefore don't I know unites him CD it is in D or in E or in F ???

Launch Program
Hi Everyone,

Does anyone know how to launch the Peachtree Accounting program from inside Visual Basic so that it will open up a company? I would appreciate any help. Thanks.

Launch One Program To From Another
Hi everyone !
Here is what I am trying to do :

I am building an application ( App1 ) . There is a button in this application that will have to open another program made by me ( App2 ). I know the Shell/ShellExecute method along with retrieving Command when opening from an associated file, but this time, I think it will not do it.
I need to pass a parameter from App1 to App2, not only opening it...
Somebody has a clear idea on how I should proceed ?
While I am here, somebody knows, when I launch an associated file, how to avoid to launch a second occurence of my app if it is already opened, just adding the file to the current opened application ?
Thanx a lot

Launch A Program In VBS
In VB, if you want to launch a program you can do:


Code:
Shell "C:windowsapp.exe"


is there an equivalent of this in VBS, or do I have to use that silly WScript.Shell thingy? I don't get it!

Please Help - Trying To Launch A Program Within VB...
I am writing an application that should launch an instance of another windows application, say Microsoft WORD. I have been able to launch the program from my code outside of the application, but I am trying to launch it within the application itself... in a control of some sort. Is this possible?? If it is, can someone help??

Thanks,
Ron

Next Program To Launch Goes Transparent
I was reading a forum, I looked at a guys desktop and he had a transparent messenger?
I noticed a quicklaunch icon called "tuning"


Are you able to do this kinda program with visual basic?
when u got that program open, all programs u open after it would open as transparent

Launch A Running Program
Hello all...

I have a weird request.

I need to do something with an application that is already running in the systray.

I would like to create a utility that can look in the systray and if "programB" is running then bring it up on the screen.

If this can be done, can this also been accomplished. There is a "Transfer Now" button on the front of "programB" and I would like to perform the click on this button if the program can in fact be brought up from the systray.

To do this manually with a mouse the user would double-click the icon in the systray and then click transfer now. So I would like to do the manual steps automatically with a little utility.

Any ideas.

GarryB

Launch Program When CD Is Inserted
Hello everybody,

I need to develop a small program which is to be copied in the CD and when the CD is inserted in the CD ROM, I need to launch the application and do some work.

Would you please help me where to start ??

Thanks.

Launch Program And Get HWnd
How can I launch an application and get it's hWnd? I can't simply use FindWindow(), because there is more than one open window with the the caption.

Is there a function to launch an application that returns the hWnd? Or any other method?

Launch A Pdf File From Vb Program
What is the eaisest way to launch a .pdf file from a VB program?

How To Launch A DLL When A Program Starts?
I want a dll to load with a program... how do i do it?

Anyone Know How To Launch A Program In The Taskbar?
ive seen this done before.. where you input a application's locations and the program will open the application in the systray, and when its clicked it restores it

anyone know how to do this?

How To Launch Program After Installation Using PDW?
Hi All


I have a project I have written in VB6 that I am deploying in Package and
Deployment Wizard. I have hacked the setup1.vbp and produced a couple of
customised features such as license agreement forms etc.

I am having trouble with writing code that launches the installed program after
setup?
At the end of the installation I want a message box that asks the user if
they want to launch the newly installed program.

Does anyone know how I would change the frmSetup1.frm to do this and launch
the new program?


Thanks Steven

How To Launch Program After Installation Using PDW?
Hi All



I have a project I have written in VB6 that I am deploying in Package and
Deployment Wizard. I have hacked the setup1.vbp and produced a couple of
customised features such as license agreement forms etc.

I am having trouble writing code that launches the installed program after
setup?
At the end of the installation I want a message box that asks the user if
they want to launch the newly installed program.

Does anyone know how I would change the frmSetup1.frm to do this and launch
the new program?



Thanks Steven

Executables - How Do I Launch One .EXE Program From Another .EXE?
Hi
I want to run one executable (say Program1.exe) then automatically Kill it when it's done (say by launching Program2.exe from Program1.exe, which kills Program1.exe)
I know how to do it manually by creating a Kill control in Program1.exe and clicking on it
But of course Program1.exe can't kill itself, can it.
Thanks
eon

Launch Program When CD Is Inserted
Hello everybody,

I need to develop a small program which is to be copied in the CD and when the CD is inserted in the CD ROM, I need to launch the application and do some work.

Would you please help me where to start ??

Thanks.

Launch A Program When Windows Starts
How can i make my program open when windows starts? I know i can put it in the start folder to open when windows loads, but what other options do i have? I want it to open every time the system starts up and under ever user. Maye i can ise the registry. But im not sure whats the best way of doing this.

How Can I Do A Program Like Quick Launch In Windows?
I have some small images.
I want : When I move the mouse on the image,it will be like bevel.Is it possible to do it?
Thanks a lot.

Launch My Program When Windows Starts Up
No, its not like all the other questions you find here (well, it may, but I couldn't find any)

Im making sort of setup program that begins in DOS, then it starts windows, and then it continues in windows (or another program runs when windows is ready) I know you have the Run registry folder, but its only once it has to run, and besides, I have to do this in DOS. Isn't there anywhere a parameter I can set in DOS so Windows knows it has to run a certain program when it is started up and then delete this parameter so it only runs once?

Thanks,
WP

How To Check OS Version At Program Launch
I have a program that was written on a Windows 2000 box. The program will
run on a Win 9x box, but with limited functionality. My question: how can
I check the OS before running the program? I want to issue a disclaimer to
anyone running Win 9x.

Thanks in advance
RC

Search Cd Roms And Launch A Program
Hi I have this VBScript that will search through all of the cd-roms on the computer to find a file. Once that file is found it creates a variable for the drive letter so i can lauch other programs using the variable.

This is my script:

Dim fs, d, dc, fileToSearch, driveLetter
Set fs = CreateObject("Scripting.FileSystemObject")
Set dc = fs.Drives

fileToSearch = "setup.exe"

For Each d in dc
if d.DriveType = 4 then
if fs.FileExists(d.Path + "" + fileToSearch) then
driveLetter = d.DriveLetter
exit for
end if
end if
Next

What i want to know is, say the drive with the disk in is F:. How do i launch a program using the variable. For instance in ms dos batch i could have used the %cdrom% variable. whats the VBscript alternative.

I hope this makes sense. if not i can rephrase it for you.

many thanks.

Trapping Parameters By Launch Of Program
Hi all,

I'm really a newbie.
How can I trap (read in my program) the parameters which where giving at the
launch of the my program?

thanks for any tips
Danny

Another Browser Launch Program (different Scenario)
ok, I have been reviewing the other questions regarding browser launching, but those scenarios were different than what i needed.

1. I am using a rich text box*.
2. This RTB* is not specifically used to type in URLs. There will be other things contained in the same box as well (this program is kinda like a wordpad program.)
    but when a URL is typed, VB.net already shows it as a URL, so when it is clicked, i need it to launch a browser.

3. I would also Like it to launch the default browser, as i use firefox while my friends are still in the IE era.

4. Instead of reusing any browsers that are already opened, i need it to open a fresh window each time.

When researching this question, #2 was always the thing that got in the way.

any suggestions?

Launch VB Program Before Windows Logon
Hi,
I want to launch my VB program before windows logon. I am using Win 2000 & XP. I done a part which is adding my file path in Registry (HKLM....Run directory). When I reboot a system, system loading Windows logon, task bar, desktop...my program loads. I don't want the user to select any of other program before my program loads. Pls help me.
Thanks in advance.
MAK

Editing The Registry To Launch My Program At Startup?
I know I need to use the win API of sorts to create a registry key to launch my program with windows. It's just basically my own personal little launch center... And rather than using the startup section (where my GF can delete the link - as she often does for no apparent reason) I'd like to have it in the registry where it will still come up but she will be sure not to find it =)

Thanks

Mike

Launch Another Program...why Doesn't My Code Work?
Code:
Private Sub cmdInst1_Click()
If lblStatus.Caption = "iPaq Status: Device Connected" Then
'ShowProps App.Path & "InstallersVideosetup.exe", Me.hwnd
'ShowProps "F:iPaq Installer FINALInstallersVideosetup.exe", Me.hwnd
'ShellExecute Me.hwnd, vbNullString, "setup.exe", vbNullString, App.Path & "InstallersVideo", SW_SHOWNORMAL
ShellExecute Me.hwnd, vbNullString, "setup.exe", vbNullString, "F:iPaq Installer FINALInstallersVideo", SW_SHOWNORMAL
Else
MsgBox "Please put your iPaq in the hot-sync cradle.", vbOKOnly, "Error"
End If
End Sub

I've tried to use ShellExecute and ShellExecuteEx from the WinAPI, both with no success. I need to launch a program that is in a subfolder of the VB program.

EX: App.Path & "InstallersVideoSetup.exe" is the program I need to run.

How To Launch An External Program, And Have Fields Filled In?
In my specific project I want to launch Internet Explorer, and have the address field filled with an address I specify.

Or to make this more general I want to launch whatever Windows has set as default browser, and in the address field have whatever i specify in VB.

Thanks!

Auto Launch Vb Program From Associated File Extension
I created a VB program to view tif images. I've associated the "tif" extension in windows with this program. When a user doubl-clicks a "tif" file in explorer, how do I obtain the name of the file that was double-clicked so I know what to open?

Thanks

Double Clicking On A File To Launch Your Program
I want to double click on a file(lets say a *.txt file) and get it to launch my program(lets say a text editor that has a rich text box to load a file into) and have it load the file right into the rich text box with out the user doing anything other than double clicking the original file?
thanks yall

Receiving A System Parameter At Program Launch In VB6
Is there a function in VB6 to retrieve a command line parameter passed to a VB application at launch?

For example, if I have a program named quiz.exe, and launch it from a run line with a parameter, for example

quiz.exe /reset

what function can I use within the program to capture the "/reset" and assign it to a variable?

Some example code would be helpful, and most appreciated.

Thanks

Using VB In Access To Launch Another Program With A Specific File
I'm a little confused and I'm hoping that someone here can help me out. I'm developing an information system for work as part of a school project and I'm stuck...

I am trying to use the Shell() command in the VB associated with Access 2003 to call a specific program and file. Both, unfortunately, contain spaces. Using quotes, I am able to get it to recognize "Microsoft Office" as a full name, but the path to the specific files contains spaces and I can't change them (they are corporate locations). So, my first question is how do I get Shell() to recognize a file path with spaces in it (I'll put my example below).

Another question I have is in regards to calling the actual program. I'm pretty sure that most people who will be using the information system will have the same path to the specific program on their computer (Access, Excel, Word, Explorer, Outlook, etc), but is there another way to get VB to open a file by the path (with spaces) to the file name and it will recognize that it needs to use the users specific file defaults to determine which file to open?

Here is the code I'm currently using to do this that does not work with spaces in the path to the file to open (with some changes to protect the innocent):

Private Sub UUOInvoiceNavLabel_Click()
On Error GoTo Err_UUOInvoiceNavLabel_Click

    Dim stAppName As String
    Dim filePath As String

    stAppName = "C:Program FilesMicrosoft OfficeOFFICE11MSACCESS.exe G:File FolderFile FolderInvoiceInvoicing.mdb"
    Call Shell(stAppName, 1)

Exit_UUOInvoiceNavLabel_Click:
    Exit Sub

Err_UUOInvoiceNavLabel_Click:
    MsgBox Err.Description
    Resume Exit_UUOInvoiceNavLabel_Click
End Sub

Any help would be greatly appreciated because I know I'm going to continue to encounter this problem with other programs. If the file path doesn't look right, it's "path to Office (Space) Path to file" with spaces in some of the folder names.

thanks!
Erik

Wait For Program
I'm writing an installer program that will automate a series of commands, like running a program or copying files. I would like to know how you can execute a program (i.e. with Shell), and then make your program wait for that process to complete. I know it's possible, but I never figured it out myself.
Also, is there a way to 'reroute' all output from an executed BAT file to your app, like encoder UI's do (they show the output from the actual encoder program in a text box). TIA, Vampyre.

Make Program Wait For Sub
Code:
Private Function Check()
'code
sockOCR.DownloadPicture PicURL 'once downloaded it calls PictureReady
'code
End Function

Private Sub sockOCR_PictureReady()
strCoordinates = sockOCR.OCR
End Sub

How would i make the program wait until it receives the strCoordinates and then continue on? Thanks for any help

How To Wait Until A Program Closes?
Hello all,
I am executing an external program and I need to pause my program while it's waiting for this process to finish. I do not wait to go about with a specified waiting time.
Any ideas on how to go about on this?

Copyright © 2005-08 www.BigResource.com, All rights reserved