Autor Beitrag
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Fr 04.04.03 20:45 
hi ihr

unter delphi 6 geht

ausblenden Quelltext
1:
Mouse.CursorPos.X					


das funzt unter delphi3 aber nicht. :shock: Wie kann ich das mit Delphi3 realisieren??

thÄnX

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Fr 04.04.03 21:36 
Hallo fcg!

Mach es mit der Api:
Zitat:
BOOL GetCursorInfo(
PCURSORINFO pci
);
Und hier noch ein Beispielcode:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var
  Info: tagCURSORINFO;
begin
  Info.cbSize := SizeOf(Info);
  if GetCursorInfo(Info) then
    Caption := format('%d; %d', [Info.ptScreenPos.x, Info.ptScreenPos.y])
  else
    caption := 'False';
Gruß wulfskin!

Nachtrag: Es geht nur kürzer mit GetCursorPos. Aber das bekommst du auch so hin...

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
fcg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Sa 05.04.03 09:57 
erstaml danke.

aber irgendwie smeckert der schon bei der variablen bezeichnung.

ausblenden Quelltext
1:
Undefinierter Bezeichner: tagCursorINFO					


:?: :?:

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Sa 05.04.03 11:30 
Hallo fcg!

Komisch, hast du die Unit Windows eingebunden? Wenn ja, könnte es daran liegen, dass die API unter Delphi 3 noch nicht vollständig verhanden ist.
In dem Fall versuch mal folgendes:
ausblenden Quelltext
1:
2:
3:
4:
5:
var
  P: TPoint;
begin
  if GetCursorPos(P) then
    Caption := format('%d; %d', [P.x, P.y]);
Wenn das auch nicht geht, dann melde dich nochmal!

Gruß wulfskin!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
fcg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Sa 05.04.03 11:38 
jepp danke. jetzt funzt es ;-)

unit windows war eingebunden...

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.