Subversion Repositories aysalia

Rev

Rev 20 | Rev 26 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20 Rev 24
Line 1... Line 1...
1
program AyDos;
1
program AyDos;
2
 
2
 
3
// Aysalia DOS Launcher
3
// Aysalia DOS Launcher
4
// Revision 2018-12-06
4
// Revision 2018-12-07
5
// (C) 2018 Daniel Marschall, ViaThinkSoft
5
// (C) 2018 Daniel Marschall, ViaThinkSoft
6
 
6
 
7
// This launcher does launch DOSBox with the correct *.conf file,
7
// This launcher does launch DOSBox with the correct *.conf file,
8
// centers the window and changes the window title and icon at runtime.
8
// centers the window and changes the window title and icon at runtime.
9
 
9
 
Line 17... Line 17...
17
 
17
 
18
const
18
const
19
  DOSBOX_EXE = 'DOSBox.exe';
19
  DOSBOX_EXE = 'DOSBox.exe';
20
 
20
 
21
var
21
var
22
  hPsApiDll: cardinal;
22
  hPsApiDll: Cardinal = 0;
-
 
23
  hIcon: THandle = 0;
-
 
24
  bCeneredOnce: boolean = false;
23
 
25
 
24
(*
26
(*
25
function GetModuleFileNameEx(inProcess: THandle; inModule: THandle;
27
function GetModuleFileNameEx(inProcess: THandle; inModule: THandle;
26
      Filename: PChar; size: DWord): DWord; stdcall;
28
      Filename: PChar; size: DWord): DWord; stdcall;
27
      external 'psapi.dll' name 'GetModuleFileNameExA';
29
      external 'psapi.dll' name 'GetModuleFileNameExA';
Line 60... Line 62...
60
  end
62
  end
61
  else result := -2;
63
  else result := -2;
62
end;
64
end;
63
{$ENDIF}
65
{$ENDIF}
64
 
66
 
65
var
-
 
66
  hIcon: THandle = 0;
-
 
67
  bCeneredOnce: boolean = false;
-
 
68
 
-
 
69
procedure ChangeTitleAndIcon(hWnd: Thandle);
67
procedure ChangeTitleAndIcon(hWnd: Thandle);
70
var
68
var
71
  Title: array[0..255] of Char;
69
  Title: array[0..255] of Char;
72
const
70
const
73
  TargetWinWidth = 640;
71
  TargetWinWidth = 640;
Line 202... Line 200...
202
  try
200
  try
203
    hIcon := LoadIcon(hInstance, 'MainIcon');
201
    hIcon := LoadIcon(hInstance, 'MainIcon');
204
    ExitCode := Main;
202
    ExitCode := Main;
205
  finally
203
  finally
206
    FreeLibrary(hPsApiDll);
204
    FreeLibrary(hPsApiDll);
-
 
205
    hPsApiDll := 0;
207
  end;
206
  end;
208
end.
207
end.