标题:监视IE窗口内容
只看楼主
zaroty
Rank: 1
等 级:新手上路
帖 子:93
专家分:0
注 册:2008-3-28
 问题点数:0 回复次数:0 
监视IE窗口内容
API练习,不知道是不是应该发表为普通帖子
程序代码:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) 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 Sub Command1_Click()
Dim IEtext As String
IEtext = Space(300)
Handle = FindWindow("IEFrame", vbNullString)
If Handle <> 0 Then GetWindowText Handle, IEtext, 299
If InStr(1, IEtext, "zaroty") Then PostMessage Handle, &H10, 0, 0 ' 红色部分为识别的关键字

End Sub
搜索更多相关主题的帖子: ByVal Long Alias Lib 
2008-08-16 15:57



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-228607-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014602 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved