|
|
导航: |
论坛 -> 未知:1
斑竹: |
|
作者: |
小心 |
▲△△△△ |
-
|
|
|
2003/5/16 16:49:28 |
标题: |
|
加入我的收藏 |
楼主: |
怎样在程序中实现自定义的"程序正在运行"状态的鼠标指针样式.....
----------------------------------------------
|
作者: |
zizii (高高高级馒头) |
★☆☆☆☆ |
-
|
神秘会员 |
|
2003/5/16 16:50:27 |
1楼: |
一.建立工程与一个资源档 用Image Editor编辑一个鼠游标 (Fild | New | Resource File) 新建一个 CURSOR_1 的 CURSOR, 设定好它的 Hot Spot (Cursor | Set Hot Spot) 存档时注意要和建立的Project存在同一个目录 在本例我们先假定为 MyCursor.res 二. 程序部分 定义一个常数crMyCursor, 这个常数您必须设成大於零 的任何整数, 以 LoadCursor() 函数将自订的鼠标资源 load 进来, 以下为源代码: // unit.pas unit Unit1; interface uses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs;
const crMyCursor = 1; (* 宣告一个常数 *) type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; {$R mycursor.res}//这行$R不可少, 否则自订的鼠游标就出不来了 implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin //将鼠标资源 load 进来 Screen.Cursors[crMyCursor] := LoadCursor (hInstance,'CURSOR_1'); Cursor := crMyCursor;//指定 form1 的 cursor 为自订鼠标 Button1.Cursor := crMyCursor;//指定Button1的cursor为自订鼠标 end; end.
----------------------------------------------
维护世界和平,共创美好盒子。
|
作者: |
boy (阿門) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2003/5/16 19:07:29 |
4楼: |
3楼: 為什麼 WIN98 會當機??
----------------------------------------------
|
作者: |
boy (阿門) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2003/5/18 13:55:16 |
6楼: |
自定义鼠标??? const crMyCursor = 1; .... procedure TForm1.FormCreate(Sender: TObject); begin // 載入動態游標 Screen.Cursors[crMyCursor] :=LoadCursorFromFile('c:\mystuff\mycursor.ani'); // 表單中,使用動態游標。 Cursor := crMyCursor; end;
----------------------------------------------
|
作者: |
boy (阿門) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2003/5/19 18:53:13 |
8楼: |
[quote] const crMyCursor = 1; .... procedure TForm1.FormCreate(Sender: TObject); begin // 載入動態游標 Screen.Cursors[crMyCursor] :=LoadCursorFromFile('c:\mystuff\mycursor.ani'); // 表單中,使用動態游標。 Cursor := crMyCursor; end; [/quote] 當機原因 如何恢復原來windows程序忙时显示小沙漏
----------------------------------------------
|
作者: |
boy (阿門) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2003/5/19 20:08:38 |
9楼: |
可以了
----------------------------------------------
|
|