Einzelnen Beitrag anzeigen

Benutzerbild von Piro
Piro

Registriert seit: 14. Jul 2003
Ort: Flintbek
810 Beiträge
 
Delphi XE2 Professional
 
#7

AW: ALT+TAB - 2tes Formular mit ShowModal - Anwendung nicht mehr sichtbar

  Alt 12. Jul 2016, 09:07
Hier der Constructor der Formulare. ich finde da leider nichts auffälliges.
Delphi-Quellcode:
program Aufgabenbuch;

uses
  Windows,
  SysUtils,
  Forms,
  Dialogs,
  MSXML2_TLB,
  Registry,
  uMain in 'uMain.pas{frm_main},
  uTask in 'uTask.pas{frm_task},
  uLogin in 'uLogin.pas',
  uHostAlive in 'uHostAlive.pas',
  StartOnce in 'StartOnce.pas',
  uMonthCalendar in 'uMonthCalendar.pas{frm_monthcalendar},
  About in 'About.pas{frm_about};

{$R *.res}

function DoesXMLExist: boolean;
var
 reg : TRegistry;
 s : string;
begin
 Result := False;
 reg := TRegistry.Create(KEY_READ);
 if reg <> nil then
 begin
   with reg do
   try
     RootKey := HKEY_CLASSES_ROOT;
     if OpenKey('CLSID\' + GuidToString(CLASS_DOMDocument60)+ '\InProcServer32', false) then
     try
       s := ReadString('');
       s := StringReplace(s,'%SystemRoot%',GetEnvironmentVariable('SYSTEMROOT'),[rfReplaceAll]); // falls eine Systemvariable gesetzt ist
       Result := (s <> '') and (fileexists(s));
     finally
      CloseKey;
     end;
   finally
     Free;
   end;
 end;
end;

begin
  ReportMemoryLeaksOnShutdown := True;
  Application.Initialize;
  Application.Title := 'Aufgabenbuch';

  if not DoesXMLExist then
  begin
    MessageDlg('MSXML 6 ist erforderlich. ' + Application.Title + ' wird beendet.',mtInformation,[mbOK],0);
    Exit;
  end;

  Application.CreateForm(Tfrm_main, frm_main);
  Application.CreateForm(Tfrm_task, frm_task);
  Application.CreateForm(Tfrm_monthcalendar, frm_monthcalendar);
  Application.CreateForm(Tfrm_about, frm_about);
  Application.Run;
end.
Ich habe mir mal ein kleines neues Projekt gemacht mit einer Form und einem Button. Beim Klick auf dem Button kommt eine 2. Form hoch.
Mit diesem kleinem Projekt geht alles mit ALT-TAB.

Danach habe ich ein neues Formular meiner Anwendung hinzugefügt und es dann einfach mit ShowModal angezeigt. Siehe da, es funktioniert alles wie gewünscht.

Woran kann es denn noch liegen?

Bin mit meinem Wissen am Ende.
  Mit Zitat antworten Zitat