|
-
Sep 3rd, 2017, 08:53 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] How to know if a file-dialog has appeared?
Hello fellow programmers,
I am automating a file upload routine on some webpage. The webpage 'upload file' button is clicked and a file-dialog appears. I am looping to find the handle of this popup-window. Then I find the handle of the file textfield, update it, and click "OK/send/save". Everything is working perfectly and files are uploaded.
The above routine is executed rather quickly (1-2 seconds)... The problem is that this routine is entirely executed (and OK/send/save button clicked) even BEFORE the file-dialog actually shows up on screen. The reason for the file-dialog to appear "so slowly" is that the CPU may currently be struggling over some other tasks. Sometimes it will show instantly, sometimes it can take as much as ~30 seconds to show (yes, really).
My question: would there be a way to wait for the file-dialog to APPEAR on screen before executing the above routine? I thought about looking up the process/application list (Win7's Task Manager), but such a file-dialog popup won't appear in the "applications" tab, or in the "processes" tab. I do have the hwnd of the popup, anything I can do with that? I would have wished for the handle/hwnd extraction to NOT WORK until it appears on screen, but no... it seems that those handles are properly found even with that popup not yet visible. In the end, the popup ends up appearing, doing nothing, waiting for my action.
Thank you for any ideas.....
Last edited by Krass; Sep 3rd, 2017 at 08:58 PM.
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|