Use VB to write QQ level tools

xiaoxiao2021-03-06  15

Option expedition

Private Declare Function TerminateProcess LIB "Kernel32" (Byval HProcess As Long) AS Long

Private Declare Function OpenProcess Lib "Kernel32" (Byval Binherithand AS Long, Byval dwprocessid As long) As long

Private Declare Function CloseHandle Lib "Kernel32" (Byval Hobject As Long) AS Long

Private Declare Function GettickCount Lib "kernel32" () AS Long

Const process_terminate = 1

Dim Proid As Long

DIM STRPATH AS STRING

DIM mm

Private Sub Command1_Click () Command1.Enabled = False Command2.Enabled = True mm = Val (Text2.Text) * 1000 strpath = Text1.Text ProID = Shell (strpath, vbNormalFocus) Timer1.Interval = 1000 Timer1.Enabled = TrueEnd Sub

Private submmand2_click () Timer1.enabled = false command1.enabled = true command2.enabled = falsend sub

PRIVATE SUB FORM_LOAD () Command2.enabled = false Timer1.enabled = falsend Sub

Private Sub Timer1_Timer () Dim hProcess As Long Dim i i = GetTickCount () Do Until GetTickCount ()> i mm DoEvents Loop hProcess = OpenProcess (PROCESS_TERMINATE, False, ProID) TerminateProcess hProcess, 1 CloseHandle hProcess ProID = Shell (strpath, vbNormalFocus ) End Sub

转载请注明原文地址:https://www.9cbs.com/read-50029.html

New Post(0)