Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2005

Tip: Looking for answers? Try searching our database.

How Can I Have TopMost Form Without Stealing Focus?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dotNetDave - 31 Jan 2005 18:55 GMT
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
www.vsdntips.com
Joep - 31 Jan 2005 19:34 GMT
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

>I have a pop-up Windows Form that displays next on top of the system tray.
>I
[quoted text clipped - 15 lines]
> David McCarter
> www.vsdntips.com 
dotNetDave - 31 Jan 2005 20:29 GMT
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.

> 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 clipped - 18 lines]
> > David McCarter
> > www.vsdntips.com 
Joep - 31 Jan 2005 21:05 GMT
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?

> Sorry I was not clear, it is a normal window. It just pops-up (appears)
> above
[quoted text clipped - 29 lines]
>> > David McCarter
>> > www.vsdntips.com
dotNetDave - 31 Jan 2005 23:03 GMT
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 :-)

> 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
[quoted text clipped - 33 lines]
> >> > David McCarter
> >> > www.vsdntips.com
Joep - 31 Jan 2005 23:12 GMT
Well done!

>I finally figured it out... the deffinition for SetWindowsPos I got from
>some
[quoted text clipped - 42 lines]
>> >> > David McCarter
>> >> > www.vsdntips.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.