Autor Beitrag
Ivo@CoMRoK
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Sa 04.02.06 19:28 
Also ich hab ne Mausklick abfrage gemacht um den Cursor zu ändern:
Erst hatt ichs so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure Form1.MouseDown(Sender: TObject);
begin
  Form1.Cursor := crSQLWait;
  sleep(10);
  Form1.Cursor := crHandPoint;
end;


Aber da hts nur die Rechte Maustaste abgefragt.
Das selbe hab ich noch mal mit Timer gemacht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
procedure TForm1.FormCreate(Sender: TObject);
begin
Timer1.Interval := 10;
Timer2.Interval := 10;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  if getAsyncKeyState(VK_RButton)< 0 then
  begin
    Form1.Cursor := crSQLWait;
    sleep(100);
    Form1.Cursor := crHandPoint;
  end;
end;

procedure TForm1.Timer2Timer(Sender: TObject);  //2 Timer da ich sicher sein wollte das die getrennt des machen
begin
  if getAsyncKeyState(1)< 0 then  //Hier hatte ich auch schon VK_LButton aber des ging auch net
  begin
    Form1.Cursor := crSQLWait;
    sleep(100);
    Form1.Cursor := crHandPoint;
  end;
end;


Das funzt aber trotzdem nicht. Der fragt trotzdem nur die Rechte ab.
Hiiiiilfe!

_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.
Ivo@CoMRoK Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Sa 04.02.06 19:50 
Also ich hab das jetzt noch probiert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormClick(Sender: TObject);
begin
  Form1.Cursor := crSQLWait;
  sleep(100);
  Form1.Cursor := crHandPoint;
end;


Damit gehts nur ändert sich der Cursor erst wenn man die Maus wieder loslässt. :(

_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.
Speed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP
Delphi 2006 Prof.
BeitragVerfasst: Sa 04.02.06 20:52 
Hey, du hast leider nicht den gesamten Code der Procedure hingeschrieben.
Dieser lauted:
ausblenden Delphi-Quelltext
1:
2:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

Mit Button fragst du also die Taste der Maus ab.

Dann kannst du je nach Taste den bestimmten Code rein schreiben
guckst du hier:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
If Button=mbRight then
  //Hier den Code für die rechte Taste
Else If Button=mbLeft then
  //Code für die Linke


Hoffe das hilft dir und dass ich dein Problem auch richtig verstanden habe.

Greetz Speed
Ivo@CoMRoK Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Sa 04.02.06 20:58 
Hmmm also klingt ganz gut klappt aber leider auch nicht.
Kanns sein, dass des irgendwie blockiert ist und die Anwendung was anderes denkt machen zu müssen?
thx

_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.
Speed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP
Delphi 2006 Prof.
BeitragVerfasst: Sa 04.02.06 21:01 
Was willst du denn konkret machen.
Schätz mal bei der Rechten Taste den einen Cursor und bei der linken den anderen,oder?
Ivo@CoMRoK Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Sa 04.02.06 21:09 
Also des is so:
Ich will das die Anwendung ein Cursor hat(egal welcher ich mach später nen neuen rein), dann will ich dass wenn die
Maus gedrückt wird ein anderer Cursor benutz wird und dann wieder der alte.(mit der rechten Maustaste funzt des ja auch prima nur die rechte macht nix)

_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.
Speed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP
Delphi 2006 Prof.
BeitragVerfasst: Sa 04.02.06 21:12 
Sag das doch gleich.
DAnn schau dir das mal an:

Wenn die Maus gedrückt wird schreibst du das:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  If Button=mbLeft then  //optional
    Form1.Cursor:=crSQLWait;
end;


Und wenn sie wieder losgelassen wird:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  If Button=mbLeft then //optional
    Form1.Cursor:=crDefault;
end;


Dann kannste auch bei Bedarf die rechte abfragen (Button=mbRight)

Müsste dann eigentlich so klappen wie du es willst
Ivo@CoMRoK Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Sa 04.02.06 21:25 
Genauso hab ichs gemacht und es klappt nicht.
Einloggen, um Attachments anzusehen!
_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.