请您翻译:delphi->bcb(二十几行)(100分)

0

011

Unregistered / Unconfirmed
GUEST, unregistred user!
下面是个向另外的程序送文本的源码,哪位帮忙翻译成C++Builder?

在单元里 uses unit2;
unit Unit2;
interface
uses windows,messages;
procedure SendKeys(sSend:string);
implementation
procedure SendKeys(sSend:string);
var
i:integer;
focushld,windowhld:hwnd;
threadld:dword;
ch: byte;
begin
windowhld:=GetForegroundWindow;
threadld:=GetWindowThreadProcessId(Windowhld,nil);
AttachThreadInput(GetCurrentThreadId,threadld,true);
Focushld:=getfocus;
AttachThreadInput(GetCurrentThreadId,threadld,false);
if focushld = 0 then
Exit;
i := 1;
while i <= Length(sSend)do
begin
ch := byte(sSend);
if Windows.IsDBCSLeadByte(ch) then
begin
Inc(i);
SendMessage(focushld, WM_IME_CHAR, MakeWord(byte(sSend), ch), 0);
end
else
SendMessage(focushld, WM_IME_CHAR, word(ch), 0);
Inc(i);
end;
postmessage(focushld,WM_keydown,13,0);
end;
end.
只要点一下那个文本框就可以!
 
W

wjiachun

Unregistered / Unconfirmed
GUEST, unregistred user!
呵呵,这不是我那一段么?我不会BCB,这个好像是cAkk给我的,我用它做了
一个聊天室定时发送字符的“灌水机” :)
 
A

amo

Unregistered / Unconfirmed
GUEST, unregistred user!
sigh,
懒到这种地步
首先,你附的Send key源程序不全
其次,其中的api可以直接转换...
第三,你发错了版了
 
W

wjiachun

Unregistered / Unconfirmed
GUEST, unregistred user!
阿猫:你看看他的另一个问题就知道这个是全的了 :)
 
W

wjiachun

Unregistered / Unconfirmed
GUEST, unregistred user!
你竟然又是多帐号?????
http://www.gislab.ecnu.edu.cn/delphibbs/DispQ.asp?LID=290875
 
I

iie

Unregistered / Unconfirmed
GUEST, unregistred user!
居然有这样的人
 
W

wjiachun

Unregistered / Unconfirmed
GUEST, unregistred user!
接受答案了.
 
顶部