473,385 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

question on shellexecute

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
5 2321
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
* 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
thx very much ~

"The8thSense" <th*********@yahoo.com> ¦b¶l¥ó
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marcel Sammut | last post by:
Greetings, I am converting a VB6 application to .net and am having troubles trying to print a document directley to the printer. My VB6 app used the API ShellExecute method to accomplish this,...
3
by: John | last post by:
All: Is there a way to issue a ShellExecute function in such a way that it doesn't first draw a DOS window on the screen? Here is the command line: ShellExecute( NULL, "open",...
3
by: Wiktor Zychla | last post by:
I have a problem I cannot solve. My application hosts IE activex control. I follow the standard procedure: I just aximp shdocvw.dll. Note that this gives you two files: axshdocvw.dll and...
1
by: MCzajk | last post by:
Is there a function similar to ShellExecute, which I can hook to when the program is started using Start Menu icon? MCzajk
11
by: Le, Thanh-Nhan | last post by:
Hi, Is there a same function in .Net as API shellexecute? Thanks Nhan
0
by: the_openFace | last post by:
I'm trying to display the shell's property page for various files and I'm using this code: class Win32Shell { // ... other stuff here public static extern Int32 ShellExecute( Int32 hwnd,...
0
by: the openBack | last post by:
I'm trying to display the shell's property page for various files and I'm using this code: class Win32Shell { // ... other stuff here public static extern Int32 ShellExecute( Int32 hwnd,...
0
by: David | last post by:
We have an mfc application in which we use ShellExecute to launch the browser with an initial web site. {ShellExecute( NULL, "open", "http://www.SomeWebSite.com", NULL, NULL, SW_SHOWNORMAL ) } ...
2
by: John Smith | last post by:
Hi, I have an access database form with an image. I'm trying to create an onclick event on the image so that when a user clicks on the image it opens that file with the default viewer the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.