Autor Beitrag
Segaja
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Di 12.04.05 12:52 
Moderiert von user profile iconTino: Abgetrennt aus: Fremden Task beenden

jetzt habe ich nur noch ein kleines schönheitsproblem. und zwar:

wenn ich das programm ausführe, beendet es den task, wie es auch vorgesehen ist, aber das symbol von diesem task steht immernoch im systray, bis ich einmal mit der maus darüber gehe.

gibt es einen refreshbefehl für den systray, und wenn ja, wie heißt er?
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Di 12.04.05 12:58 
ausblenden Delphi-Quelltext
1:
SendMessage(FindWindow('Progman', 'Program Manager'),WM_COMMAND,106597,0);					


Damit müsste es gehen.

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Di 12.04.05 13:19 
user profile iconHansi@OMG hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
SendMessage(FindWindow('Progman', 'Program Manager'),WM_COMMAND,106597,0);					


Damit müsste es gehen.


soll da villeicht Program stehen?


jedenfalls geht es so nicht.

Moderiert von user profile iconraziel: Color- durch Highlight-Tags ersetzt.
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Di 12.04.05 13:42 
Nein, da soll Progman stehen, dass ist normalerweise das Handle des Systraymanagers von Windows.

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Di 12.04.05 20:36 
aber damit geht es leider nicht.
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Di 12.04.05 20:51 
Ein Handle von der TNA (TrayNotifictaionArea) bekommt man so:
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:
var shellt, tray, sysp, toolb: hWnd;

// ...

shellt := FindWindow('','Shell_TrayWnd');
if shellt <> 0 then
begin
  tray := FindWindowEx('','shellt','','TrayNotifyWnd');
  if tray <> 0 then
  begin
    // evt. hier schon ein Refresh senden
    // SendMessage(tray,WM_COMMAND,106597,0);
    sysp := FindWindowEx('',tray,'','SysPager');
    if sysp <> 0 then
    begin
      toolb := FindWindowEx('',sysp,'Infobereich','ToolbarWindow32');
      if toolb <> 0 then
      begin
        // hier Refresh einfügen!
        SendMessage(toolb,WM_COMMAND,106597,0);
      end else ShowMEssage('ToolbarWindow32 nicht gefunden');
    end else ShowMessage('SysPager nicht gefunden'); 
  end else ShowMessage('TrayNotifyWnd nicht gefunden');
end else ShowMessage('Shell_TrayWnd nicht gefunden');


Kann den Code jetzt leider nicht testen. Hoffe, er bringt euch was.

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Di 12.04.05 21:07 
wow, so lang?

muss das so übernommen werden? und was steht bei // ...???
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Di 12.04.05 21:10 
Tut mir leid, aber Microsoft hat alle diese Komponenten übereinandergelegt, da wird es etwas länger.

//... steht für
ausblenden Delphi-Quelltext
1:
2:
3:
begin
  // hier sind deine eigenen (oder die Kill-) Anweisungen
  // hier kommt mein Code

War nur zu faul ein begin zu tippen :)

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Di 12.04.05 21:18 
bin heute etwas begriffsstutzig. das is mein quelltext:

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

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function KillTask(ExeFileName: string): Integer;
const
  PROCESS_TERMINATE = $0001;
var
  ContinueLoop: BOOL;
  FSnapshotHandle: THandle;
  FProcessEntry32: TProcessEntry32;
begin
  Result := 0;
  FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
  ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

  while Integer(ContinueLoop) <> 0 do
  begin
    if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
      UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
      UpperCase(ExeFileName))) then
      Result := Integer(TerminateProcess(
                        OpenProcess(PROCESS_TERMINATE,
                                    BOOL(0),
                                    FProcessEntry32.th32ProcessID),
                                    0));
     ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
  end;
  CloseHandle(FSnapshotHandle);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
KillTask('Kill 1');
KillTask('Kill 2');
Application.Terminate;
end;

end.


da soll jetzt noch ein refresh für den systray neben der uhr rein, der vor dem Application.Terminate; ausgeführt wird.
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Di 12.04.05 21:22 
Probier mal aus, ob es jetzt klappt.

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

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    procedure RefreshTNA;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function KillTask(ExeFileName: string): Integer;
const
  PROCESS_TERMINATE = $0001;
var
  ContinueLoop: BOOL;
  FSnapshotHandle: THandle;
  FProcessEntry32: TProcessEntry32;
begin
  Result := 0;
  FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
  ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

  while Integer(ContinueLoop) <> 0 do
  begin
    if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
      UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
      UpperCase(ExeFileName))) then
      Result := Integer(TerminateProcess(
                        OpenProcess(PROCESS_TERMINATE,
                                    BOOL(0),
                                    FProcessEntry32.th32ProcessID),
                                    0));
     ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
  end;
  CloseHandle(FSnapshotHandle);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
KillTask('Kill 1');
KillTask('Kill 2');
RefreshTNA;
Application.Terminate;
end;

procedure TForm1.RefreshTNA;
var shellt, tray, sysp, toolb: hWnd;
begin
  shellt := FindWindow('','Shell_TrayWnd');   
  if shellt <> 0 then   
  begin   
    tray := FindWindowEx('','shellt','','TrayNotifyWnd');   
    if tray <> 0 then   
    begin   
      // evt. hier schon ein Refresh senden   
      // SendMessage(tray,WM_COMMAND,106597,0);   
      sysp := FindWindowEx('',tray,'','SysPager');   
      if sysp <> 0 then   
      begin   
        toolb := FindWindowEx('',sysp,'Infobereich','ToolbarWindow32');   
        if toolb <> 0 then   
        begin   
          // hier Refresh einfügen!   
          SendMessage(toolb,WM_COMMAND,106597,0);   
        end else ShowMEssage('ToolbarWindow32 nicht gefunden');   
      end else ShowMessage('SysPager nicht gefunden');    
    end else ShowMessage('TrayNotifyWnd nicht gefunden');   
  end else ShowMessage('Shell_TrayWnd nicht gefunden');
end;

end.

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Mi 13.04.05 12:44 
das ist mein programm:

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

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    procedure RefreshTNA;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function KillTask(ExeFileName: string): Integer;
const
  PROCESS_TERMINATE = $0001;
var
  ContinueLoop: BOOL;
  FSnapshotHandle: THandle;
  FProcessEntry32: TProcessEntry32;
begin
  Result := 0;
  FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
  ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

  while Integer(ContinueLoop) <> 0 do
  begin
    if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
      UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
      UpperCase(ExeFileName))) then
      Result := Integer(TerminateProcess(
                        OpenProcess(PROCESS_TERMINATE,
                                    BOOL(0),
                                    FProcessEntry32.th32ProcessID),
                                    0));
     ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
  end;
  CloseHandle(FSnapshotHandle);
end;

procedure TForm1.RefreshTNA;
var shellt, tray, sysp, toolb: hWnd;
begin
  shellt := FindWindow('','Shell_TrayWnd');
  if shellt <> 0 then
  begin
    tray := FindWindowEx('','shellt','','TrayNotifyWnd');
    if tray <> 0 then
    begin
      // evt. hier schon ein Refresh senden
      // SendMessage(tray,WM_COMMAND,106597,0);

      sysp := FindWindowEx('',tray,'','SysPager');
      if sysp <> 0 then
      begin
        toolb := FindWindowEx('',sysp,'Infobereich','ToolbarWindow32');   
        if toolb <> 0 then   
        begin   
          // hier Refresh einfügen!   
          SendMessage(toolb,WM_COMMAND,106597,0);   
        end else ShowMEssage('ToolbarWindow32 nicht gefunden');
      end else ShowMessage('SysPager nicht gefunden');    
    end else ShowMessage('TrayNotifyWnd nicht gefunden');   
  end else ShowMessage('Shell_TrayWnd nicht gefunden');
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
KillTask('Kill 1');
KillTask('Kill 2');
RefreshTNA;
Application.Terminate;
end;

end.


und das sind die fehlermeldungen:

ausblenden Quelltext
1:
2:
3:
4:
[Error] Unit1.pas(60): Incompatible types: 'HWND' and 'String'
[Error] Unit1.pas(65): Incompatible types: 'HWND' and 'String'
[Error] Unit1.pas(68): Incompatible types: 'HWND' and 'String'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'


// evt. hier schon ein Refresh senden
// SendMessage(tray,WM_COMMAND,106597,0);


muss ich da was ändern?
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 13.04.05 13:01 
user profile iconSegaja hat folgendes geschrieben:

und das sind die fehlermeldungen:

ausblenden Quelltext
1:
2:
3:
4:
[Error] Unit1.pas(60): Incompatible types: 'HWND' and 'String'
[Error] Unit1.pas(65): Incompatible types: 'HWND' and 'String'
[Error] Unit1.pas(68): Incompatible types: 'HWND' and 'String'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

Schau dir doch mal die Parameter an die dort übergeben werden müssen. Du kannst nicht einfach überall ein String übergeben. ;-)
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Mi 13.04.05 18:41 
user profile iconTino hat folgendes geschrieben:
user profile iconSegaja hat folgendes geschrieben:

und das sind die fehlermeldungen:

ausblenden Quelltext
1:
2:
3:
4:
[Error] Unit1.pas(60): Incompatible types: 'HWND' and 'String'
[Error] Unit1.pas(65): Incompatible types: 'HWND' and 'String'
[Error] Unit1.pas(68): Incompatible types: 'HWND' and 'String'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

Schau dir doch mal die Parameter an die dort übergeben werden müssen. Du kannst nicht einfach überall ein String übergeben. ;-)


das verstehe ich nicht
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Mi 13.04.05 19:47 
Sorry, war mein Fehler. Jetzt müsste es gehen.

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

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    procedure RefreshTNA;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function KillTask(ExeFileName: string): Integer;
const
  PROCESS_TERMINATE = $0001;
var
  ContinueLoop: BOOL;
  FSnapshotHandle: THandle;
  FProcessEntry32: TProcessEntry32;
begin
  Result := 0;
  FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
  ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

  while Integer(ContinueLoop) <> 0 do
  begin
    if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
      UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
      UpperCase(ExeFileName))) then
      Result := Integer(TerminateProcess(
                        OpenProcess(PROCESS_TERMINATE,
                                    BOOL(0),
                                    FProcessEntry32.th32ProcessID),
                                    0));
     ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
  end;
  CloseHandle(FSnapshotHandle);
end;

procedure TForm1.RefreshTNA;
var shellt, tray, sysp, toolb: hWnd;
begin
  shellt := FindWindow('','Shell_TrayWnd');
  if shellt <> 0 then
  begin
    tray := FindWindowEx(0,'shellt','','TrayNotifyWnd');
    if tray <> 0 then
    begin
      // evt. hier schon ein Refresh senden
      // SendMessage(tray,WM_COMMAND,106597,0);
      sysp := FindWindowEx(0,tray,'','SysPager');
      if sysp <> 0 then
      begin
        toolb := FindWindowEx(0,sysp,'Infobereich','ToolbarWindow32');   
        if toolb <> 0 then   
        begin   
          // hier Refresh einfügen!   
          SendMessage(toolb,WM_COMMAND,106597,0);   
        end else ShowMEssage('ToolbarWindow32 nicht gefunden');
      end else ShowMessage('SysPager nicht gefunden');    
    end else ShowMessage('TrayNotifyWnd nicht gefunden');   
  end else ShowMessage('Shell_TrayWnd nicht gefunden');
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
KillTask('Kill 1');
KillTask('Kill 2');
RefreshTNA;
Application.Terminate;
end;

end.

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Do 14.04.05 09:14 
fast. das is mein programm:

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

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    procedure RefreshTNA;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function KillTask(ExeFileName: string): Integer;
const
  PROCESS_TERMINATE = $0001;
var
  ContinueLoop: BOOL;
  FSnapshotHandle: THandle;
  FProcessEntry32: TProcessEntry32;
begin
  Result := 0;
  FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
  ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

  while Integer(ContinueLoop) <> 0 do
  begin
    if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
      UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
      UpperCase(ExeFileName))) then
      Result := Integer(TerminateProcess(
                        OpenProcess(PROCESS_TERMINATE,
                                    BOOL(0),
                                    FProcessEntry32.th32ProcessID),
                                    0));
     ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
  end;
  CloseHandle(FSnapshotHandle);
end;

procedure TForm1.RefreshTNA;
var shellt, tray, sysp, toolb: hWnd;
begin
  shellt := FindWindow('','Shell_TrayWnd');
  if shellt <> 0 then
  begin
    tray := FindWindowEx(0,'shellt','','TrayNotifyWnd');
    if tray <> 0 then
    begin
      // evt. hier schon ein Refresh senden
      // SendMessage(tray,WM_COMMAND,106597,0);
      sysp := FindWindowEx(0,tray,'','SysPager');
      if sysp <> 0 then
      begin
        toolb := FindWindowEx(0,sysp,'Infobereich','ToolbarWindow32');   
        if toolb <> 0 then   
        begin
          // hier Refresh einfügen!   
          SendMessage(toolb,WM_COMMAND,106597,0);   
        end else ShowMEssage('ToolbarWindow32 nicht gefunden');
      end else ShowMessage('SysPager nicht gefunden');    
    end else ShowMessage('TrayNotifyWnd nicht gefunden');   
  end else ShowMessage('Shell_TrayWnd nicht gefunden');
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
KillTask('Kill 1');
KillTask('Kill 2');
RefreshTNA;
Application.Terminate;
end;

end.



und das sind die fehlermeldungen (eigentlich ist es nur eine):

ausblenden Quelltext
1:
2:
[Error] Unit1.pas(60): Incompatible types: 'HWND' and 'String'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 14.04.05 09:21 
Dann schau dir doch mal die Zeile 60 genauer an. Wo könnte denn da wohl der Fehler liegen? ;-)


Zuletzt bearbeitet von Tino am Do 14.04.05 09:25, insgesamt 2-mal bearbeitet
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Do 14.04.05 09:24 
sorry, ich komme nicht auf den fehler.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 14.04.05 09:26 
Die Funktion FindWindowsEx ist wie folgt definiert:
ausblenden Delphi-Quelltext
1:
function FindWindowEx(Parent, Child: HWND; ClassName, WindowName: PChar): HWND;					

Wenn Du diese Funktion aufrufst dann musst Du bei der Parameterübergabe auch die richtigen Typen angeben.

Schau dir auch mal an wo genau der Cursor steht (Spalte) wenn du auf die Fehlermeldung doppelt drauf klickst.
Segaja Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP
D7 Enterprise
BeitragVerfasst: Do 14.04.05 09:52 
wenn ich doppelt auf die fehlermeldung klicke, wird diese zeile markiert:

ausblenden Delphi-Quelltext
1:
tray := FindWindowEx(0,'shellt','','TrayNotifyWnd');					


un der cursor steht hinter 'shellt',
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 14.04.05 09:58 
Ich sag´s dir gern noch mal: Schau dir doch erst mal die Grundlagen an, bevor du versuchst, fremde Programme zu kicken. Dann wüsstest du den Unterschied zwischen einem String und einem HWND. :roll: