Problem with Processes

J

James Hancock

Hi all,

I'm launching a document using Process.Start()

So the file could be a word document or anything else, it just uses the
system's default editor for it.

All is good, but now if they try and open that same document I want to bring
it to the front.

The problem is that the Process doesn't have a MainWindowHandle or anything.

Does anyone know how to get the Handle of the window? Gary helped me figure
out the right API call to make to bring the window to the front, now I just
need to get the handle of the window that was created.

Thanks!
James Hancock
 
G

Gary Milton

Hi James,

The 'Start' method returns a Process object which has a 'MainWindowHandle'
property...

\\\
Dim objProcess As Process

objProcess = Process.Start("notepad.exe")

MessageBox.Show(objProcess.MainWindowHandle.ToString, "MyApplication")
///

Gary
 
J

James Hancock

This blows up for some reason.

See my other message for the problem. It launches the document but then
doesn't have any other info in it.

I didn't change anything, and it used to work, and now it doesn't and I'm
beside myself trying to figure out why...
 

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