that app takes time to load . Currently using Tprocess to do this but haven't finde any thing that hold my app to finish that external app loading . I know about waitonexit but that wait for exit not finish load . Any one can help ?
{$mode delphi}{$H+} uses process; var P:TProcess; begin P:=TProcess.Create(nil); try {$ifdef mswindows} P.Executable :='dir'; P.Parameters.Add('/w'); {$else} P.Executable:='ls'; P.Parameters.Add('-l'); {$endif} P.Options:=[poWaitOnExit]; P.Execute; finally writeln('finished. Exitcode: ',P.exitcode); P.Free; Readln; end; end.
poWaitOnExit. ✌️😎
No . poWaitOnExit wait till external app exit but i don't want that . Want to wait till app completely loaded not completely exited ☹️
You need to read its output. Maybe then such an example would be suitable? https://github.com/Al-Muhandis/ShellRemoteBot/blob/8b1765c368771b3a3a9feb31b06ebe0b9389cfda/shellthread.pas#L489
Tnks . I checked i think its same as the wait to exit . Its can be wait for some output and then determine that app loads finished but my external app dont have any console output It just takes some time to load its config file then do something but want delete that config file after config loaded to external app . If i delete config file after executing Tprocess. The external app wil crash and closed
The app that do you want to monitor, creates some window when it if fully loaded? It's multiplataform or just windows?
No its cmd app and not have output
So, how do you know when it's fully loaded?
I don't know my problem is that . There was RAD app maker that have such option that waits to app loaded and then continue rader that wait for exit And that RAD APP crated by freepascal so i think there is method must be in pascal to do that . In windows OS
On Linux you can monitor the apps at operating system level. Probably windows have this tool too
It could be the presence of a socket in listen mode
Обсуждают сегодня