100分,求救,怎样改变外部程序特定文本框里面的值?

zgy166 2003-07-10 12:03:01
我折腾了一个上午也没弄出来
...全文
34 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
harryho 2003-07-12
  • 打赏
  • 举报
回复
用FINDWINDOW找出那个文本框的句柄。。再用SETWINDOWTEXT OR SENDMESSAGE,都可以。
无敌魔仙 2003-07-11
  • 打赏
  • 举报
回复
既然 MSDN里面有个However,SetWindowText不行了
SetWindowText
The SetWindowText function changes the text of the specified window's title bar (if it has one). If the specified window is a control, the text of the control is changed. However, SetWindowText cannot change the text of a control in another application.

BOOL SetWindowText(
HWND hWnd, // handle to window or control
LPCTSTR lpString // title or text
);

而这里没有那么就是它了哦
WM_SETTEXT
An application sends a WM_SETTEXT message to set the text of a window.

mafangsan 2003-07-11
  • 打赏
  • 举报
回复


SetWindowText无效,因为它只能设置本程序的文本框
AechoJohn 2003-07-10
  • 打赏
  • 举报
回复
先得到外部指定程序的名柄,再得到其内的特定文本框的名柄,然后用SendMessage或PostMessage函数设置其内容.
lxqlogo0 2003-07-10
  • 打赏
  • 举报
回复
获得外部程序的句柄,用sendmessage发送消息
ClassicWuHao 2003-07-10
  • 打赏
  • 举报
回复
用sendmessage试试,发送wm_settext消息.

1,488

社区成员

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

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