C
Chris Ullman
I have a piece of VB.NET code (.NET 1.1) that calls a new exe as follows:
Dim fileName = "C:\sample.exe"
newProcess.StartInfo = New System.Diagnostics.ProcessStartInfo(fileName)
newProcess.Start()
newProcess.WaitForInputIdle()
This works fine, and I then call the Windows API for FindWindow as follows,
using the mainWindowTitle property as a parameter:
lnghwnd = FindWindow(vbNullString, newProcess.MainWindowTitle)
This also works fine and it returns the name of the Window for the exe to
FindWindow. However if I call the clipboard before I do this:
Clipboard.SetDataObject("Hello World")
then MainWindowTitle returns nothing. Also MainWindowHandle also returns
nothing. For my application to work, I need to set the clipboard, as the
other application will poll the clipboard for data on start up. Any idea why
the clipboard is causing this behavior? Is it intentional and I can probably
get around it, but I'm just wondering why this behavior should happen.
Regards,
Chris Ullman
Dim fileName = "C:\sample.exe"
newProcess.StartInfo = New System.Diagnostics.ProcessStartInfo(fileName)
newProcess.Start()
newProcess.WaitForInputIdle()
This works fine, and I then call the Windows API for FindWindow as follows,
using the mainWindowTitle property as a parameter:
lnghwnd = FindWindow(vbNullString, newProcess.MainWindowTitle)
This also works fine and it returns the name of the Window for the exe to
FindWindow. However if I call the clipboard before I do this:
Clipboard.SetDataObject("Hello World")
then MainWindowTitle returns nothing. Also MainWindowHandle also returns
nothing. For my application to work, I need to set the clipboard, as the
other application will poll the clipboard for data on start up. Any idea why
the clipboard is causing this behavior? Is it intentional and I can probably
get around it, but I'm just wondering why this behavior should happen.
Regards,
Chris Ullman