Autor Beitrag
FrEaKY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 235


D7
BeitragVerfasst: Sa 08.05.04 21:46 
Nochmal hi....

ich will in meinem Programm einen Cursor aus der Ressource cursor.res laden. Das sieht so aus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormCreate(Sender: TObject);
const
  crMyCursor = 22391;
begin
  Screen.Cursors[crMyCursor] := LoadCursor(HInstance, 'cursor.res\Inhalte\Cursor\Cursor1.cur');
  Screen.Cursor:=crMyCursor;
Aber es erscheint nur der normale Cursor. Danke im voraus für Hilfe
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 09.05.04 12:19 
Also mir erscheint der Aufruf von LoadCursor sehr seltsam (vor allem der 2te Parameter)..!
Wie kriegst du denn den Cursor in die Resource? Mit einer rc-Datei? Wenn ja wie schaut die aus..?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: So 09.05.04 12:22 
das geht so nicht.
linke den cusor in dein Progg via {$R cursor.res}

LoadCursor braucht eine Instance (korrekt) und den Cursornamen. NICHT Dateinamen !!!

wenn dein Cursor in der Res-Datei den namen "TEST" hast würde der korrekte AUfruf

LoadCursor(HInstance,"TEST") lauten (bzw. numerisch LoadCursor(Hinstance,"#123");

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
SQLException
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 89

WinXP + D5 Enterprise
Win2k + D6 Personal
BeitragVerfasst: Mi 04.05.05 12:17 
hallo,

das screen bei "Screen.Cursors" ist mein formular, oder? wenn ich bei screen den punktoperator setze, zeigt er mir gar nichts, bei Form1 gibt es dann ein Form1.Cursor, aber kein Form1.Cursors wie es hier verlangt wird:

ausblenden Delphi-Quelltext
1:
2:
  Screen.Cursors[crDragCopy] := LoadCursor(HInstance, PChar ('DRAGCOPY'));  
  Memo1.Cursor := crDragCopy;


z. Z. benutz ich das hier, was nicht funktioniert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormCreate(Sender: TObject);
const
  crMyCursor = 1;
begin
  Form1.Cursor := LoadCursor(HInstance, MakeIntResource(crMyCursor));
  Memo1.Cursor := crMyCursor;
end;


meine MyCursor.RES, gemacht mit "brcc32.exe MyCursor.cur":

ausblenden Delphi-Quelltext
1:
1 CURSOR "MyCursor.cur"					


und das hab ich natürlich auch noch in meinem quellcode:

ausblenden Delphi-Quelltext
1:
2:
{$R *.DFM}
{$R MyCursor.RES}


woher bekomm ich ein Screen.CursorS bzw. Form1.CursorS, dem ich ein array übergeb?

Moderiert von user profile iconMotzi: Code- durch Delphi-Tags ersetzt.
SQLException
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 89

WinXP + D5 Enterprise
Win2k + D6 Personal
BeitragVerfasst: Fr 06.05.05 11:03 
also im D5 Enterprise das geht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormCreate(Sender: TObject);
const
  crMyCursor = 1;
begin
  Screen.Cursors[crMyCursor] := LoadCursor(hInstance, MakeIntResource(crMyCursor));
  Form1.Cursor := crMyCursor;


daheim (D6 Personal) kennt er Screen.Cursors einfach nicht. ?