Autor Beitrag
schdom14
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win XP
D7 Enterprise
BeitragVerfasst: Fr 16.01.04 21:53 
Ich weiss net ob ich im richtigen forum bin, falls net bitte verschieben

frage:
ich muss nen punkt auf denn bildschrim zeichen, dieser muss IMMER zu
sehen sein, farbe egal, wenn ich ein spiel starte oder wenn ich ne andere
anwendung öffne dieser punkt muss immer zusehen sein. so als würde
man mit nem edding nen punkt auf seinen bildscheim malen :wink:


Wie kann ich sowas machen ???

Danke im vorraus
MasterBilke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 38

WIN XP
D3 Prof
BeitragVerfasst: Fr 16.01.04 22:07 
naja du könntest mit

ausblenden Delphi-Quelltext
1:
Image1.Canvas.Pixels[ClientWidth div 2, ClientHeight div 2] := clBlack;					



nen punkt in die mitte des bildschirms zeichnen :)

ich hoffe das jeht irgentwie :)
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Fr 16.01.04 22:14 
Er wollte aber den Punkt immer sehen. wobei sich mir die Frage stellt, warum er das möchte :? . Mir fällt da kein sinnvoller Grund ein.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
schdom14 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win XP
D7 Enterprise
BeitragVerfasst: Fr 16.01.04 22:15 
hey cool, das ist schonmal nicht schlecht sowas habe ich gesucht, danke :wink:
aber wie mache ich jetzt das der punkt immer sichtbar ist ??




Danke im vorraus
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Sa 17.01.04 08:58 
HI,

kann ich dir sagen wieso er das will ... wenn man bei Egoshootern wie z.B.: Counter Strike eine Zoom-Waffe hat, bekommt man kein Fadenkreuz im "nicht Zoom-Modus" (sonst wärs ja auch unfair weil das dann die überwaffe wär) Also malt man sich normalerweise nen Punkt auf den Monitor, an der Stelle an der normal die Mitte vom Fadenkreuz ist.
schdom14 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win XP
D7 Enterprise
BeitragVerfasst: Sa 17.01.04 14:13 
BungeeBug hat folgendes geschrieben:
HI,

kann ich dir sagen wieso er das will ... wenn man bei Egoshootern wie z.B.: Counter Strike eine Zoom-Waffe hat, bekommt man kein Fadenkreuz im "nicht Zoom-Modus" (sonst wärs ja auch unfair weil das dann die überwaffe wär) Also malt man sich normalerweise nen Punkt auf den Monitor, an der Stelle an der normal die Mitte vom Fadenkreuz ist.


Tja mag ja ne gute Idee sein aber leider Falsch, sowas brauch ich net,
ich spiele nämlich so gut wie nie


Aber würdet ihr mir trozdem weiterhelfen ??
Danke im vorraus
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 17.01.04 17:55 
Normalerweise poste ich ja keine kompletten Programme bzw Codes, aber ich hab den Code schonmal in der Delphi-Praxis gepostet, also tu ichs hier auch:
ausblenden volle Höhe 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:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
unit Main; 

interface 

uses 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, StdCtrls; 

type 
  TForm1 = class(TForm) 
    Button1: TButton; 
    procedure FormCreate(Sender: TObject); 
    procedure Button1Click(Sender: TObject); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
    bLoop: Boolean; 
    dwID: DWord; 
    ThreadHandle: THandle; 
  end

var 
  Form1: TForm1; 

implementation 

{$R *.dfm} 

function PaintThread(Param: PBoolean): Integer; 
var 
  iWidth, iHeight: Integer; 
  Pos: TPoint; 
  DC: HDC; 
  hOldBrush: hBrush; 
  Count: Integer; 
begin 
  Result := 0
  Count := 0
  while Param^ do 
  begin 
    Inc(Count); 
    iWidth  := GetSystemMetrics(SM_CXSCREEN); 
    iHeight := GetSystemMetrics(SM_CYSCREEN); 
    Pos := Point(iWidth div 2 - 4, iHeight div 2 - 4); 
    DC := GetWindowDC(GetDesktopWindow); 
    hOldBrush := SelectObject(DC, CreateSolidBrush(RGB(2502500))); 
    Ellipse(DC, Pos.X, Pos.Y, Pos.X + 8, Pos.Y + 8); 
    DeleteObject(SelectObject(DC, hOldBrush)); 
    ReleaseDC(GetDesktopWindow, DC); 
    Sleep(0); 
    if Count shr 4 = 0 then 
      Sleep(1); 
  end
end

procedure TForm1.FormCreate(Sender: TObject); 
begin 
  bLoop := True; 
  ThreadHandle := BeginThread(nil0, @PaintThread, @bLoop, 0, dwID); 
end

procedure TForm1.Button1Click(Sender: TObject); 
begin 
  InterlockedExchange(Integer(Pointer(@bLoop)^), 0); 
  WaitForSingleObject(ThreadHandle, INFINITE); 
  CloseHandle(ThreadHandle); 
  Close; 
end

end.

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
schdom14 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win XP
D7 Enterprise
BeitragVerfasst: Sa 17.01.04 21:18 
@ Motzi
Danke, der Code Funktioniert, genau das habe ich gesucht, aber ich
verstehe denn code net so ganz :roll:
Könntest du (oder jemand anders) mir denn code ma erklären ???
Weil wenn ich ihn net verstehe dann kann ich ja auch nix lernen :cry:


Thx für die Hilfe

EDIT: Hab versucht die RGB Werte zu ändern, wenn ich direkt zahlen
einsetze dann geht das, wenn ich aber versuche zb. "StrToInt(Edit1.Text)"
einzusetten geht es net mehr, warum ??
raven_22
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 95

Win XP pro
D7 Enterprise
BeitragVerfasst: Do 12.02.04 17:08 
ausblenden volle Höhe 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:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Button2: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure Edit2KeyPress(Sender: TObject; var Key: Char);
    procedure Edit3KeyPress(Sender: TObject; var Key: Char);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  bLoop: Boolean;  
  dwID: DWord;
  ThreadHandle: THandle;
  R,G,B:integer;
implementation

{$R *.dfm}

function PaintThread(Param: PBoolean): Integer;  
var  
  iWidth, iHeight: Integer;
  Pos: TPoint;  
  DC: HDC;  
  hOldBrush: hBrush;
  Count: Integer;  
begin  
  Result := 0;
  Count := 0;  
  while Param^ do  
  begin
    Inc(Count);  
    iWidth  := GetSystemMetrics(SM_CXSCREEN);
    iHeight := GetSystemMetrics(SM_CYSCREEN);
    Pos := Point(iWidth div 2 - 4, iHeight div 2 - 4);  
    DC := GetWindowDC(GetDesktopWindow);  
    hOldBrush := SelectObject(DC, CreateSolidBrush(RGB(R, G, B)));
    Ellipse(DC, Pos.X, Pos.Y, Pos.X + 8, Pos.Y + 8);
    DeleteObject(SelectObject(DC, hOldBrush));
    ReleaseDC(GetDesktopWindow, DC);
    Sleep(0);  
    if Count shr 4 = 0 then
      Sleep(1);  
  end;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text:=inttostr(0);
Edit2.Text:=inttostr(0);
Edit3.Text:=inttostr(0);

bLoop := True;
  ThreadHandle := BeginThread(nil0, @PaintThread, @bLoop, 0, dwID);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
InterlockedExchange(Integer(Pointer(@bLoop)^), 0);
  WaitForSingleObject(ThreadHandle, INFINITE);
  CloseHandle(ThreadHandle);
  Close;

end;


procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if NOT (Key in [#08'0'..'9']) then // lässt nur Zahlen und die Backspacetaste zu
    Key := #0;
end;

procedure TForm1.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
if NOT (Key in [#08'0'..'9']) then // lässt nur Zahlen und die Backspacetaste zu
    Key := #0;
end;

procedure TForm1.Edit3KeyPress(Sender: TObject; var Key: Char);
begin
if NOT (Key in [#08'0'..'9']) then // lässt nur Zahlen und die Backspacetaste zu
    Key := #0;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
R:=strtoint(edit1.Text);
G:=strtoint(edit2.Text);
B:=strtoint(edit3.Text);

if R < 0 then R:=0;
if G < 0 then G:=0;
if B < 0 then B:=0;
end;

end.



Mit diesem Code, funktioniert dass bei mir.
Ich habe das ganze nur um 3 EDIT´s erweitert und um einen Button.
Die EDIT´s akzeptieren nun nur Zahlen und die Backspacetaste.
Kann es sein, das deine EDIT´s keinen Wert enthalten, also leer sind ?
Dann bekommst du natürlich immer eine schöne Fehlermeldung. :wink:

Gruß raven 8)

_________________
---_-= raven_22 =-_---