TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chris sunter
NA
3
0
Wait for a process to intitialise and have a handle != IntPtr.Zero
Sep 25 2008 5:58 AM
All,
I am trying to start a process and wait for the handle to recieve a value. This will occur when the window is fully initialised.
ProcessStartInfo process = new ProcessStartInfo(progName);
process.Arguments = arguments.Trim();
// start process
Process aProc = new Process();
aProc = Process.Start(process);
bool gotHandle = false;
while (! gotHandle)
{
if (aProc.MainWindowHandle == IntPtr.Zero)
{
Console.WriteLine("Not got " + ap);
Thread.Sleep(1000);
}
else
{
Console.WriteLine("GOT");
gotHandle = true;
}
}
//MessageBox.Show(""+ aProc.MainWindowHandle);
return aProc;
}
All I am recieveing in the Console is "Not got 0".
Any help is very welcome.
Reply
Answers (
1
)
Rotate a cube in opengl in c#.net
How update grid view status after file Import or Export