Taskbar events

Zatriz
08-12-2003, 12:03 PM
I've got a program that does some heavy FTP processing. I minimize the main form and show a progress style form. The problem I am having is that if the user makes another application window have focus, then the progress window for my FTP program never reappears, even if you click the application's button on the taskbar.

Is there an event that fires when you click the buttons on the taskbar so that I can perform a repaint or refresh?

calpha
08-12-2003, 01:22 PM
firing up my trusty spy++ shows tons of events on the task bar. Subclassing those windows messages is a question that I wouldn't know how to answer though.

But, where there's a will, there's a way.

Question though---why not just use the api call to make your window always stay on top?

Zatriz
08-12-2003, 02:58 PM
firing up my trusty spy++ shows tons of events on the task bar. Subclassing those windows messages is a question that I wouldn't know how to answer though.

But, where there's a will, there's a way.

Question though---why not just use the api call to make your window always stay on top?

I find it kind of annoying to have a window in my way when I am trying to work on other things. But that might be the only thing I can do. I have seen other Windose applications that don't show back up when you click their taskbar button because of the processing it is doing.

Dunno, but I will keep trying. I thought the GotFocus event on the progress form might fire when you click the taskbar button. But it did not seem to work.

Squishy
08-12-2003, 03:21 PM
The GotFocus event will only fire in VB6 when you switch between forms in the same application. Have you tried placing DoEvents in various places in your code?

Thinker
08-12-2003, 03:24 PM
GotFocus won't even fire then. It only fires if there are no controls on
a form that can receive focus.

MikeJ
08-12-2003, 03:29 PM
Maybe you can have a form running in the background at all times (invisible) and use the SetFocus API whenever your window is selected, using the GetActiveWindow API to check if it is selected, and if your window is active, call a sub to refresh it...

Just a suggestion,
~MikeJ

Squishy
08-12-2003, 03:34 PM
GotFocus won't even fire then. It only fires if there are no controls on
a form that can receive focus.
....a bit slow today. First the .net code now this...maybe its the blood loss...

[EDIT:] finally remembered...I was thinking of the Activate event...

calpha
08-12-2003, 03:35 PM
That's why to me...even though it's harder, I prefer the subclass way. Sure there are other tricks---other forms, Do events on every dang line of code (lol)--no frustration there--

In a case like that if I were writing it in C++, the FTP Processing would be on a separate thread---because in the end that's what's hosing you--the process redraw methods called from the window losing focus and then recieving it again (from the taskbar) are waiting for the FTP Process to complete----

So, if I had the time to play with it, I don't even know if subclassing the windows taskbar by itself would work---but I am not a fan of DoEvents all over the place, or hidden controls/forms for "tricks"---but that's just my pref. Subclassing is the harder way for sure.

So maybe---just putting it on a separate thread would be the simplest---i don't know I'd have to play with it, and i aint got the time

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum