写文本框在另一个进程在Win32中(C ++) [英] Writing to textbox in another process in Win32 (c++)

查看:145
本文介绍了写文本框在另一个进程在Win32中(C ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设你需要编写一个程序或服务(过程1),将读取或写入文本框在另一个应用程序或进程(process 2)。它是如何做?
IS进程2的文本框的名称写在某种注册表,这样我可以从某种系统调用得到它?

Suppose you need to write a process or service (process1) that will read or write to textbox in another application or process (process 2). How is it done? Is the name of the textbox of process 2 is written in some sort of a registry so i can get it from some sort of a system call?

感谢。

推荐答案

文本框是由一个ID号,你可以找到使用间谍++标识。使用FindWindow函数和EnumChildWindows寻找目标文本框的HWND。随着HWND你可以SendMessage函数WM_GETTEXT或WM_SETTEXT。注意:如果两个进程的安全等级不同,这是行不通的。

The text box is identified by an ID number that you can find using Spy++. Use FindWindow and EnumChildWindows to find the HWND of the target text box. With the HWND you can SendMessage WM_GETTEXT or WM_SETTEXT. Note: This won't work if the security level of the two processes differ.

这篇关于写文本框在另一个进程在Win32中(C ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆