| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 957 人关注过本帖
标题:监视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
快速回复:监视IE窗口内容
数据加载中...
 
   



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

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