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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
$Include "Rapidq.inc"
TYPE POINTAPI
X AS LONG
Y AS LONG
END TYPE
Declare Function SendMessageA Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Declare Function GetAsyncKeyState Lib "user32" alias "GetAsyncKeyState" (vKey As Long) As long
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Long) As Long
Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Dim Handle as integer
Dim Utiliser as integer
Dim Souris AS POINTAPI
Const WM_SETFOCUS As Long = &H7
Const WM_CLOSE As Integer = &H10
Const PROCESS_ALL_ACCESS As Long = &H1F03FF
Utiliser = 1 : VK_RBUTTON = 2 : VK_LBUTTON = 1 : Touche = 65
ClassNom$ = Space$(100)
Titre$ = space$(100)
do
GetCursorPos(Souris)
LenClass = GetClassName(Handle,@ClassNom$,100)
LenTitre = GetWindowText(Handle,@Titre$, 100)
Edit1.text = left$(Titre$,LenTitre)
Edit2.text= str$(Handle)
Edit3.text = left$(ClassNom$,lenClass)
If GetAsyncKeyState(VK_RBUTTON) <> 0 then
SendMessageA(Handle,WM_CLOSE,0,0)
CloseHandle(Handle)
elseif GetAsyncKeyState(Touche) <> 0 then
Utiliser = 0
end if
loop until Utiliser = 0 |
Partager