Changeset 15 for trunk/Start.pas


Ignore:
Timestamp:
Jan 7, 2017, 10:16:37 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Top left position of main window.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r14 r15  
    182182procedure TStartDlg.FormCreate(Sender: TObject);
    183183var
    184   x, y, i, ResolutionX, ResolutionY, ResolutionBPP, ResolutionFreq,
    185     ScreenMode: integer;
     184  x, y, i, ResolutionX, ResolutionY, ResolutionBPP, ResolutionFreq: Integer;
     185  ScreenMode: Integer;
    186186  DefaultAI, s: string;
    187187  r0, r1: HRgn;
    188188  Reg: TRegistry;
    189   FirstStart: boolean;
     189  FirstStart: Boolean;
     190  Location: TPoint;
    190191begin
    191192  Reg := TRegistry.Create;
     
    237238  begin
    238239    Reg.OpenKey('SOFTWARE\cevo\RegVer9', false);
    239     try
     240    if Reg.ValueExists('ScreenMode') then
    240241      ScreenMode := Reg.ReadInteger('ScreenMode');
    241       FullScreen := ScreenMode > 0;
    242       if Reg.ValueExists('ResolutionX') then
    243         ResolutionX := Reg.ReadInteger('ResolutionX');
    244       if Reg.ValueExists('ResolutionY') then
    245         ResolutionY := Reg.ReadInteger('ResolutionY');
    246       if Reg.ValueExists('ResolutionBPP') then
    247         ResolutionBPP := Reg.ReadInteger('ResolutionBPP');
    248       if Reg.ValueExists('ResolutionFreq') then
    249         ResolutionFreq := Reg.ReadInteger('ResolutionFreq');
    250       if ScreenMode = 2 then
    251         ChangeResolution(ResolutionX, ResolutionY, ResolutionBPP,
    252           ResolutionFreq);
    253     except
    254     end;
     242    FullScreen := ScreenMode > 0;
     243    if Reg.ValueExists('ResolutionX') then
     244      ResolutionX := Reg.ReadInteger('ResolutionX');
     245    if Reg.ValueExists('ResolutionY') then
     246      ResolutionY := Reg.ReadInteger('ResolutionY');
     247    if Reg.ValueExists('ResolutionBPP') then
     248      ResolutionBPP := Reg.ReadInteger('ResolutionBPP');
     249    if Reg.ValueExists('ResolutionFreq') then
     250      ResolutionFreq := Reg.ReadInteger('ResolutionFreq');
     251    if ScreenMode = 2 then
     252      ChangeResolution(ResolutionX, ResolutionY, ResolutionBPP,
     253        ResolutionFreq);
    255254    Reg.closekey;
    256255  end;
     
    277276  if FullScreen then
    278277  begin
    279     left := (screen.width - 800) * 3 div 8;
    280     top := screen.height - ClientHeight - (screen.height - 600) div 3;
     278    Location := Point(Screen.Width, Screen.Height);
     279    Location := Point((Screen.width - 800) * 3 div 8,
     280      Screen.height - ClientHeight - (Screen.height - 600) div 3);
     281    Left := Location.X;
     282    Top := Location.Y;
    281283
    282284    r0 := CreateRectRgn(0, 0, ClientWidth, ClientHeight);
Note: See TracChangeset for help on using the changeset viewer.