need my application to run in background

newbcoder9

New member
Joined
Jan 14, 2018
Messages
2
Programming Experience
Beginner
need my application to run in background
I have a script that utilizes selenium and chromedriver
to download large amount of files from a database using a logged in session
it counters a lot of errors thrown in by server
but to get the files off the website faster we used multi threads and that causes multiple browsers to open and close simultaneously rendering computer useless because some links have less data some have more, some are unavailable so software keeps retrying it, until script has finished through the input number of files

I wanted a way to make everything run in background, where we are able to use computer while this software runs and creates the required database.
 
If you're actually displaying a GUI then that would be difficult to impossible. You may be able to set the WindowState of your form to Minimized before calling Show but that may still take focus away from the active application and your browser control may not work properly. If the form still steals focus then you could use unmanaged code to check what window has focus before showing yours and then refocus that window afterwards but that may not be reliable if you're opening multiple windows over a period of time. All you can really do is give it a try and see what happens.
 
If you're actually displaying a GUI then that would be difficult to impossible. You may be able to set the WindowState of your form to Minimized before calling Show but that may still take focus away from the active application and your browser control may not work properly. If the form still steals focus then you could use unmanaged code to check what window has focus before showing yours and then refocus that window afterwards but that may not be reliable if you're opening multiple windows over a period of time. All you can really do is give it a try and see what happens.

pardon

I meant the browsers need to go in the background, or can we use something else? instead of selenium? disable browsers and keep em forced minimized? as they do steal focus all the time and very quickly at times, I Can show over teamviewer if it helps...
 
There's no such thing as a UI in the background. The UI is, by definition, the foreground. If you don't want a UI then don't use one. You can use a WebClient or go lower-level still and use a WebRequest or HttpRequest.
 
Back
Top Bottom