> When an operation is performed by the user then in some cases the
> application ceases to be the active Window. This is still the case if I use
> the BackgroundWorker component to perform the operation asynchronously.
> Any thoughts?
1. Does the operation in question always cause the phenomenon, or only
sometimes? I know you said 'in some cases', but could you be more specific?
Do other operations also always/sometimes cause the phenomenon?
2. What window becomes the active window? Is it predictable and
reproducible?
3. Does the operation launch any processes? Does it interact with any
other processes? In either case, the other process may take focus.
4. How does the user indicate that he wants to perform the operation? Some
keystrokes are handled by windows and some of these change focus (eg Alt+Tab).
Doug Holland - 16 Jan 2008 18:21 GMT
Actually the cause of the bug appears to be the MessageBoxOptions was set to
DefaultDesktopOnly.
Removing the MessageBox code that asked the user if they really wanted to
remove the entities solved the problem.
When I said "some cases" it actually turned out to be everytime I prompted
the user for confirmation. I've now corrected the code to use a static
factory method to create the appropriate MessageBoxOptions. The static
factory code is based upon the C# code in the MSDN documentation for CA1300
(static code analysis warning).
Thanks,
Doug
> > When an operation is performed by the user then in some cases the
> > application ceases to be the active Window. This is still the case if I use
[quoted text clipped - 13 lines]
> 4. How does the user indicate that he wants to perform the operation? Some
> keystrokes are handled by windows and some of these change focus (eg Alt+Tab).