Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21884

Is this Form on Top?

$
0
0
I have a routine which put a particular form on top, namely:

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

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
.

Viewing all articles
Browse latest Browse all 21884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>