Autor Beitrag
elron
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34

WIN XP
D5 Standard
BeitragVerfasst: Mi 26.10.05 15:38 
also, ich möchte folgendes compilieren, nur kommt da immer so eine fehlermeldung:

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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ShellAPI;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
  fIconData: TNOTIFYICONDATA;
  procedure TaskTrayWndProc (var Msg: TMessage); message cWM_MYTRAYICONCALLBACK;
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

const
  cWM_MYTRAYICONCALLBACK = WM_USER + 1000;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin  
  // NotifyIconData-Struktur mit Werten füllen
  with fIconData do  
    begin  
      cbSize := SizeOf (TNOTIFYICONDATA);  
      Wnd := Handle;  
      uID := 1;  
      uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP;
      hIcon := LoadIcon (0, IDI_INFORMATION);  
      szTip := 'Tooltip';
      uCallBackMessage := cWM_MYTRAYICONCALLBACK;
    end;  

 
  // Icon in die TNA hinzufügen  
  If not Shell_NotifyIcon (NIM_ADD, @fIconData) then  
    { Fehler! };  
end;


procedure TForm1.TaskTrayWndProc (var Msg: TMessage);  
begin  
  case Msg.LParam of  
    WM_LBUTTONDOWN:  
      MessageDlg ('Linke Maustaste gedrückt!', mtInformation, [mbOK], 0);
    WM_RBUTTONDOWN:  
      MessageDlg ('Rechte Maustaste gedrückt!', mtInformation, [mbOK], 0);  
  end;  
end



end.


ausblenden Quelltext
1:
2:
3:
[Fehler] Unit1.pas(13): Undefinierter Bezeichner: 'cWM_MYTRAYICONCALLBACK'
[Fehler] Unit1.pas(13): Ungültiger Botschaftsmethoden-Index
[Fehler] Unit1.pas(23): Bezeichner redefiniert: 'cWM_MYTRAYICONCALLBACK'

_________________
JAJA, ich weiß, ich bin ein Anfänger...
elron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34

WIN XP
D5 Standard
BeitragVerfasst: Mi 26.10.05 15:40 
sorry, hat sich erledigt, hatte die const falsch definiert...

_________________
JAJA, ich weiß, ich bin ein Anfänger...