Autor Beitrag
cybersoul
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43



BeitragVerfasst: Mo 13.06.05 16:41 
Hi.

Ich wollte folgende Hilfsprocedur schreiben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure FillNotifyIconData(
  Wnd:HWND; CallbackMsg:cardinal;
  Icon:HIcon;
  Text:string;
  var Data:TNotifyIconData);
begin
  Fillchar(Data,Sizeof(Data),0);
  Data.cbSize := Sizeof(Data);
  Data.Wnd    := Wnd;
  Data.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
  Data.uCallbackMessage := CallbackMsg;
  Data.hIcon := Icon;

  Data.szTip := Text;  // szTip:array [0..63] of Char
end;


Data.szTip ist allerdings kein String.
Wie kann ich das jetzt umwandeln?

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
der_zaehe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 317

WinXP SP2
D6 Pers, D2005 Prof, VS2005
BeitragVerfasst: Mo 13.06.05 17:03 
na, machs doch einfach so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var
  ...
  i : Integer;
begin
  ...
  for i := 0 to 63 do
    Data.szTip[i] := Text[i];
end;

_________________
[inspirationslos]
cybersoul Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43



BeitragVerfasst: Mo 13.06.05 19:19 
Oh mann! Das ist mir jetzt aber peinlich!
Noch einfacher gehts ja gar nicht!

Dein Beispiel hat nur einen kleinen Fehler.
So funktioniert er :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var  
  ...  
  i : Integer;  
begin  
  ...  
  for i := 0 to 63 do  
    Data.szTip[i] := Text[i+1];  
end;


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
der_zaehe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 317

WinXP SP2
D6 Pers, D2005 Prof, VS2005
BeitragVerfasst: Mo 13.06.05 19:36 
verdammt.
immer der selbe fehler! :autsch:
schon 1000 mal gemacht und immer noch nichts draus gelernt.

_________________
[inspirationslos]