Answer the question
In order to leave comments, you need to log in
Who knows examples of external automation of standard Windows File Open/File Save dialogs from C#?
subj actually, I ask you to throw examples, if anyone knows.
In general terms, the situation is that a certain program is being automated without source codes (not very fresh anymore), clicks on the "controls" have been worked out, and everything seems to be stable. Each time, by HWnd, we secure the presence of the window in the top of the display, and in the input focus. But with the input of file names for opening / saving (there are no APIs in the target program), something is not simple. On the developer's computer, everything works smartly and stably. And the consumer fails (((
used options
"Save Table".hWndByTitle().setActive().waitForIdle();
Clipboard.SetText(file_path_name);
SendKeys.SendWait("^V{Enter}");
Thread.Sleep(timeOuts[toSendKeys]);
"Save Table".hWndByTitle().setActive().waitForIdle();
SendKeys.SendWait(file_path_name);
SendKeys.SendWait("{Enter}");
Thread.Sleep(timeOuts[toSendKeys]);
Answer the question
In order to leave comments, you need to log in
I once used AutoIt scripts for similar purposes.
Purely theoretically:
You send messages to an active window. Perhaps between SetActive and SendWait the window ceases to be active. In this case, the messages will go to the wrong window.
Try getting the window handle and send messages to the window with the given handle.
"Unpredictable failures" need to be dealt with. What is the cause of the failure, how does it manifest itself ... ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question