Autor Beitrag
Bethsoftfan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Di 25.12.07 17:02 
Hallo,

1.Frage
Wie kann man abfragen, welches Betriebssystem der Anwender hat, um jenachdem einen normalen Dialog(unter Vista) oder einen Vista dialog(Vista oder höher) zu öffnen?

2.Frage
Ach ja wo wir bei Designs sind, wie stellt man ein, wie die obere Leiste im Vista oder XP style sein soll?

Ok, das 2. hat sich erledigt, wird vom OS geändert, also auch wenn mit XP gemacht, wird es bei Vista im Vista style übertragen, wenn das nicht so ist, korrigiert mich bitte.

Ich konnte nichts in der Forensuche finden.


Fragen über Fragen.
Danke für eure Antworten

Bethsoftfan

PS: Ich bin neu hier, aber ich hatte Delphi 5 schon etwas über einem Jahr (oder sogar mehr als 2 :gruebel: ) und jetzt habe ich Delphi 2007 gekauft.


Moderiert von user profile iconChristian S.: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Di 25.12.2007 um 16:36


Zuletzt bearbeitet von Bethsoftfan am Mo 21.12.09 22:19, insgesamt 1-mal bearbeitet
Shorty
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 107

Win XP, Ubuntu 8.04
Delphi 7 Prof., Delphi 2005 Pers.
BeitragVerfasst: Mi 26.12.07 01:06 
Hallo!

Bei DSDT ist beschrieben, wie man das Betriebssystem ermittelt, wobei die Version nicht ganz vollständig ist, da Windows Vista fehlt. Ich habe den Link zu MSDN kurz überflogen, ich glaube dass Win32MajorVersion = 6 zu Vista gehört, kann mich jetzt aber auch irren.

MfG Shorty
Bethsoftfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Mi 26.12.07 01:24 
Ok,
danke, ich werde es ausprobieren!

warum compiliert er nicht? sry is schon zu spät!

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:
25:
26:
27:
28:
begin

result:='Unbekannt';
    case Win32Platform of
     If Win32MajorVersion=4 Then Begin

     case Win32MinorVersion of
  0 : result:='Windows 95';
  10: result:='Windows 98';
  90: result:='Windows Me';
     end;
     end;
     Case Win32MajorVersion of
         3:IF Win32MinorVersion=51 then
              result:='Windows NT 3.51';
         4:If Win32MinorVersion=0 then
             result:='Windows NT 4';
         5:Case Win32MinorVersion of
              0: result:='Windows 2000';
              1: result:='Windows XP';
              2: result:='Windows .NET Server';
              6: result:='Windows Vista';
           end;
     end;
  end;
   if Win32CSDVersion<>'' then
    result:=result+' '+Win32CSDVersion;
  end.
MagicAndre1981
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 26.12.07 02:04 
hiermit erkennst du Vista perfekt:

www.delphipraxis.net...indowserkennung.html
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Mi 26.12.07 12:42 
user profile iconBethsoftfan hat folgendes geschrieben:
Ok,
danke, ich werde es ausprobieren!

warum compiliert er nicht? sry is schon zu spät!

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:
25:
26:
27:
28:
begin

result:='Unbekannt';
    case Win32Platform of
     If Win32MajorVersion=4 Then Begin

     case Win32MinorVersion of
  0 : result:='Windows 95';
  10: result:='Windows 98';
  90: result:='Windows Me';
     end;
     end;
     Case Win32MajorVersion of
         3:IF Win32MinorVersion=51 then
              result:='Windows NT 3.51';
         4:If Win32MinorVersion=0 then
             result:='Windows NT 4';
         5:Case Win32MinorVersion of
              0: result:='Windows 2000';
              1: result:='Windows XP';
              2: result:='Windows .NET Server';
              6: result:='Windows Vista';
           end;
     end;
  end;
   if Win32CSDVersion<>'' then
    result:=result+' '+Win32CSDVersion;
  end.

Wie wärs, wenn du uns die Fehlermeldung mitteilen würdest? Die Glaskugel ist leider gerade in Reparatur.

Der Quelltext ist sehr seltsam.
ausblenden Delphi-Quelltext
1:
2:
case Win32Platform of
     If Win32MajorVersion=4 Then Begin

Was soll das denn?

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
Bethsoftfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Mi 26.12.07 15:53 
user profile iconTimosch hat folgendes geschrieben:
user profile iconBethsoftfan hat folgendes geschrieben:
Ok,
danke, ich werde es ausprobieren!

warum compiliert er nicht? sry is schon zu spät!

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:
25:
26:
27:
28:
begin

result:='Unbekannt';
    case Win32Platform of
     If Win32MajorVersion=4 Then Begin

     case Win32MinorVersion of
  0 : result:='Windows 95';
  10: result:='Windows 98';
  90: result:='Windows Me';
     end;
     end;
     Case Win32MajorVersion of
         3:IF Win32MinorVersion=51 then
              result:='Windows NT 3.51';
         4:If Win32MinorVersion=0 then
             result:='Windows NT 4';
         5:Case Win32MinorVersion of
              0: result:='Windows 2000';
              1: result:='Windows XP';
              2: result:='Windows .NET Server';
              6: result:='Windows Vista';
           end;
     end;
  end;
   if Win32CSDVersion<>'' then
    result:=result+' '+Win32CSDVersion;
  end.

Wie wärs, wenn du uns die Fehlermeldung mitteilen würdest? Die Glaskugel ist leider gerade in Reparatur.

Der Quelltext ist sehr seltsam.
ausblenden Delphi-Quelltext
1:
2:
case Win32Platform of
     If Win32MajorVersion=4 Then Begin

Was soll das denn?


Danke erstmal an alle!

Werde mal den Code alleine(ohne abzukopieren! ;) ) schreiben!

sry, hab den Code um zehn vor eins geschrieben bzw. das meiste abkopiert!
Hmf is auch witzig, wenn auf eine Case of Anweisung eine If-Then-Else Abfrage folgt :)

Nagut einmal ausgeschlafen, dann wird der Code besser!

Ach die Win32MajorVersion, ect., muss ich die als String in var deklarieren oder als Integer? :?
Und ja, die Variablen hab ich am Anfang deklariert, als Strings!

Bis dann!
Bethsoftfan

PS: habe den letzten Beitrag um ca. 0:55 editiert, warum zeigt der das nicht an?
Vieleicht weil ich nure einen Code hinzugefügt habe? :?!?:
Nein daran liegt es nicht, wird jetzt auch nicht angezeigt, mal an den Einstellungen rumfummeln!
Bethsoftfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Mi 26.12.07 16:56 
Sry für Doppelpost, aber dieser passt nicht mehr vom Thema zum anderen!

Also Erstmal der Code!
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:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, Buttons, Menus, MPlayer, Mask, Spin;

type
  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Splitter1: TSplitter;
    MainMenu1: TMainMenu;
    About1: TMenuItem;
    Programming1: TMenuItem;
    N1: TMenuItem;
    ThanksTo1: TMenuItem;
    About2: TMenuItem;
    Editor1: TMenuItem;
    Editor2: TMenuItem;
    N2: TMenuItem;
    Toutorial1: TMenuItem;
    BitBtn2: TBitBtn;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    OpenDialog1: TOpenDialog;
    FileOpenDialog1: TFileOpenDialog;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Programming1Click(Sender: TObject);


  private
    { Private-Deklarationen }
  public
    f : textfile;
    { Public-Deklarationen }
  end;

var
result : string;
Win32Platform, Win32MayorVersion, Win32MinorVersion, Win32CSDVersion : integer;


  Punkte : integer;
  Form1: TForm1 ;
  MyCheckBox : Array[1..10of TCheckBox;
  mi   : Array[1..10of integer;
  I1   : integer;
  ZFC  : integer;
  s1   : String ;

implementation

uses Unit2;
{$R *.DFM}

procedure TForm1.BitBtn1Click(Sender: TObject);


begin



 for I1:=1 to ZFC do if MyCheckBox[I1].checked then Punkte:=punkte+mi[I1];
  label5.Caption:=IntToStr(Punkte);

for I1:=1 to ZFC do
       MyCheckBox[I1].Free;

if eof(f) then begin closeFile(f); BitBtn1.Visible:=false; exit; end;

 readLn(f,zfc,mi[1],mi[2],mi[3],mi[4],mi[5],mi[6],mi[7],mi[8],mi[9],mi[10]);
 ReadLn(f,s1);
 Label4.Caption:= s1;

 for I1:=1 to ZFC do
begin
 MyCheckBox[I1] := TCheckBox.Create(Form1);

  with MyCheckBox[I1] do
   begin
    Left    := 24;
    Top     := 120+(20*I1);
    Parent  := Form1;
    Visible := true;
    width   := 553;

    ReadLn(f,s1);
    MyCheckBox[I1].Caption := s1;

   end;


end;
end;



procedure TForm1.FormCreate(Sender: TObject);
begin
  result:='unbekannt';

  case Win32Platform of

  1Case Win32MajorVersion of
         3:IF Win32MinorVersion=51 then
              result:='Windows NT 3.51';
         4:If Win32MinorVersion=0 then
             result:='Windows NT 4';
         5:Case Win32MinorVersion of
              0: result:='Windows 2000';
              1: result:='Windows XP';
              2: result:='Windows .NET Server';
         6:If Win32MinorVersion = 6 then
           result :='Windows Vista';



  if result = 'Windows XP''Windows 2000',
  'Windows NT 4''Windows NT 3.51'
  then
  OpenDialog1.Execute;
   Assignfile(f, OpenDialog1.Filename);
   Reset(f);
   punkte:=0;
  else
  openfiledialog1.execute;
    Assignfile (f, FileOpenDialog1.Filename);
    Reset (f);
   punkte := 0;
end;


procedure TForm1.Programming1Click(Sender: TObject);
begin
Form2.Visible := true;
end;
end.


Fehler:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
[DCC Warnung] Unit1.pas(31): W1002 Symbol 'TFileOpenDialog' ist plattformspezifisch             }
[DCC Warnung] Unit1.pas(69): W1019 FOR-Schleifenvariable muss eine einfache lokale Variable sein}
[DCC Warnung] Unit1.pas(72): W1019 FOR-Schleifenvariable muss eine einfache lokale Variable sein}nicht relevant 
[DCC Warnung] Unit1.pas(81): W1019 FOR-Schleifenvariable muss eine einfache lokale Variable sein}
[DCC Fehler] Unit1.pas(124): E2029 'THEN' erwartet, aber ',' gefunden
[DCC Fehler] Unit1.pas(142): E2026 Konstantenausdruck erwartet
[DCC Fehler] Unit1.pas(143): E2018 Record, Objekt oder Klassentyp erforderlich
[DCC Fehler] Unit1.pas(148): E2029 'END' erwartet, aber Dateiende gefunden
[DCC Fehler] Unit1.pas(34): E2065 Ungenügende Forward- oder External-Deklaration: 'TForm1.Programming1Click'
[DCC Fehler] Project1.dpr(6): F2063 Verwendete Unit 'Unit1.pas' kann nicht compiliert werden


ok hoffe auf Hilfe!
Bethsoftfan
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 26.12.07 17:03 
Hallo!

Ich denke, Du solltest Dich erst einmal mit den grundlegenden Regeln der Delphi-Syntax auseinander setzen.

z.B. hier: crashkurs.christian-stelzmann.de

Diese if-Anweisung:
ausblenden Delphi-Quelltext
1:
2:
3:
if result = 'Windows XP''Windows 2000',
  'Windows NT 4''Windows NT 3.51'
  then

ist schon extrem kreativ ;-)

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Bethsoftfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Mi 26.12.07 17:25 
Hm sry da hab ich aus faulheit dochnoch abkopiert,

hätte es ja mit
ausblenden Delphi-Quelltext
1:
2:
IF result <> 'Windows Vista'
THEN [..]

lösen können, is mir dann aufgefallen! :oops:

aber nebenbei, an welcher stelle stehen Aufzählungen im Crashkurs?, weil mit AND, OR oder NOT, ect. kann man es ja nicht lösen, weil das nur bei Bool'schen Werten geht!

Nagut ich werde mir mal Zeit nehmen und mal nen bissl dazu lernen! :wink:

Ok aber was ist mit den anderen Fehlern ala
[DCC Fehler] Unit1.pas(142): E2026 Konstantenausdruck erwartet oder
[DCC Fehler] Unit1.pas(143): E2018 Record, Objekt oder Klassentyp erforderlich
usw. :?:

danke für alles!

Bethsoftfan!

Eigentlich müsste ich nochnen Doppelpost machen aber egal diesmal reicht edit!

Neuer Code :
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:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, Buttons, Menus, MPlayer, Mask, Spin;

type
  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Splitter1: TSplitter;
    MainMenu1: TMainMenu;
    About1: TMenuItem;
    Programming1: TMenuItem;
    N1: TMenuItem;
    ThanksTo1: TMenuItem;
    About2: TMenuItem;
    Editor1: TMenuItem;
    Editor2: TMenuItem;
    N2: TMenuItem;
    Toutorial1: TMenuItem;
    BitBtn2: TBitBtn;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    OpenDialog1: TOpenDialog;
    FileOpenDialog1: TFileOpenDialog;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Programming1Click(Sender: TObject);


  private
    { Private-Deklarationen }
  public
    f : textfile;
    { Public-Deklarationen }
  end;

var
result : string;
Win32Platform, Win32MayorVersion, Win32MinorVersion, Win32CSDVersion : integer;


  Punkte : integer;
  Form1: TForm1 ;
  MyCheckBox : Array[1..10of TCheckBox;
  mi   : Array[1..10of integer;
  I1   : integer;
  ZFC  : integer;
  s1   : String ;

implementation

uses Unit2;
{$R *.DFM}

procedure TForm1.BitBtn1Click(Sender: TObject);


begin



 for I1:=1 to ZFC do if MyCheckBox[I1].checked then Punkte:=punkte+mi[I1];
  label5.Caption:=IntToStr(Punkte);

for I1:=1 to ZFC do
       MyCheckBox[I1].Free;

if eof(f) then begin closeFile(f); BitBtn1.Visible:=false; exit; end;

 readLn(f,zfc,mi[1],mi[2],mi[3],mi[4],mi[5],mi[6],mi[7],mi[8],mi[9],mi[10]);
 ReadLn(f,s1);
 Label4.Caption:= s1;

 for I1:=1 to ZFC do
begin
 MyCheckBox[I1] := TCheckBox.Create(Form1);

  with MyCheckBox[I1] do
   begin
    Left    := 24;
    Top     := 120+(20*I1);
    Parent  := Form1;
    Visible := true;
    width   := 553;

    ReadLn(f,s1);
    MyCheckBox[I1].Caption := s1;

   end;


end;
end;



procedure TForm1.FormCreate(Sender: TObject);
begin
  result:='unbekannt';

  case Win32Platform of

  1Case Win32MajorVersion of
         3:IF Win32MinorVersion=51 then
              result:='Windows NT 3.51';
         4:If Win32MinorVersion=0 then
             result:='Windows NT 4';
         5:Case Win32MinorVersion of
              0: result:='Windows 2000';
              1: result:='Windows XP';
              2: result:='Windows .NET Server';
         6:If Win32MinorVersion = 6 then
           result :='Windows Vista';



  if result <> 'Windows Vista'
  then
  OpenDialog1.Execute;
   Assignfile(f, OpenDialog1.Filename);
   Reset(f);
   punkte:=0;
  else
  openfiledialog1.execute;
    Assignfile (f, FileOpenDialog1.Filename);
    Reset (f);
    punkte := 0;
end;


procedure TForm1.Programming1Click(Sender: TObject);
begin
Form2.Visible := true;
end;
end.


Fehler :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
[DCC Fehler] Unit1.pas(126): E2026 Konstantenausdruck erwartet
[DCC Fehler] Unit1.pas(127): E2026 Konstantenausdruck erwartet
[DCC Fehler] Unit1.pas(132): E2026 Konstantenausdruck erwartet
[DCC Fehler] Unit1.pas(138): E2029 Ausdruck erwartet, aber 'PROCEDURE' gefunden


Diesmal hab ich die Warnungen + das nicht compiliert werden konnte wegen der Übersicht herausgelassen!
Ok nicht mehr soviele Fehler!

Bethsoftfan!

PS: [ironie] :mahn: hab auch was zumelden! :mahn:
Undzwa hättest du in deinem Tutorial bei dem minirechner lieber zahl1 := StrToFloat(edit1.text) und dazu gehörge zahl1 zu einer Real deklariert, aus dem Grund, wenn welche den ersten Teil übersprungen haben(der mit der Variablenkunde) und in den Rechner Fliesskommazahlen eingetippt haben sich wundern, dass es zu einem Laufzeitfehler kommt :wink:
[/ironie]


Und wieder einen Doppelpost erspart!

Es funktioniert!

Ok hier ist der Code!

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:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, Buttons, Menus, MPlayer, Mask, Spin;

type
  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Splitter1: TSplitter;
    MainMenu1: TMainMenu;
    About1: TMenuItem;
    Programming1: TMenuItem;
    N1: TMenuItem;
    ThanksTo1: TMenuItem;
    About2: TMenuItem;
    Editor1: TMenuItem;
    Editor2: TMenuItem;
    N2: TMenuItem;
    Toutorial1: TMenuItem;
    BitBtn2: TBitBtn;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    OpenDialog1: TOpenDialog;
    FileOpenDialog1: TFileOpenDialog;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Programming1Click(Sender: TObject);


  private
    { Private-Deklarationen }
  public
    f : textfile;
    { Public-Deklarationen }
  end;

var
result : string;
Win32Platform, Win32MayorVersion, Win32MinorVersion, Win32CSDVersion : integer;


  Punkte : integer;
  Form1: TForm1 ;
  MyCheckBox : Array[1..10of TCheckBox;
  mi   : Array[1..10of integer;
  I1   : integer;
  ZFC  : integer;
  s1   : String ;

implementation

uses Unit2;
{$R *.DFM}

procedure TForm1.BitBtn1Click(Sender: TObject);

begin
 for I1:=1 to ZFC do if MyCheckBox[I1].checked then Punkte:=punkte+mi[I1];
  label5.Caption:=IntToStr(Punkte);

for I1:=1 to ZFC do
       MyCheckBox[I1].Free;

if eof(f) then begin closeFile(f); BitBtn1.Visible:=false; exit; end;

 readLn(f,zfc,mi[1],mi[2],mi[3],mi[4],mi[5],mi[6],mi[7],mi[8],mi[9],mi[10]);
 ReadLn(f,s1);
 Label4.Caption:= s1;

 for I1:=1 to ZFC do
begin
 MyCheckBox[I1] := TCheckBox.Create(Form1);

  with MyCheckBox[I1] do
   begin
    Left    := 24;
    Top     := 120+(20*I1);
    Parent  := Form1;
    Visible := true;
    width   := 553;

    ReadLn(f,s1);
    MyCheckBox[I1].Caption := s1;

   end;

end;
end;



procedure TForm1.FormCreate(Sender: TObject);
begin
  result:='unbekannt';

  case Win32Platform of

         1Case Win32MajorVersion of
         3IF Win32MinorVersion=51 then
              result:='Windows NT 3.51';
         4If Win32MinorVersion=0 then
             result:='Windows NT 4';
         5Case Win32MinorVersion of
              0: result:='Windows 2000';
              1: result:='Windows XP';
              2: result:='Windows .NET Server';
         6If Win32MinorVersion = 6 then
            result :='Windows Vista';

  end;
  end;
  end;

  if result <> 'Windows Vista'
  then
   if OpenDialog1.Execute then           
    begin
    AssignFile(F, OpenDialog1.FileName); 
     Reset(F);
      punkte:=0;
    end
  else
   if FileOpenDialog1.Execute then
   begin
    AssignFile (f, FileOpenDialog1.Filename);
     Reset (f);
      punkte := 0;
  end;
end;


procedure TForm1.Programming1Click(Sender: TObject);
begin
Form2.Visible := true;
end;
end.


So jetzt müsste ich wissen, ober er bei Vista auch FileOpenDialog1 öffnet, und nicht OpenDialog1!

So bin jetzt mal richtig froh, und die Fragen sind beantwortet! :D
Bethsoftfan

PS: danke an alle, die mir geholfen haben! :beer: