|
I know this is not a clear question, but this is the situation. I have a windows application which parse some file( i use TPL here).
If i minimize this application and keep idle for more than 30 minutes, then i cannot bring the application back. I can see the minimized icon, but this wont come back even if i do ALT-TAB. This is in windows 7.
Any idea?
My small attempt...
|
|
|
|
|
Can you try this ?
- Right-click on the taskbar and say "Show windows
side by side"
Another option : You may put a timer in your application with this Code:
MessageBox.Show(this.Location.ToString() + "\r\n" + this.Size.ToString() + "\r\n" + this.WindowState.ToString());
this.WindowState = FormWindowState.Normal;
timer1.Enabled = false;
and repost the result here ?
|
|
|
|
|
Is the UI thread blocked? Are you doing som long running operation on the UI thread??
Chances are good one of these two things is what's doing it.
|
|
|
|
|
Is there any reason you sig has enough blank lines to score scrollbars?
Just curious.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Hmmm...it never did before. I'll take a look.
|
|
|
|
|
Another victim of metrosexualisation? I've since noticed a couple of others in the same boat.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
It appears that way!
There were a couple of BR tags under my name that I don't remember placing there.
Anyway, all fixed. Thanks!
|
|
|
|
|
I dont think that the GUI thread is blocked, because using TPL I parse all the files. Then show the result in the grid.
I am minimizing the application after all these operations are completed. That mean app is Idle when i minimize.
If i maximize the app immediately or like after 5. 10 minutes, then i am ok. But after 30-40 minutes i am having issue.
I also use DEV Express grid o show the result.
My small attempt...
|
|
|
|
|
I just told about file parsing, but this behavior may not be related to that. Below is another strange behavior i am seeing.
This is happening only sometimes, which may/may not related to our issue.
Say i have opened any popup window or some applications ( like MS word, IE) from my main form. When I close that popup window/app then the main form will be minimized or some other app will come front. So i had to click the app icon from task bar to bring it back
My small attempt...
|
|
|
|
|
Ditto dave's answer, your UI thread is probably blocked. To resolve this:
Add a BackgroundWorker and create a DoWork handler.
Move your parsing code into there.
Where your parsing code was, call RunWorkerAsync on the BackgroundWorker .
... now your parsing will be done on a background thread so your UI will remain active. You can use ReportProgress with a ProgressChanged handler to pass back info to the UI thread if needed.
|
|
|
|
|
Thanks Dude, instead of BackgroundWorker is use Task and continue with.
Is there any way to check, what went wrong when i got this situation again?
My small attempt...
|
|
|
|
|
Not that I know of, but a good rule for any application that has a UI is to perform potentially long running tasks on another thread so the UI doesn't freeze.
|
|
|
|
|
Thanks Dave, i will get back soon after resolving this issue
My small attempt...
|
|
|
|