1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| procedure TFrmShowURL.SilentMsgBox();
var
lpClassName: PChar; // pointer to class name
lpWindowName: PChar; // pointer to window name
HwndParent: HWND;
const
MsI = 'Microsoft Internet Explorer';
ErreurScript = 'Erreur de script de Internet Explorer';
begin
try
lpClassName := nil; //'#32770';, // pointer to class name
lpWindowName := MsI; // pointer to window name
HwndParent := FindWindow(lpClassName, lpWindowName);
if HwndParent <> 0 then begin
SendMessage(HwndParent, WM_CLOSE, 0, 0);
FichierLog('System', 'MessageBox', MsI);
end;
lpClassName := nil; //'#32770'; // pointer to class name
lpWindowName := ErreurScript; // pointer to window name
HwndParent := FindWindow(lpClassName, lpWindowName);
if HwndParent <> 0 then begin
SendMessage(HwndParent, WM_CLOSE, 0, 0);
FichierLog('System', 'MessageBox', ErreurScript);
end;
except
FichierLog('System', 'Except', Exception(ExceptObject()).Message);
end;
end; |