: : : 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.