|
-
Feb 3rd, 2014, 05:52 PM
#3
Thread Starter
New Member
Re: Having a problem with window state
 Originally Posted by jmcilhinney
That is horrible code I'm afraid. What you have there is called a "busy wait" loop and it's one of the worst possible things you can create in code. That Do loop is going to be soaking up processor cycles continually, even though the application is not doing anything useful. What you should be doing is keeping a reference to the Process object returned by Process.Start and handling its Exited event. That way your app does exactly nothing the whole time the other application is running and then receives notification only when that app exits. It's like the difference between you staying up all night watching your clock so that you know when it's time to get up and just going to sleep and letting your alarm wake you up when it's time.
Yes, I had guessed it was horrible code. I'm still pretty new to vb.net. Thanks for the solution, I was not really sure if this could even be done in the way you described.
Tags for this Thread
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
|