I have a routine which put a particular form on top, namely:
I now need a routine that will tell me if a particular form is on top so is there an API call such as "GetWindowPos" which will return HWND_TOPMOST or HWND_NOTOPMOST?
Many thanks
Bob
.
Code:
Public Sub FormOnTopLFH(intHandle As Long, blnOnTop As Boolean)
Dim HWND_NOTOPMOST As Long
Dim HWND_TOPMOST As Long
Dim lngFlags As Long
Dim SWP_NOMOVE As Long
Dim SWP_NOSIZE As Long
SWP_NOMOVE = 2
SWP_NOSIZE = 1
HWND_TOPMOST = -1
HWND_NOTOPMOST = -2
'An "OR" in the Binary sense
lngFlags = SWP_NOMOVE Or SWP_NOSIZE
If blnOnTop = True Then
Call SetWindowPos(intHandle, HWND_TOPMOST, 0, 0, 0, 0, lngFlags)
Else
Call SetWindowPos(intHandle, HWND_NOTOPMOST, 0, 0, 0, 0, lngFlags)
End If
End Sub
Many thanks
Bob
.