Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Stay On Top Forever Posted by OxyzN on 7 Aug 2003 at 10:40 AM
I have the main form (Form1) and a secondary form (Form2). I want to show Form2, and hide Form1, Form2 is supposed to be always on top of other applications, but it seems not to work though the form style is set as fsStayOnTop.
Report
Re: Stay On Top Forever Posted by Manning on 7 Aug 2003 at 7:07 PM
: I have the main form (Form1) and a secondary form (Form2). I want to show Form2, and hide Form1, Form2 is supposed to be always on top of other applications, but it seems not to work though the form style is set as fsStayOnTop.
:

Another snippet I picked up:

Multiple forms stay on top
    Application OnDeactivate event
        SetWindowPos(Form1.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOACTIVATE or SWP_NOSIZE);
        SetWindowPos(Form2.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOACTIVATE or SWP_NOSIZE);

Report
Re: Stay On Top Forever Posted by OxyzN on 8 Aug 2003 at 4:50 AM
: : I have the main form (Form1) and a secondary form (Form2). I want to show Form2, and hide Form1, Form2 is supposed to be always on top of other applications, but it seems not to work though the form style is set as fsStayOnTop.
: :
:
: Another snippet I picked up:
:
:
: Multiple forms stay on top
:     Application OnDeactivate event
:         SetWindowPos(Form1.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOACTIVATE or SWP_NOSIZE);
:         SetWindowPos(Form2.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOACTIVATE or SWP_NOSIZE);
: 

:

Where did you find these snippets?

Report
Re: Stay On Top Forever Posted by Manning on 8 Aug 2003 at 10:04 AM
: : : I have the main form (Form1) and a secondary form (Form2). I want to show Form2, and hide Form1, Form2 is supposed to be always on top of other applications, but it seems not to work though the form style is set as fsStayOnTop.
: : :
: :
: : Another snippet I picked up:
: :
: :
: : Multiple forms stay on top
: :     Application OnDeactivate event
: :         SetWindowPos(Form1.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOACTIVATE or SWP_NOSIZE);
: :         SetWindowPos(Form2.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOACTIVATE or SWP_NOSIZE);
: : 

: :
:
: Where did you find these snippets?


Mostly from past problems I've had. In the past I also wanted to move a form by dragging somewhere other than the titlebar, and have had problems with fmStayOnTop not really doing what I want. So when I finally find the solution I keep track of it because I know I'll probably need it again, and if not, someone else might like in this case.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.