Bonjour,
Mon application ouvre une nouvelle fenêtre et affiche un formulaire Web dans un TWebBrowser. Ensuite quand je click sur un lien, je fais mon traitement et ensuite je ferme ma fenêtre.
Et là j'ai un problème, ma fiche principale prend la main, et tout est normal. Sauf si je regarde mon processeur qui lui travail à 50% pour mon programme.
Quand je trace le code, je vois qu'il boucle non stop dans la méthode TApplication.Run de l'unité Forms
Voici le code et la boucle qui pose problème est en rouge.
Merci
procedure TApplication.Run;
begin
FRunning := True;
try
AddExitProc(DoneApplication);
if FMainForm <> nil then
begin
case CmdShow of
SW_SHOWMINNOACTIVE: FMainForm.FWindowState := wsMinimized;
SW_SHOWMAXIMIZED: MainForm.WindowState := wsMaximized;
end;
if FShowMainForm then
if FMainForm.FWindowState = wsMinimized then
Minimize else
FMainForm.Visible := True;
repeat
try
HandleMessage;
except
HandleException(Self);
end;
until Terminated; end;
finally
FRunning := False;
end;
end;
Partager