views:

460

answers:

3

Hi,

I have a .NET application (C#, WinForms) application running on Windows XP. If i minimize my application, and have several other windows minimized to the taskbar, and click on my application (in the taskbar) then often i see the taskbar "icon" blink but my application fails to "restore" its window. Any suggestions to what might cause this? Any hints on how to check if my application is not getting an event from the mouse-click.

UPDATE: Could anybody give an example of, how to output any incoming events to an application. Something that allows me to e.g. print the received events using Console.Writeline() to see, if my application gets an event when I click on the taskbar?

Thank you! /Søren

A: 

AFAIK this should not have anything to do with your application. Is there any other application running which always remains on top?

danish
That was my assumption too. Yes there are other applications running (say A browser and notepad), but all the other apps are perfectly responsive to clicks in the taskbar.
S.C. Madsen
Well in that case, it is all due to whatever Windows is doing/not doing. AFAIK there is much you can do about it.
danish
A: 

You dont handle maximising and minimising to and from the taskbar in your app. That is to say you dont have to. Windows deals with this and so this would appear to be in no way related to your app not handling an event, rather Windows doing something (or not doing something).

pierre
Right, so now that Windows fails. Could I "sniff" if the application/.NET-framework is getting an event, when I click the taskbar?
S.C. Madsen
+1  A: 

http://www.windows-spy.com/

I venture to guess that your app will become in focus.

GregC
I will definately try out the Windows-Spy tool.What do you mean by "my app will become in focus" exactly? That my app gets "focused" but not maximized somehow?
S.C. Madsen
I think your window gets focus, but it's coordinates prevent it from being seen on your monitor(s).
GregC
Try pressing Alt-Space, M, then keyboard arrow keys, then move your mouse. Window should now be on one of the screens.
GregC