By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

question on shellexecute

P: n/a
Hi,

i would like to invoke another applcation in my program.I 've tried
shellexecute ,but it doesnt work .

here is my code :
ShellExecute(0, "open", "C:\windows\system32\notepad.exe", vbNull, vbNull,
SW_SHOWMAXIMIZED)

what amendment should i make in order to make it work ?

thanks very much.

Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Dim P as new System.Diagnostics.Process()
P.Start("Notepad.exe")

"The8thSense" <th*********@yahoo.com> wrote in message
news:e3**************@TK2MSFTNGP09.phx.gbl...
Hi,

i would like to invoke another applcation in my program.I 've tried
shellexecute ,but it doesnt work .

here is my code :
ShellExecute(0, "open", "C:\windows\system32\notepad.exe", vbNull, vbNull,
SW_SHOWMAXIMIZED)

what amendment should i make in order to make it work ?

thanks very much.

Nov 20 '05 #2

P: n/a
* The8thSense schrieb:
i would like to invoke another applcation in my program.I 've tried
shellexecute ,but it doesnt work .

here is my code :
ShellExecute(0, "open", "C:\windows\system32\notepad.exe", vbNull, vbNull,
SW_SHOWMAXIMIZED)

what amendment should i make in order to make it work ?


Use 'System.Diagnostics.Process.Start' instead and have a look at the
'ProcessStartInfo' class.

--
Herfried K. Wagner
Microsoft MVP
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

P: n/a
thx very much ~

"The8thSense" <th*********@yahoo.com> bl
news:e3**************@TK2MSFTNGP09.phx.gbl g...
Hi,

i would like to invoke another applcation in my program.I 've tried
shellexecute ,but it doesnt work .

here is my code :
ShellExecute(0, "open", "C:\windows\system32\notepad.exe", vbNull, vbNull,
SW_SHOWMAXIMIZED)

what amendment should i make in order to make it work ?

thanks very much.

Nov 20 '05 #4

P: n/a
"Nice Chap" <Ni******@PlasmaDyne.com> schrieb
Dim P as new System.Diagnostics.Process()
P.Start("Notepad.exe")


It works, but don't expect p to point to the Notepad process because the
Start method is shared.
--
Armin

Nov 20 '05 #5

P: n/a
In article <e3**************@TK2MSFTNGP09.phx.gbl>, The8thSense wrote:
Hi,

i would like to invoke another applcation in my program.I 've tried
shellexecute ,but it doesnt work .

here is my code :
ShellExecute(0, "open", "C:\windows\system32\notepad.exe", vbNull, vbNull,
SW_SHOWMAXIMIZED)

what amendment should i make in order to make it work ?

thanks very much.


Imports System.Diagnostics

....

Dim p As New Process()

With p.StartInfo
.File = "Notepad.exe"
.WindowStyle = ProcessWindowStyle.Maximized
End Wit

p.Start()
Or, if it is a document and you want to open the default handler...

Dim p As New Process()
With p.StartInfo
.File = "myfile.txt"
.Verb = "open"
.WindowSytle = ProcessWindowStyle.Maximized
.UseShellExecute = True ' this is the default anyway
End With
p.Start()

HTH...

--
Tom Shelton
MVP (Visual Basic)
Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.