Form and SW_Hide and HWND_TOPMOST
Posted on 1999-07-25
I am making a notes program that is sitting next to the clock, so I don't want it to show in the taskbar itself. I use Application.Showmainform := False; for the mainform and that works. The only problem is that all new created forms do show in the taskbar I Tried:
In the created new forms (OnFormCreate) procedure
No luck, it still creates a button on the taskbar when a form other than mainform is created. Any solution to this??
And now a little more weird. I set each new form to 'Stayontop' Using this
SetWindowsPos(Self.Handle, HWND_TOPMOST,0,0,0,0, SWP_NOACTIVATE + SWP_NOMOVE + SWP_NOSIZE);
But when clicked on a switch (rxswitch) It can also be set to false like so:
SetWindowsPos(Self.Handle, HWND_NOTOPMOST, Etc....);
At Startup all forms stay on top, But when I click on one of them, they all lose 'ontop' capabilities, and when clicking around they sometimes stay on top, than not (even when the switch is set 'ontop'). weird behaviour, If I change the Self.handle to Application.handle, it works again, but then all the forms go to the selected option. But I need to control each form seperate. How does this work best???