社区
C++ 语言
帖子详情
how to get window title and visible window text?
Waiting_Ai
2005-08-04 11:33:03
比如安装超星阅览器的安装窗口我如何获取
window title:安装 超星阅览器 3.8,
和
visible window text:
欢迎使用 超星阅览器 3.8 安装向导
本程序将安装 超星阅览器 3.8 到您的计算机中。
强烈建议您在继续安装之前关闭其他所有正在运行的程序,以避免安装过程中可能产生的相互冲突。
单击“下一步”继续,“取消”退出安装。
下一步(N) >
取消
?
TKS!
...全文
76
3
打赏
收藏
how to get window title and visible window text?
比如安装超星阅览器的安装窗口我如何获取 window title:安装 超星阅览器 3.8, 和 visible window text: 欢迎使用 超星阅览器 3.8 安装向导 本程序将安装 超星阅览器 3.8 到您的计算机中。 强烈建议您在继续安装之前关闭其他所有正在运行的程序,以避免安装过程中可能产生的相互冲突。 单击“下一步”继续,“取消”退出安装。 下一步(N) > 取消 ? TKS!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Waiting_Ai
2005-08-17
打赏
举报
回复
我的问题已经解决,现在share出来,XDJM多多指教!
#include <afx.h>
#include <Afxwin.h>
#include <iostream.h>
const STRINGLEN=256;
int i = 0;
CString text;
CString Needtitle ="安装 - CyberArticle";
CString Needtext = "欢迎使用 CyberArticle 安装向导";
int CALLBACK MyEnumChildWindowsProc(HWND hwnd, LPARAM lParam)
{
//CMyView* pView = (CMyView*)lParam;
//pView->AddChildWindowToList(hwnd);
CString s;
GetClassName(hwnd, s.GetBuffer(STRINGLEN),STRINGLEN);
s.ReleaseBuffer();
cout<<"class:"<<s<<endl;
CWnd* pWnd = CWnd::FromHandle(hwnd);
pWnd->GetWindowText(s);
cout<<"text:"<<s<<endl;
text.Format(_T("%s%s"),text,s);
return 1;
}
int CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lParam)
{
CWnd* pWnd = CWnd::FromHandle(hwnd);
if (hwnd!=pWnd->GetParentFrame()->GetSafeHwnd())
{
DWORD dwStyle = GetWindowLong(hwnd, GWL_STYLE);
if ((dwStyle & WS_OVERLAPPEDWINDOW) && (dwStyle & WS_VISIBLE))
{
i++;
cout<<"//////////////////////"<<i<<"//////////////////////"<<endl;
// class name
CString s;
//::GetClassName(hwnd, s.GetBuffer(STRINGLEN), STRINGLEN);
// window text -- use GetWindowText
pWnd->GetWindowText(s);
cout<<"Windows title:";
cout<<s<<endl;
if(s.Compare(Needtitle)==0)
{
// window's children
EnumChildWindows(hwnd, MyEnumChildWindowsProc, NULL);
cout<<"text:"<<text<<endl;
SetForegroundWindow(hwnd);
}
s.ReleaseBuffer();
}
}
text.Empty();
text.GetBuffer(1000);
return 1;
}
int main(int argc, char* argv[])
{
text.GetBuffer(1000);
EnumWindows(MyEnumWindowsProc,NULL);
return 0;
}
healer_kx
2005-08-04
打赏
举报
回复
GetWindowText啊。相关的API可能用到FindWindow什么的。
下一步什么的用GetDlgItem。
Hook估计也需要用到。
Waiting_Ai
2005-08-04
打赏
举报
回复
TKS healer_kx(天降甘草),GetWindowText只能得到窗口的标题。窗口上的其它信息得不到。
Hook不知道怎么用。
javacv-platform-1.3.3-src
To learn how to use the API, since documentation currently lacks, please refer to the Sample Usage section below as well as the sample programs, including two for Android (FacePreview.java and Record...
jQuery完全实例.rar
Uses both the shortcut for $(document).ready() and the argument to write failsafe jQuery code using the $ alias, without relying on the global alias. jQuery 代码: jQuery(function($) { // Your code ...
How To Use NSOperations and NSOperationQueues
Update 10/7/14: This tutorial has now been updated for iOS 8 and Swift;check it out! Everyone has had the frustrating experience of tapping a button or entering some
text
in an iOS or Mac app, ...
Win32
Window
Hierarchy and Styles , Kyle Marsh
Win32
Window
Hierarchy and Styles Kyle Marsh Microsoft Developer Network Technology Group Created: September 29, 1993 Click to view or copy the Styles sample application files for this technical a
How to be a Programmer
How to be a Programmer: A Short, Comprehensive, and Personal Summary Robert L Read Copyright � 2002, 2003 Robert L. Read Copyright Copyright � 2002, 2003 by Robert L. Re...
C++ 语言
64,682
社区成员
250,490
社区内容
发帖
与我相关
我的任务
C++ 语言
C++ 语言相关问题讨论,技术干货分享,前沿动态等
复制链接
扫一扫
分享
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
请不要发布与C++技术无关的贴子
请不要发布与技术无关的招聘、广告的帖子
请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下
试试用AI创作助手写篇文章吧
+ 用AI写文章