J
jbas
Unregistered / Unconfirmed
GUEST, unregistred user!
这样只能返回有handle的控件的classname,但对speedbutton就不行了,是否有办法实现,
procedure spybutton(var msg:tmessage);message CM_MOUSEENTER;
procedure TForm1.spybutton(var msg: tmessage);
var
xc:array[0..20] of char;
i:integer;
begin
if getclassname(windowfrompoint(mouse.CursorPos),xc,20)<>0 then
label1.Caption:=xc;
end;
-------------------------------
if form1.Components.ClassType=TSpeedbutton then
label2.Caption:='speed';这样能实现,但是要知道mouse下的就不行了。
procedure spybutton(var msg:tmessage);message CM_MOUSEENTER;
procedure TForm1.spybutton(var msg: tmessage);
var
xc:array[0..20] of char;
i:integer;
begin
if getclassname(windowfrompoint(mouse.CursorPos),xc,20)<>0 then
label1.Caption:=xc;
end;
-------------------------------
if form1.Components.ClassType=TSpeedbutton then
label2.Caption:='speed';这样能实现,但是要知道mouse下的就不行了。