Always on Top Function?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way of setting a database to be "Always on Top" (The database window is constantly in view on the screen) regardless of what other programs and windows are also running

If so how

Thanks in advanc

Hasan
 
This Should do it

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

Public Sub MakeNormal(hwnd As Long)
SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
Public Sub MakeTopMost(hwnd As Long)
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub

You can use the Application.hwnd as parameter..

HTH

Pieter






Hasan said:
Is there a way of setting a database to be "Always on Top" (The database
window is constantly in view on the screen) regardless of what other
programs and windows are also running?
 
Back
Top