|
-
January 8th, 2000, 11:33 AM
#1
Getting a handle to another process
How do I get a handle to another process (a DOS box) so I can then close it down? I have a VB app that will restart the PC if certain criteria occurs. I am trying to get the handle to this DOS box to then close either by TerminateProcess or sending WM_CLOSE via SendMessage.
Any ideas.
Thanks,
Mike
-
January 8th, 2000, 06:29 PM
#2
Re: Getting a handle to another process
Sorry I don't know any universal methods to do this, but if you know exactly what window you need to close, you can use Spy++ program which comes with Visual Studio. Run it, click on 'Find Window' button, on appeared window click and drag 'Finder Tool' icon over your DOS window. You'll see Window Class parameter for your DOS window. You can use it with PostMessage API with WM_CLOSE constant to kill that DOS Window.
Vlad
-
January 8th, 2000, 07:24 PM
#3
Re: Getting a handle to another process
A way to do this automatically from a program would be to import the necessary function for parsing window titles. Things about a dos window is they usually only have the path in the title. Check out MSDN for the needed functions. I think that the codeguru site might also have the needed information.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|