1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| 'COLLER DANS UN MODULE
Option Explicit
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const SWP_NOMOVE = 2
Public Const SWP_NOSIZE = 1
Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public 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
Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Declare Function GetFocus Lib "user32" () As Long
'
'Place une forme en permanence (presque) au dessus du bureau.
'Mode = true la forme est au dessus du bureau, si False positionnement normal
'
Sub PlaceDessus(Fr As Long, Mode As Boolean)
Dim e As Integer
Dim i As Long
If Mode Then
i = SetWindowPos(Fr, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
Else
i = SetWindowPos(Fr, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
End If
End Sub |
Partager