PDA

Click to See Complete Forum and Search --> : TopMost Form


KENNNY
Jan 10th, 2000, 01:30 AM
that API has to be the most frequently asked about/mentioned in the whole of Win32API :)

------------------
cintel rules :p
www.cintelsoftware.co.uk

chockenberry
Jan 10th, 2000, 02:53 AM
That works great for making the form Top most of all the Windows for the entire system. I can develop a work around to get it to work for my purposes(When the main form is maximized I will make the sub form top most, and vica versa) But is there a way to make a form top most in a single application, but not for the system. (i.e. when I am in my app that form is on top of it, but when i am in other apps, it is behind those forms?)

chockenberry
Jan 10th, 2000, 11:28 AM
I need to make on of the forms in my project stay ontop of the other forms in my project at all times. Does anyone know any quick ways to do this with code, or a free OCX that will do it?

------------------
Chris Hockenberry
Application Engineer
Willow Bend Communications

Aaron Young
Jan 10th, 2000, 11:34 AM
Try this:

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1

Private Sub Command1_Click()
Call SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Sub


------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com

Yokhannan
Feb 8th, 2000, 02:03 PM
Yep, I have the same question...

I would like to keep a single application (only one form) always focused.

Suggestions?