Home > Software engineering >  Who can help me to modify the module source the crosshair
Who can help me to modify the module source the crosshair

Time:10-01

Const TH32CS_SNAPHEAPLIST=& amp; H1
Const TH32CS_SNAPPROCESS=& amp; The H2
Const TH32CS_SNAPTHREAD=& amp; H4
Const TH32CS_SNAPMODULE=& amp; H8
Const TH32CS_SNAPALL=(TH32CS_SNAPHEAPLIST Or TH32CS_SNAPPROCESS Or TH32CS_SNAPTHREAD Or TH32CS_SNAPMODULE)
Const TH32CS_INHERIT=& amp; H80000000
Const MAX_PATH As Integer=260
Private Type PROCESSENTRY32
DwSize As Long
CntUsage As Long
Th32ProcessID As Long
Th32DefaultHeapID As Long
Th32ModuleID As Long
CntThreads As Long
Th32ParentProcessID As Long
PcPriClassBase As Long
DwFlags As Long
SzExeFile As String * MAX_PATH
End Type
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function Process32First Lib "kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long

As a Boolean Function exitproc (ByVal exefile As String)
Exitproc=False
Dim hSnapShot As Long, uProcess As PROCESSENTRY32
HSnapShot=CreateToolhelp32Snapshot (TH32CS_SNAPALL, 0 & amp;)
UProcess. DwSize=Len (uProcess)
R=Process32First (hSnapShot uProcess)
The Do While r
If Left $(uProcess szExeFile, IIf (InStr (1, uProcess szExeFile, CRH $(0)) & gt; 0, InStr (1, uProcess szExeFile, CRH $(0)) - 1, 0))=exefile Then
Exitproc=True
The Exit Do
End the If
R=Process32Next (hSnapShot uProcess)
Loop
End the Function





Option Explicit

Const LWA_COLORKEY=& amp; H1
Const LWA_ALPHA=& amp; The H2
Const GWL_EXSTYLE=(20)
Const WS_EX_LAYERED=& amp; H80000
Const WS_EX_TRANSPARENT As Long=& amp; H20 & amp;

Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal HWND As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal HWND As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal HWND As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
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 Declare Function ReleaseCapture Lib "user32 () As" Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal HWND As Long, ByVal wMsg As Long, ByVal wParam As an Integer, ByVal lParam) As Long As Long

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey) As Long As the Integer

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim pos As POINTAPI



Private Sub Form1_DblClick ()
Move Screen Width/2-240, Screen. The Height/2-240, 480, 480
End Sub

Private Sub Form_Load ()
Form2. Show
Form4. Show
Dim Ret As Long
Ret=GetWindowLong (HWND. Me., GWL_EXSTYLE)
Ret=Ret Or WS_EX_LAYERED Or WS_EX_TRANSPARENT
SetWindowLong Me. HWND GWL_EXSTYLE, Ret
SetLayeredWindowAttributes Me. The HWND, 0, 255, LWA_ALPHA


Form1. Enabled=False
Timer1. Enabled=True
Timer3. Enabled=True
Const LENGTH=8 & amp; Length of '
Const THICK_NESS=0 & amp;
BorderStyle=0: Caption="the crosshair" : App. TaskVisible=False
BackColor=vbWhite: ForeColor=vbRed: AutoRedraw=True: ScaleMode=vbPixels
Form1_DblClick
The Line ((LENGTH - THICK_NESS) \ 2, 0) - ((LENGTH - THICK_NESS) \ 2 + THICK_NESS, LENGTH),, BF
The Line (0, (the LENGTH - THICK_NESS) \ 2) - (LENGTH, (LENGTH - THICK_NESS) \ 2 + THICK_NESS),, BF
SetWindowPos HWND, 1, 0, 0, 0, 0, & amp; H20 Or & amp; The H2 Or & amp; H1
SetWindowLong HWND, (20), GetWindowLong (HWND, 20) (-) Or & amp; H80000
SetLayeredWindowAttributes HWND, vbWhite, 0, & amp; H1
End Sub

Private Sub Form_MouseDown (Button As an Integer, Shift the As an Integer, As Single X, Y As Single)
If the Button=2 Then Unload Me
End Sub

Private Sub Form_MouseMove (Button As an Integer, Shift the As an Integer, As Single X, Y As Single)
If the Button=1 Then ReleaseCapture: SendMessage HWND, & amp; HA1, 2, 0
End Sub




Private Sub Timer1_Timer ()
If GetAsyncKeyState (vbKeyUp) Then
Form1. Top=Form1. Top - 18
End the If
If GetAsyncKeyState (vbKeyLeft) Then
Form1. Left=Form1. Left - 18
End the If
If GetAsyncKeyState (vbKeyDown) Then
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related