vb程序求助
发布网友
发布时间:2022-08-04 00:49
我来回答
共4个回答
热心网友
时间:2024-11-07 23:58
给你个监视IE下载程序的例子
form :
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
'Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wparam As Long, lparam As Any) As Long
Private Const BM_SETCHECK = &HF1
Dim i As String
Dim ihwnd As Long
Private Sub Form_Load()
Me.Hide
App.TaskVisible = False
End Sub
Private Sub Timer1_Timer()
'ii = ii + 1
'If ii = 1111 Then ii = 1
h = GetForegroundWindow()
i = Space(256)
GetWindowText h, i, 255
If Left(i, 4) = "文件下载" Or Left(i, 4) = "下载完毕" Or Left(i, 3) = "已复制" Or Left(i, 3) = "已完成" Then Call check
'Timer1.Enabled = Falses
'End If
End Sub
Sub check()
ihwnd = FindWindow(vbNullString, i)
EnumChildWindows ihwnd, AddressOf EnumChildProc, ByVal 0&
'Call Sleep((1000))
SendMessage dhwnd, BM_SETCHECK, 0, 0
End Sub
Mole:
Declare Function GetDlgItem Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem 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 GetDesktopWindow Lib "user32" () As Long
Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lparam 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 GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetDlgCtrlID Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function SetFocus1 Lib "user32" Alias "SetFocus" (ByVal hWnd As Long) As Long
Public Const WM_GETTEXT = &HD
Public dhwnd As Long
Function EnumChildProc(ByVal hWnd As Long, ByVal lparam As Long) As Long
Dim Cn As String * 256
Dim Tx As String * 256
Dim sSave As String
GetClassName hWnd, Cn, 255
sSave = Space$(GetWindowTextLength(hWnd) + 1)
GetWindowText hWnd, sSave, Len(sSave)
sSave = Left$(sSave, Len(sSave) - 1)
If sSave = "下载完毕后关闭该对话框(&C)" Then
dhwnd = hWnd
End If
EnumChildProc = 1
End Function
作用是:不能取消“下载通知”
热心网友
时间:2024-11-07 23:59
自己动手,丰衣足食!追问废话,这道理谁不懂,在不知情况下,才请教于大家。
热心网友
时间:2024-11-07 23:59
没招,尤其是QQ2011.
热心网友
时间:2024-11-08 00:00
鼠标屏幕录制脚本或许可以,用vb的shell打开qq,再打开录好的脚本。