all groups > dotnet windows forms > january 2005 >
You're in the

dotnet windows forms

group:

How Can I Have TopMost Form Without Stealing Focus?


How Can I Have TopMost Form Without Stealing Focus? dotNetDave
1/31/2005 10:55:04 AM
dotnet windows forms:
I have a pop-up Windows Form that displays next on top of the system tray. I
can get it to pop-up just fine using .TopMost and .Show, but the problem is
that it seals focus away from the application that the user is currently
using... I don't want that. I have gone to the API level and used calls like
ShowWindow, SetWindowLong and SetWindowPos, but none seem to work right.
Either the window does not come up or it just appears for a split second and
then disappears.

Any suggestions would be greatly appreciated!

David McCarter


=====================
David McCarter
Re: How Can I Have TopMost Form Without Stealing Focus? dotNetDave
1/31/2005 12:29:01 PM
Sorry I was not clear, it is a normal window. It just pops-up (appears) above
the system tray like the MSN Messenger or Outlook notification window does.

[quoted text, click to view]
Re: How Can I Have TopMost Form Without Stealing Focus? dotNetDave
1/31/2005 3:03:01 PM
I finally figured it out... the deffinition for SetWindowsPos I got from some
web page was wrong. Once I change the param types to Integer, it started
working :-)

[quoted text, click to view]
Re: How Can I Have TopMost Form Without Stealing Focus? Joep
1/31/2005 8:34:39 PM
if your window is a popup it behave properly, ever seen two popup menus at
the same? i'd try a normal window instead of a popup

[quoted text, click to view]

Re: How Can I Have TopMost Form Without Stealing Focus? Joep
1/31/2005 10:05:54 PM
Ok, so if you know what window is on top before you popyour window up, can't
you pull that first one to the front after you have pop-upped/popped-up your
window?

[quoted text, click to view]

Re: How Can I Have TopMost Form Without Stealing Focus? Joep
2/1/2005 12:12:04 AM
Well done!

[quoted text, click to view]

AddThis Social Bookmark Button