Advertisement
6_2008-2009 Custom Controls/ Forms/ Menus #194787

StayOnTop

Keep a form always on top (topmost floating form) in windows 95. Albetski, Allan"

AI

KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Quellcode
original-source
Public Sub StayOnTop(frmForm As Form, fOnTop As Boolean)
 
 Const HWND_TOPMOST = -1
 Const HWND_NOTOPMOST = -2
 
 Dim lState As Long
 Dim iLeft As Integer, iTop As Integer, iWidth As Integer, iHeight As Integer
  
 With frmForm
  iLeft = .Left / Screen.TwipsPerPixelX
  iTop = .Top / Screen.TwipsPerPixelY
  iWidth = .Width / Screen.TwipsPerPixelX
  iHeight = .Height / Screen.TwipsPerPixelY
 End With
 
 If fOnTop Then
  lState = HWND_TOPMOST
 Else
  lState = HWND_NOTOPMOST
 End If
 Call SetWindowPos(frmForm.hWnd, lState, iLeft, iTop, iWidth, iHeight,0)
End Sub
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine