|
-
Sep 24th, 2012, 06:35 PM
#1
Thread Starter
Member
Program will not restore from taskbar when clicked after minimized
VB.Net 2010, XP
I have a program which reads .xls, .doc, .msg, .htm, and .txt files searching
for a word or phrase and adds the findings to a grid.
After I minimize it, it will not restore when I click on it on the taskbar. It
just beeps.
I have added DoEvents in all places inside loops. That has not helped.
Ideas?
-
Sep 24th, 2012, 06:36 PM
#2
Re: Program will not restore from taskbar when clicked after minimized
You were able to minimize it, which suggests that it isn't actually frozen....though the beep, and your actions, suggest that it is. Does it run fine when you don't minimize it?
My usual boring signature: Nothing
 
-
Sep 24th, 2012, 07:17 PM
#3
Re: Program will not restore from taskbar when clicked after minimized
 Originally Posted by MLarsB
I have added DoEvents in all places inside loops. That has not helped.
That does not bode well. Even apart from this issue, you almost certainly should be using multi-threading of some sort. Are you only processing one file at a time? If so then you might consider doing the processing in the DoWork event handler of a BackgroundWorker.
-
Sep 25th, 2012, 05:20 PM
#4
Thread Starter
Member
Re: Program will not restore from taskbar when clicked after minimized
Shaggy Hiker,
The program runs fine when not minimized. I can restore it with Task Manager "Switch To" but not with alt-tab. When I get to it and release the buttons it just beeps. When it is restored, it shows that it has just kept running as usual.
-
Sep 25th, 2012, 05:23 PM
#5
Thread Starter
Member
Re: Program will not restore from taskbar when clicked after minimized
I am processing one file at a time. I don't know how to do the processing in the DoWork event handler of a BackgroundWorker and I will not be learning while on this task.
Thanks, though.
-
Sep 25th, 2012, 05:50 PM
#6
Thread Starter
Member
Re: Program will not restore from taskbar when clicked after minimized
I have a break point in each of these events, so I know they do not run: frmGridDisplay_Resize, frmGridDisplay_ResizeBegin, frmGridDisplay_ResizeEnd.
-
Sep 25th, 2012, 05:56 PM
#7
Re: Program will not restore from taskbar when clicked after minimized
What I find interesting is that you can restore it, just not by some typical means. I don't know what difference there might be between Taskbar restore and the other means, but it rather suggests to me that the program is responding rather than being frozen, as I initially thought. Do you have any code that deals with minimizing the form? What I am looking for is anything that could be causing it to minimize as soon as you attempt to restore.
My usual boring signature: Nothing
 
-
Sep 25th, 2012, 06:23 PM
#8
Thread Starter
Member
Re: Program will not restore from taskbar when clicked after minimized
There are no "WindowState" usages in the code. Very occasionally it responds. It is in a tight loop much of the time. I tried sleep(1000) in the inner loop but it did not make a difference.
-
Sep 25th, 2012, 06:37 PM
#9
Thread Starter
Member
Re: Program will not restore from taskbar when clicked after minimized
I added this code to the form and now it still beeps, but it does the restore:
Code:
Private Sub frmGridDisplay_Activated(sender As Object, e As System.EventArgs) Handles Me.Activated
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If
End Sub
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
|