Für diesen Tip brauchen Sie ein Formular, eine Checkbox und einen Timer.
Private 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
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_SHOWWINDOW = &H40
Const HWND_TOPMOST = -1
Const HWND_NOTTOPMOST = -2
Private Sub Form_Load()
Timer1.Interval = 300
End Sub
Private Sub Timer1_Timer()
'allways on top
If Check1.Value = 1 Then
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE
ElseIf Check1.Value = 0 Then
SetWindowPos Me.hwnd, HWND_NOTTOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE
End If
End Sub