Problem with Processes

  • Thread starter Thread starter James Hancock
  • Start date Start date
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
 
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
 
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...
 
Back
Top