With
VBCE 6.0, you can now access the CE API! Here is a simple example which shows how
to shell to another application. This is the same function which is used in the VBCEMisc Control.

Place the following code in a MODULE:
Public Declare Function CreateProcess Lib "coredll.DLL" Alias
"CreateProcessW" _
(ByVal lpApplicationName As String, 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 String,
_
ByVal lpStartupInfo As Long, ByVal lpProcessInformation As Long)
As Long
Const SUCCESS = 1
Now, add 2 text boxes, and one command button with the following click event code to a
form:
Dim lRet As Long
'-- Shell off new process
lRet = CreateProcess(CStr(txtProcess.Text), _
CStr(txtCommandLine.Text), _
0, 0, False, 0, 0, "", 0, 0)
If lRet = SUCCESS Then
Me.Caption = "Success"
Else
Me.Caption = "Failure"
End If |