Changeset 75 for trunk/Forms/UFormMain.pas
- Timestamp:
- Aug 2, 2016, 1:15:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r74 r75 124 124 ProjectClosed: Boolean; 125 125 ImportTotalItemCount: Integer; 126 function FindFirstNonOption: string; 126 127 procedure ProjectOpen(FileName: string); 127 128 procedure Initialize; … … 442 443 end; 443 444 445 function TFormMain.FindFirstNonOption: string; 446 var 447 S: string; 448 I: Integer; 449 begin 450 Result := ''; 451 for I := 1 to Application.ParamCount do begin 452 S := Application.Params[I]; 453 if S[1] = Application.OptionChar then Continue; 454 Result := S; 455 Break; 456 end; 457 end; 458 444 459 procedure TFormMain.ProjectOpen(FileName: string); 445 460 begin … … 458 473 459 474 procedure TFormMain.Initialize; 475 var 476 FileNameOption: string; 460 477 begin 461 478 if not Initialized then begin … … 463 480 LoadConfig; 464 481 465 if StartMinimizedToTray then Visible := False; 466 467 if ParamCount > 0 then begin 482 {$IFDEF 0} 483 if Application.HasOption('h', 'help') then begin 484 WriteLn('AcronymDecoder <project file>'); 485 WriteLn(' -t --tray Start minimized in system tray'); 486 WriteLn(' -h --help Show this help'); 487 Application.Terminate; 488 Exit; 489 end; 490 {$ENDIF} 491 if Application.HasOption('t', 'tray') then begin 492 Visible := False; 493 end; 494 495 FileNameOption := FindFirstNonOption; 496 if FileNameOption <> '' then begin 468 497 // Open file specified as command line parameter 469 AcronymDB.LoadFromFile( ParamStr(1));498 AcronymDB.LoadFromFile(FileNameOption); 470 499 LastOpenedList1.AddItem(OpenDialog1.FileName); 471 500 end else … … 640 669 RootKey := HKEY_CURRENT_USER; 641 670 OpenKey(RegistryRunKey, True); 642 if StartOnLogon then WriteString('Acronym Decoder', Application.ExeName) 643 else DeleteValue('Acronym Decoder'); 671 if StartOnLogon then begin 672 if StartMinimizedToTray then WriteString('Acronym Decoder', Application.ExeName + ' /t') 673 else WriteString('Acronym Decoder', Application.ExeName) 674 end else DeleteValue('Acronym Decoder'); 644 675 finally 645 676 Free;
Note:
See TracChangeset
for help on using the changeset viewer.