Assurer de mettre en avant-plan une application 'child'
J'utilise RAD Embarcadero Delphi 2010
Je suis amené à appeler le gestionnaire d'E-Mail.
Je le détecte via
Code:
1 2 3 4 5
|
Registre.RootKey:=HKEY_CLASSES_ROOT;
string A:='\mailto\shell\open\command';
Registre.OpenKey(A,false);
if Registre.ValueExists('') then .. |
puis je l'invoque via
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| destinataire:='---@--.--';
destinataire2:='---@--.--';
sujet:='---';
messge:='----';
email:='mailto:'+destinataire+'?subject='+sujet+
'&cc=' + destinataire2 + '&body='+messge;
ExecuteFile:=Email;
FillChar(SEInfo, SizeOf(SEInfo), 0) ;
SEInfo.cbSize := SizeOf(TShellExecuteInfo) ;
with SEInfo do
begin
fMask := SEE_MASK_NOCLOSEPROCESS;
Wnd := Application.Handle;
lpFile := PChar(ExecuteFile) ;
nShow := SW_SHOWNORMAL;
end;
if ShellExecuteEx(@SEInfo) then ... |
Malheureusement sur certains PC et avec certains gestionnaires d'E-Mails, il arrive que je gestionnaire d'Email se localise en arrière plan de l'application appelante et qu'il faille utiliser "Alt-Tab" pour le ramener au 1er plan. Bien entendu un problème similaire pourrait arriver avec l'invocation d'autres utilitaires que 'send e-mail'.
La question est donc la suivante: Comment peut-on automatiquement ramener l'application 'child' en avant plan?
merci de vos réponses.