Option Explicit
' sur la feuille mettre 2 label : 1 nommé lblHandle et 1 nommé lblClassName
' 1 timer nommé timer1
' 1 bouton nommé command1
' nommer la feuille Frm_Handle
'
Dim WndLeft, WndTop As Long
'
'Configuration fenêtre au premier plan
'
Private Const OnTop = -1&
Private Const DISABLE_ONTOP = -2&
Private Const wFlag = 33
'
'Déclaration API fenêtre au premier plan
'
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
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
'
'Fenêtre au premier plan
'
WndLeft = Frm_Handle.Left / 15
WndTop = Frm_Handle.Top / 15