How do I control "Notepad" that my program opens.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2010
05:00 AM
09-14-2010
05:00 AM
How do I control "Notepad" that my program opens.
If you have a problem connecting to our system, we automatically do an IP Trace and show it in Notepad. For the test script to complete, I need to close it. (using Delphi Script).
How do I get a handle to a program that is already running?
How do I do a Wait for it to open (see my example below)?
How do I close the program gracefully?
This is what I do in other areas for a wait
while (MyApp.FrmErrorDlg.Exists = false) do
aqUtils.Delay(1000); // 1 sec delay
hopefully can do something like
while (Sys.Process("Notepad").Exists = false) do
aqUtils.Delay(1000); // 1 sec delay
How do I get a handle to a program that is already running?
How do I do a Wait for it to open (see my example below)?
How do I close the program gracefully?
This is what I do in other areas for a wait
while (MyApp.FrmErrorDlg.Exists = false) do
aqUtils.Delay(1000); // 1 sec delay
hopefully can do something like
while (Sys.Process("Notepad").Exists = false) do
aqUtils.Delay(1000); // 1 sec delay
-
Tom Miller
PIDI
Software Development Manager
Tom Miller
PIDI
Software Development Manager
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2010
06:40 AM
09-17-2010
06:40 AM
Hello Tom,
I recommend that you use the Sys.WaitProcess method to wait for a process. The following script waits for the Notepad process and closes it without saving the changes.
procedure Test1;
var notepad : OleVariant;
var wndNotepad : OleVariant;
begin
notepad := Sys.WaitProcess('Notepad', 10000);
if( notepad.Exists) then
begin
wndNotepad := notepad.Window('Notepad');
wndNotepad.Close();
if (notepad.WaitWindow('#32770', 'Notepad').Exists) then
notepad.WaitWindow('#32770', 'Notepad').Keys('n');
end;
end;
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
