Einzelnen Beitrag anzeigen

Peter1999

Registriert seit: 13. Dez 2007
Ort: Dresden
88 Beiträge
 
Delphi XE2 Professional
 
#4

AW: Delphi 7 + Vista Ready Code = ShowModal Problem

  Alt 12. Aug 2010, 21:50
Der "showmodal-bug" gehört schon zu den Klassikern in Delphi und wurde auch schon mehrfach diskutiert.
In D7 gibt ist einen einfachen workaround. Schlagwort zum Googeln: Disable Window Ghosting

Delphi-Quellcode:
procedure DisableProcessWindowsGhosting;
var
  DisableProcessWindowsGhostingImp : procedure;
begin
  @DisableProcessWindowsGhostingImp :=
    GetProcAddress(GetModuleHandle('user32.dll'),
    'DisableProcessWindowsGhosting');
  if (@DisableProcessWindowsGhostingImp <> nil) then
    DisableProcessWindowsGhostingImp;
end;


// In der Projekt.dpr
begin
  // Disable Window Ghosting anwenden:
  DisableProcessWindowsGhosting;
  Application.Initialize;
  Application.Title := 'Hidden Dialog Test';
  Application.CreateForm(TfrmMain, frmMain);
  Application.Run;
end.
Viele Grüße,
Peter
  Mit Zitat antworten Zitat