Open an application

G

Guest

Hi people!!!
How can I open an application from VB.NET?
I'm developing an smart device application and I want to open pocket word.
Any suggestions?
Thanks in advance for your help.
 
G

Guest

Declare this API call

Public Declare Function CreateProcess Lib "coredll" Alias
"CreateProcessW" ( _
ByVal imageName As String, _
ByVal cmdLine As String, _
ByVal lpProcessAttributes As IntPtr, _
ByVal lpThreadAttributes As IntPtr, _
ByVal boolInheritHandles As Int32, _
ByVal dwCreationFlags As Int32, _
ByVal lpEnvironment As IntPtr, _
ByVal lpCurrentDir As IntPtr, _
ByVal si() As Byte, _
ByVal pi As ProcessInfo) As Int32


Public Class ProcessInfo
Public hProcess As IntPtr
Public hThread As IntPtr
Public ProcessID As IntPtr
Public ThreadID As IntPtr
End Class

And

use the following code to open the app

Dim lnCreateProcess As Long
Dim iCount As Integer
Dim si(128) As Byte
Dim pi As New ProcessInfo
lnCreateProcess = CreateProcess("\Program
Files\yourfile.exe", "", IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero,
IntPtr.Zero, si, pi)

Hope that helps
Regards,
Willson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top