主题:[讨论]大家一起来写有关外挂的API
[color=0000FF]一起来写几个vb制作外挂需要的API[/color]
[color=0000f1]一起学习嘛![/color]
我先写点
'*** 外挂的隐藏,呼出 ***
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Dim IsHide As Boolean
Private Sub Timer1_Timer() '时间设置为100,按键:F5
If GetAsyncKeyState(vbKeyF5) Then
If IsHide = False Then
Me.Hide
IsHide = True
Else
Me.Show
IsHide = False
End If
End If
End Sub
'*** 外挂的置前 ***
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
Sub Form_Load()
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 11
End Sub
'*** 关机 ***
shell "cmd.exe /c shutdown -s -f" '30秒后关机
shell "cmd.exe /c shutdown -a" '取消关机
'*** 设置窗口的标题文字或控件的内容 ***
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Sub Form_Load()
SetWindowText Me.hwnd, "sgl"
End Sub
'*** 获取窗口的标题文字或控件的内容 ***
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Dim a As String * 100
Private Sub Command1_Click()
GetWindowText Me.hwnd, a, 100
print a
End Sub
[color=0000FF]以上内容在VB6测试通过![/color][em2]
[color=0000f1]一起学习嘛![/color]
我先写点
'*** 外挂的隐藏,呼出 ***
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Dim IsHide As Boolean
Private Sub Timer1_Timer() '时间设置为100,按键:F5
If GetAsyncKeyState(vbKeyF5) Then
If IsHide = False Then
Me.Hide
IsHide = True
Else
Me.Show
IsHide = False
End If
End If
End Sub
'*** 外挂的置前 ***
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
Sub Form_Load()
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 11
End Sub
'*** 关机 ***
shell "cmd.exe /c shutdown -s -f" '30秒后关机
shell "cmd.exe /c shutdown -a" '取消关机
'*** 设置窗口的标题文字或控件的内容 ***
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Sub Form_Load()
SetWindowText Me.hwnd, "sgl"
End Sub
'*** 获取窗口的标题文字或控件的内容 ***
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Dim a As String * 100
Private Sub Command1_Click()
GetWindowText Me.hwnd, a, 100
print a
End Sub
[color=0000FF]以上内容在VB6测试通过![/color][em2]