We have a Win32 application that hosts the .NET runtime and opens up .NET managed forms from the Win32 portion of the application.
These windows are always opened as modal windows.
On some machines, when these windows are closed, the Win32 window that lies behind does not get focus, but gets sent behind Word, Outlook, or whatever else you might have open.
Also, sometimes, if we open such a .NET form, then alt-tab to Word or some other application, and then click on the taskbar icon for our app, the Win32 window appear. This is of course still waiting for the modal .NET window to close, so it is of course unusable. If we alt-tab to something else and just minimize that other thing, then our .NET window reappears.
The inconsistent part is that this occurs on only some machines, and not all. On many machines, mine included, it works exactly as expected. Focus to the right window works every time.
I don't doubt we have done something wrong, but I can't figure out what the problem is.
Does anyone have any idea what I should be looking for? We've looked at the .NET runtimes installed, and since two such machines where it works on one but not the other are both developer machines, they contain the same service packs for .NET and so on.
Edit: Well, @sam, you were right in that we had some different setups in this lane. Both machines run Windows XP SP3, but mine was running classic windows theme, and the other was running the new XP theme. Changing theme on that other computer to classic removed the problem, but changing it back to the XP theme did not make it reappear.
So now we have two machines where it work, and the customer still has the problem, even though the customer apparently runs classic theme.