Subversion Repositories spacemission

Compare Revisions

Regard whitespace Rev 73 → Rev 74

/GamMain.pas
1370,7 → 1370,7
 
procedure TMainForm.CheckUpdatesClick(Sender: TObject);
begin
CheckForUpdates('spacemission');
CheckForUpdates('spacemission', ProgramVersion);
end;
 
procedure TMainForm.BeendenClick(Sender: TObject);
/Global.pas
73,7 → 73,7
// Useful functions
function GetKnownFolderPath(const rfid: TGUID): string;
function KillTask(ExeFileName: string): Integer;
procedure CheckForUpdates(ViaThinkSoftProjectName: string);
procedure CheckForUpdates(ViaThinkSoftProjectName: string; AVersion: string);
 
implementation
 
136,16 → 136,16
result := extractfilepath(paramstr(0));
end;
 
// https://www.delphipraxis.net/post43515.html
function GetHTML(AUrl: string): string;
// https://www.delphipraxis.net/post43515.html , fixed , works for Delphi 12 Athens
function GetHTML(AUrl: string): RawByteString;
var
databuffer : array[0..4095] of char;
ResStr : string;
databuffer : array[0..4095] of ansichar; // SIC! ansichar!
ResStr : ansistring; // SIC! ansistring
hSession, hfile: hInternet;
dwindex,dwcodelen,dwread,dwNumber: cardinal;
dwcode : array[1..20] of char;
res : pchar;
Str : pchar;
Str : pansichar; // SIC! pansichar
begin
ResStr:='';
if (system.pos('http://',lowercase(AUrl))=0) and
199,12 → 199,12
if dwRead =0 then
break;
databuffer[dwread]:=#0;
Str := pchar(@databuffer);
Str := pansichar(@databuffer);
resStr := resStr + Str;
end;
end
else
ResStr := 'Status:'+res;
ResStr := 'Status:'+AnsiString(res);
if assigned(hfile) then
InternetCloseHandle(hfile);
end;
216,9 → 216,9
Result := resStr;
end;
 
procedure CheckForUpdates(ViaThinkSoftProjectName: string);
procedure CheckForUpdates(ViaThinkSoftProjectName: string; AVersion: string);
var
cont: string;
cont: RawByteString;
begin
cont := GetHTML('https://www.viathinksoft.de/update/?id='+ViaThinkSoftProjectName);
if copy(cont, 0, 7) = 'Status:' then
227,7 → 227,7
end
else
begin
if cont <> ProgramVersion then
if string(cont) <> AVersion then
begin
if Application.MessageBox('Eine neue Programmversion ist vorhanden. Möchten Sie diese jetzt herunterladen?', 'Information', MB_YESNO + MB_ICONASTERISK) = ID_YES then
shellexecute(application.handle, 'open', pchar('https://www.viathinksoft.de/update/?id=@'+ViaThinkSoftProjectName), '', '', sw_normal);
/LevMain.dfm
4,8 → 4,8
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'Leveleditor'
ClientHeight = 518
ClientWidth = 745
ClientHeight = 517
ClientWidth = 741
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
35,8 → 35,8
end
object StatusBar: TStatusBar
Left = 0
Top = 499
Width = 745
Top = 498
Width = 741
Height = 19
Panels = <>
SimplePanel = True
44,19 → 44,15
' Zeigen Sie mit dem Mauszeiger auf eine Einheit, um deren Eigens' +
'chaften anzuzeigen...'
OnMouseMove = DXDrawMouseMove
ExplicitTop = 498
ExplicitWidth = 741
end
object SidePanel: TPanel
Left = 636
Left = 632
Top = 0
Width = 109
Height = 499
Height = 498
Align = alRight
BevelOuter = bvNone
TabOrder = 2
ExplicitLeft = 632
ExplicitHeight = 498
object Bevel1: TBevel
Left = 4
Top = 200
/LevMain.pas
731,7 → 731,7
 
procedure TMainForm.AufUpdatesprfen1Click(Sender: TObject);
begin
CheckForUpdates('spacemission');
CheckForUpdates('spacemission', ProgramVersion);
end;
 
procedure TMainForm.NeuClick(Sender: TObject);