Running other programs from vb.net 
Author Message
 Running other programs from vb.net

I want to do the following
1) allow the user to open calc.exe
2) shut down calc.exe when done with my program

In vb 6 i
1) did a shell to run the program
2) did a find window and sendMessage(hwnd, WM_CLOSE)

What is the preferred approach to this in VB.NET?

Independent of that question:
What is the preferred way to SendMessage / PostMessage? Or should you just
say NO to windows messages?-)))

Regards,
Al



Sat, 27 Mar 2004 23:07:40 GMT  
 Running other programs from vb.net

Quote:
> In vb 6 i
> 1) did a shell to run the program
> 2) did a find window and sendMessage(hwnd, WM_CLOSE)

> What is the preferred approach to this in VB.NET?

> Independent of that question:
> What is the preferred way to SendMessage / PostMessage? Or should you just
> say NO to windows messages?-)))

Dim proc_ID As Integer

proc_ID = Shell("calc.exe")
Dim blah As Process

blah = Process.GetProcessById(proc_ID)

blah.Kill()  ' At appropriate point of course



Sat, 27 Mar 2004 23:19:36 GMT  
 Running other programs from vb.net
Also...make sure you put in an ErrorHandler for
System.InvalidOperationException, due to the fact that someone can close
Calc.exe at any time and if you try to close a process that doesn't exist,
problems will arise.

James



Sat, 27 Mar 2004 23:25:13 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Running programs written by VB.NET on other machines

2. running vb.net program on machines without SDK framework

3. Running programs written by VB.NET on other machines

4. Running a VB.NET program in Win95

5. Click button by VB in others program.

6. My Vb.Net Apps will not run on other machine's with .Net Framework installed

7. VB.NET app does not run on OS having .NET redistributable files installed

8. Error in temp file in running crystal report for .net in vb.net

9. Using VB.NET programming ASP.NET

10. (newbie) Starting a program from a VB.net program

11. Running VB program compiled with IE 4 on machine running IE 5

12. How do I make my VB program Run an external program

 

 
Powered by phpBB® Forum Software