OK, I think I've got it.
I have the Windows XP PowerToys installed on the two machines I've run the
app on. One of the power toys is the Task Switcher replacement for the
normal Windows XP Alt-Tab dialog. This replacement task switcher grabs and
displays on its dialog form a thumbnail of each application's screen as it
cycles through the applications. When I removed that power toy, rebooted,
and ran the test application, it worked just file (didn't freeze as the
Alt-Tab dialog selected it). When I reinstalled it, the problem came back.
So now it's probably a little tough to figure out where to point the
fingerbone of blame. Is is the replacement task switcher? Is it some
vulnerability in the .Net Windows Forms runtime? Is it me for tinkering with
the form's border style so early in the form startup process? I noticed that
the Load event happens before the first Layout event (the one with the null
arguments), so maybe it's a little too soon for me to be doing what I'm
doing.
Whattaya think?
Tom Dacon
> Hi Tom,
>
[quoted text clipped - 37 lines]
> 6.00.2800.1233 D:\WINDOWS\system32\SHELL32.dll
> 6.00.2800.1106
D:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0
> 10.0_x-ww_f7fb5805\comctl32.dll
> 5.82.2800.1106 D:\WINDOWS\system32\comctl32.dll
> 1.01.4322.2030
d:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll
> 6.00.2800.1405 D:\WINDOWS\system32\WININET.dll
> 5.131.2600.1123 D:\WINDOWS\system32\CRYPT32.dll
> 5.01.2600.1362 D:\WINDOWS\system32\MSASN1.dll
> 3.50.5016.0000 D:\WINDOWS\system32\OLEAUT32.dll
> 5.01.2600.1106 D:\WINDOWS\System32\Secur32.dll
d:\windows\assembly\nativeimages1_v1.1.4322\mscorlib\1.0.5000.0__b77a5c56193
> 4e089_eb123773\mscorlib.dll
> 1.01.4322.0573 D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorsn.dll
> 6.00.2800.1106 D:\WINDOWS\System32\uxtheme.dll
> 5.01.2600.1106 D:\WINDOWS\System32\MSCTF.dll
> 1.01.4322.2030
d:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\sy
> stem.windows.forms.dll
d:\windows\assembly\nativeimages1_v1.1.4322\system.windows.forms\1.0.5000.0_
> _b77a5c561934e089_21710e7e\system.windows.forms.dll
> 1.01.4322.2030
> d:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll
d:\windows\assembly\nativeimages1_v1.1.4322\system\1.0.5000.0__b77a5c561934e
> 089_7259b343\system.dll
> 1.01.4322.2030
D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\MSCORJIT.DLL
> 7.10.3052.0004
> D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\diasymreader.dll
> 1.01.4322.2030
d:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.d
> rawing.dll
d:\windows\assembly\nativeimages1_v1.1.4322\system.drawing\1.0.5000.0__b03f5
> f7f11d50a3a_e65358c8\system.drawing.dll
> 1.01.4322.2030
d:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.d
> ll
d:\windows\assembly\nativeimages1_v1.1.4322\system.xml\1.0.5000.0__b77a5c561
> 934e089_a5c4548e\system.xml.dll
> 5.01.2600.1106 D:\WINDOWS\System32\msctfime.ime
> 5.01.3101.0000
D:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.10.0_x-
> ww_712befd8\gdiplus.dll
> 5.01.2600.1106 D:\WINDOWS\System32\Msimtf.dll
[quoted text clipped - 17 lines]
> This mail should not be replied directly, please remove the word "online"
> before sending mail.
"Ying-Shen Yu[MSFT]" - 22 Jul 2004 09:00 GMT
Hi Tom,
I installed the Task Switcher on my system and reproduced this issue,
After some investigation, it seems this issue is related to an API call
PrintWindow (TaskSwitcher uses it to capture the window thumbnail). I tried
to reproduce this issue using native win32 application but failed, so I
guess it is an issue in winform or gdi+, I'll forward this issue to the
Dev team to let them do further investigation.
However since PrintWindow is not used frequently, maybe the easiest
workaround is do not use the Task Switcher.
If this workaround is not suitable for your scenario, please feel free to
reply this thread to let me know.
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
Tom Dacon - 22 Jul 2004 16:34 GMT
Thanks for researching that. It's nice to have a good idea about what's
going on with what was otherwise a pretty baffling problem.
As an old VB6/5/4/3/2/1 programmer, I've always been accustomed to doing
application-specific form initialization in the form's Load event, and in
those environments it worked just fine for me. Things are a lot different in
the .Net world and I can see that I need to question those old assumptions.
The best way to do these things now, apparently, is to put the
initialization code in the constructor, after the InitializeComponent()
call.
Since my last post, I took the initialization code that was in the form's
load event and moved it to an initialization routine that I'm now calling
from the constructor after InitializeComponent() has done its thing. Since
I've done that, the problem no longer occurs, even with the replacement
TaskSwitcher running. If I do anything at all in the Load event handler that
affects the underlying Win32 window, I can make the problem recur. This can
be a change in the form's dimensions, a change to the FormBorderStyle, or
possibly any one of a large range of other actions.
So I'm good to go with this solution, on the two applications in which I was
having the problem, and it's a good thing that I have a solution, since I
can't control whether the replacement TaskSwitcher is installed on the
machines these applications might be installed on. In addition, I've learned
a valuable lesson about the .Net framework as well.
Thanks for your help,
Tom Dacon
Dacon Software Consulting
> Hi Tom,
>
[quoted text clipped - 22 lines]
> This mail should not be replied directly, please remove the word "online"
> before sending mail.