来自:wjiachun 时间:00-4-8 13:33:39 ID:215637
关于 http://www.gislab.ecnu.edu.cn/delphibbs/DispQ.asp?LID=214162
我这里测试没有问题,而你又不去看,只能让你进来啦
***************************************************]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{$R myres.res}//这一行必须有
procedure ZloadfromResourse(screenindex:integer;name
char);
var td:ticon;
begin
try
td:=ticon.Create;
td.Handle:=LoadIcon(Hinstance,name);
td.SaveToFile('temp.cur');
screen.Cursors[screenindex]:=loadcursorfromfile('temp.cur');
deletefile('temp.cur');
finally
td.free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ZloadfromResourse(2,'icon1');//注意在资源文件中用大写 ICON1,你可以画出任意形状和颜色
Form1.cursor:=2;
end;
end.