[TRUCO DELPHI] La App se Freezo.
delphi
function AppIsResponding(ClassName: string): Boolean; const TIMEOUT = 50; var Res: DWORD; h: HWND; begin h := FindWindow(PChar(ClassName), nil); if h <> 0 then Result := SendMessageTimeOut(H, WM_NULL, 0, 0, SMTO_NORMAL or SMTO_ABORTIFHUNG, TIMEOUT, Res) <> 0 else ShowMessage(Format('%s no encontrada!', [ClassName])); end;
Ejemplo de Uso:
delphi
procedure TForm1.Button1Click(Sender: TObject); begin if AppIsResponding('Notepad') then ShowMessage('App. no responde'); end;
Saludos!