Option Explicit
Public Const SWP_NOMOVE = 2
Public Const SWP_NOSIZE = 1
Public Const Flags = SWP_NOMOVE Or SWP_NOSIZE
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
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 Function SetTopMostWindow(hwnd As Long, Topmost As Boolean) _
As Long
If Topmost = True Then 'Make the window topmost
SetTopMostWindow = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, _
0, Flags)
Else
SetTopMostWindow = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, _
0, 0, Flags)
SetTopMostWindow = False
End If
End Function
------------------------------------------------------------------------
Next, in the form you want to keep on top, put the following in the
Form_Load event
Private Sub Form_Load()
Dim lR As Long
'Keep this window on top
lR = SetTopMostWindow(Me.hwnd, True)
End Sub
-------------------------------------------------
Hope this helps!
David Hodgkins, MCSD, MCDBA, MCSE
JSTAR Software Solutions
4402 Sweet Cherry Ln.
Kalamazoo, MI 49004
www.jstarsoftware.com - Home of AutoCompact for Access Databases
269-382-2931
"Oin Zea" <Oin...@hotmail.com> wrote in message
news:6c12f$42557a76$40ed96b2$21...@COQUI.NET...
"Oin Zea" <Oin...@hotmail.com> wrote in message
news:6c12f$42557a76$40ed96b2$21...@COQUI.NET...