AlwaisOnTop




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
'codice:

Public Sub AlwaysOnTop(myfrm As Form, SetOnTop As Boolean)
If SetOnTop The
lFlag = HWND_TOPMOST
Else
lFlag = HWND_NOTOPMOST
End If
SetWindowPos myfrm.hwnd, lFlag, _
myfrm.Left / Screen.TwipsPerPixelX, _
myfrm.Top / Screen.TwipsPerPixelY, _
myfrm.Width / Screen.TwipsPerPixelX, _
myfrm.Height / Screen.TwipsPerPixelY, _
SWP_NOACTIVATE Or SWP_SHOWWINDOW
End Sub

'Windows API/Global Declarations for :Always On To

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
'codice:

Public Sub AlwaysOnTop(myfrm As Form, SetOnTop As Boolean)
If SetOnTop Then
lFlag = HWND_TOPMOST
Else
lFlag = HWND_NOTOPMOST
End If
SetWindowPos myfrm.hwnd, lFlag, _
myfrm.Left / Screen.TwipsPerPixelX, _
myfrm.Top / Screen.TwipsPerPixelY, _
myfrm.Width / Screen.TwipsPerPixelX, _
myfrm.Height / Screen.TwipsPerPixelY, _
SWP_NOACTIVATE Or SWP_SHOWWINDOW
End Sub











( alwaisontop.html )- by Paolo Puglisi - Modifica del 17/12/2023