W
wqhatnet
Unregistered / Unconfirmed
GUEST, unregistred user!
以下代码只能显示文字,可是我想要显示缩览图的
function showHintMsg(msg:String):boolean;
var
h : THintWindow;
r : TRect;
p : TPoint;
begin
GetCursorPos(p);
with r do
begin
left := p.x;
top := p.y;
right := p.x+100;
bottom := p.y+100;
end;
h := THintWindow.Create(form1);
with h do
begin
Color := clInfoBk;
ActivateHint( r,msg);
//sleep(1000);
ReleaseHandle;
Free;
end;
if h.Handle<> 0 then
showMessage('ok');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
h : THintWindow;
r : TRect;
begin
with r do
begin
left := 100;
top := 50;
right := 500;
bottom := 100;
end;
h := THintWindow.Create( Self );
with h do
begin
Color := clInfoBk;
ActivateHint( r, 'hi th'+#13#10+'ere!' );
//sleep(1000);
//ReleaseHandle;
//Free;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
showHintMsg(memo1.text);
end;
function showHintMsg(msg:String):boolean;
var
h : THintWindow;
r : TRect;
p : TPoint;
begin
GetCursorPos(p);
with r do
begin
left := p.x;
top := p.y;
right := p.x+100;
bottom := p.y+100;
end;
h := THintWindow.Create(form1);
with h do
begin
Color := clInfoBk;
ActivateHint( r,msg);
//sleep(1000);
ReleaseHandle;
Free;
end;
if h.Handle<> 0 then
showMessage('ok');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
h : THintWindow;
r : TRect;
begin
with r do
begin
left := 100;
top := 50;
right := 500;
bottom := 100;
end;
h := THintWindow.Create( Self );
with h do
begin
Color := clInfoBk;
ActivateHint( r, 'hi th'+#13#10+'ere!' );
//sleep(1000);
//ReleaseHandle;
//Free;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
showHintMsg(memo1.text);
end;