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 / July 2004

Tip: Looking for answers? Try searching our database.

Open new forms BEHIND the active form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Squirrel - 30 Jul 2004 00:38 GMT
Hi,

I'm developing a messenger-style application, and everytime a new chatter
comes up, a new window should be opened.  Of course, this window should not
get the focus, so I tried ShowWindow API with the SW_SHOWNOACTIVATE flag.
Now the problem is that the new window, although not getting focus, still
appears IN FRONT of the active window where the user is typing, and that's
very annoying of course.  What I want is that new windows just appear in the
background, behind the active chat window.

How to accomplish this?

Thanks a lot!
Frederic
Jonathan Holmes - 30 Jul 2004 06:12 GMT
Hi,

Try using SetWindowPos; you can use the HWND_BOTTOM flag to put the window
at the bottom of the Z-order (below other windows) as follows:

SetWindowPos(handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE |
SWP_NOMOVE);

That should work but do take a look at the documentation for SetWindowPos in
case you require the effects provided by any other flags. You probably need
SWP_NOOWNERZORDER as well if your message windows are owned by one that is
likely to be active when the message appears.

Jonathan Holmes

> Hi,
>
[quoted text clipped - 10 lines]
> Thanks a lot!
> Frederic

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.