Click to See Complete Forum and Search --> : Form Always ON TOP


Mongoose
February 28th, 2000, 02:36 PM
What is the easiest way to achieve this?

I don't want a Modal form but I do want the form to be on top no matter what form has the focus.

I have an internet document that needs to open a form and make sure it always stays on top.

any info would help

thankx,
Mongoose

Atlantisoft
February 28th, 2000, 02:42 PM
Functions and Consts:
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

Public Const Swap_NoMove = &H2
Public Const Swap_NoSize = &H1
Public Const Swap_Create = &H3
Public Const HWND_TOP = 0
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const hWndFlag = Swap_NoMove Or Swap_NoSize

Sub/Function to use:
SetWindowPos TheForm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, hWndFlag

Enjoy!
-Atlantis