반응형
Form1.ActiveControl 이런식으로 ..
if Form1.ActiveControl is TEdit then
TEdit(Form1.ActiveControl).Text:='텍스트';
GetFocus 는 이런식으로 ..
var
Handle:THandle;
ClassName:Array[0..255] of Char;
TextBuf: array[0..32767] of Char;
begin
Handle:=GetFocus;
TextBuf:='텍스트';
if Handle <> 0 then begin
GetClassName(Handle,ClassName,SizeOf(ClassName));
if ClassName = 'TEdit' then
SendMessage(Handle,WM_SETTEXT,SizeOf(TextBuf),LongInt(@TextBuf));
end;
if Form1.ActiveControl is TEdit then
TEdit(Form1.ActiveControl).Text:='텍스트';
GetFocus 는 이런식으로 ..
var
Handle:THandle;
ClassName:Array[0..255] of Char;
TextBuf: array[0..32767] of Char;
begin
Handle:=GetFocus;
TextBuf:='텍스트';
if Handle <> 0 then begin
GetClassName(Handle,ClassName,SizeOf(ClassName));
if ClassName = 'TEdit' then
SendMessage(Handle,WM_SETTEXT,SizeOf(TextBuf),LongInt(@TextBuf));
end;
반응형