Re: Using the Shell command
This is an example of using Shell to execute Windows Calculator:
private lngGetCalc as Long 'to work with calculator
public Sub LoadCalculator()
Dim lngResult as Long
' Check if Calculator is active
If IsWindow(lngGetCalc) then
Exit Sub
else
lngGetCalc = Shell("calc.exe", 1)
End If
lngResult = SetWindowPos&(lngGetCalc, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE)
End Sub
Vlad
Re: Using the Shell command
just type in
Shell "c:\windows\notepad.exe", vbNormalFocus
to run notepad
Re: Using the Shell command
Vlad, next time please declare everything, because your code is incomplete :(, these declarations are missing:
public Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (byval hwnd as Long, byval hWndInsertAfter as Long, byval x as Long, byval y as Long, byval cx as Long, byval cy as Long, byval wFlags as Long) as Long
public Declare Function IsWindow Lib "user32" Alias "IsWindow" (byval hwnd as Long) as Long
Re: Using the Shell command
this isan easy one dude, if i understand you right, put in the following code for the forms terminate procedure:
shell "C:\whatever\whatever.exe", VbNormalFocus
so that way, when you close your prorgam, it will execute another