My .NET app is running in the background, and occasionally creates and shows a form. The form should be visible above all other windows, but without focus.
My first approach was to set the TopMost property of the form, but that fails in many cases for reasons I can't explain.
Then I tried calling BringToFront in the Shown event handler, but that didn't do anything.
I also tried BringWindowToTop API, which returned true (= success), but without result.
Now I'm stuck with SetForegroundWindow, which works, but also gives focus to the window (as it should).
Any suggestions would be appreciated.
(Also, is it normal that I can just steal focus without any problem?)