怎样通过窗体句柄取得窗体中某控件句柄

classicrock 2005-09-17 11:08:06
比如我用FindWindow找到某个窗口,我想取得其中某个编辑框的句柄,进而用GetWindowText取得编辑框的文字,如何实现?
...全文
196 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
菜牛 2005-09-24
  • 打赏
  • 举报
回复
网页呀,完全不一样的,你到“网络编程”板块找找,很多的,要通过接口进行。
classicrock 2005-09-24
  • 打赏
  • 举报
回复
UP
phoenix96_2000 2005-09-19
  • 打赏
  • 举报
回复
webbrowser控件的编辑框没那么容易取得,
并不是webbrowser的子窗口
classicrock 2005-09-19
  • 打赏
  • 举报
回复
用Spy++怎么查控件的ID?
我打开了一个ie,进入新浪主页,然后在Spy++里找到这个进程。比如我想知道新浪主页最上面那个登陆邮箱输入用户名的EditBox,怎样操作?
classicrock 2005-09-19
  • 打赏
  • 举报
回复
没那么容易,那就是说目前还没有什么简单的办法喽?

我听说有一种木马,可以检测ie,当检测到浏览的网页里出现某些关键字木马就被激活。
怎么实现的?
phoenix96_2000 2005-09-18
  • 打赏
  • 举报
回复
EnumChildWindows这个方法在MSDN里查不到??
-----------------------
The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE
BOOL EnumChildWindows( HWND hWndParent,
WNDENUMPROC lpEnumFunc,
LPARAM lParam
);
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
Minimum operating systems Windows 95, Windows NT 3.1
菜牛 2005-09-18
  • 打赏
  • 举报
回复
注意:跨进程不能用GetWindowText得到编辑框的内容,要用WM_GETTEXT消息。
goodboyws 2005-09-18
  • 打赏
  • 举报
回复
用Spy++可以看到控件ID, 然后GetDlgItem
rageliu 2005-09-18
  • 打赏
  • 举报
回复
不是自己写的控件的id可不好知道!!用spy++看它的类什么的!然后找!
EnumChildWindows遍历所有子控件!!一个一个判断!判断的条件就看你自己的了
classicrock 2005-09-18
  • 打赏
  • 举报
回复
EnumChildWindows这个方法在MSDN里查不到??
phoenix96_2000 2005-09-17
  • 打赏
  • 举报
回复
你要能知道这个EDIT的ID才行
::GetDlgItem(hWndParent,ID_EDIT)->SetWindowText

如果不知道,可以用EnmuChildWindows来枚举来找出这个编辑框,
如果只有一个这种编辑框,那么用GetClassName就可以过滤出来
不然还得加上其他特征来过滤出,比如位置大概在哪里之类的... 呵呵
pomelowu 2005-09-17
  • 打赏
  • 举报
回复
用FindWindowEx 啊
或者
GetWindow + GetNextWindow
或者
GetDlgItem
...

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧