to delphiseabird(沙鸥): 一般保护性异常? 照你说的,那么请问:一个进程在另一个进程的地址空间运行是行不通的,是吗?那么进程隐藏是怎么实现的?
//发送字符串到其他程序。 //apphandle为其他程序的句柄 var SSend:string; i:integer; appHandle:hwnd; ch: byte; begin SSend:='13123123123adsfasdfasdf'; //... i := 1; while i <= Length(sSend) do begin ch := byte(sSend[i]); if Windows.IsDBCSLeadByte(ch) then begin Inc(i); SendMessage(apphandle, WM_IME_CHAR, MakeWord(byte(sSend[i]), ch), 0); end else SendMessage(apphandle, WM_IME_CHAR, word(ch), 0); Inc(i); end; end;
具体我还不太清楚,等有实例了,我给你帖过来
UP
2、找到相应的 EDIT 的句柄。
3、使用 sendMessage();发送消息: WM_SETTEXT
同样可以发送任标准消息,如单击事件等。具体可以参考
http://www.csdn.net/develop/Read_Article.asp?Id=22661但是不要做坏事呀!
一般保护性异常? 照你说的,那么请问:一个进程在另一个进程的地址空间运行是行不通的,是吗?那么进程隐藏是怎么实现的?
//apphandle为其他程序的句柄
var
SSend:string;
i:integer;
appHandle:hwnd;
ch: byte;
begin
SSend:='13123123123adsfasdfasdf';
//... i := 1;
while i <= Length(sSend) do
begin
ch := byte(sSend[i]);
if Windows.IsDBCSLeadByte(ch) then
begin
Inc(i);
SendMessage(apphandle, WM_IME_CHAR, MakeWord(byte(sSend[i]), ch), 0);
end
else
SendMessage(apphandle, WM_IME_CHAR, word(ch), 0);
Inc(i);
end;
end;
直接SetWindowText就可以了。
SetWindowText( edit的handle, 'xxxxxxxxxxxx' );
要找到某个窗口的句柄可以用FindWindow
我看了你的那个帖子 我是说windows是不允许程序访问其他进程的地址控件的,这样会引发一般保护性错误,所以才会用内存映射文件等形式来共享数据。
你的发送消息的方法和这个不一样,实际处理这个消息的还是当前进程的
我已经试验成功。