Jump to content
Sign in to follow this  
garbb

prevent open file dialog from appearing and interact with it

Recommended Posts

garbb

I want an autoit script to open and then interact with an open file dailog (or possibly other dialog) from an application but I don't want the dialog to popup on the screen and steal focus away from whataver other app/window the user is using. I know that I can use something like this

WinWaitActive("File open")

WinSetState("File open", "", @SW_HIDE)

to hide the dialog once it appears and control it even with it hidden, but this briefly flashes the box on the screen and steals focus. Is there any way to prevent this from happening?

I have tried running the original application with the @SW_HIDE flag (Run($exename, "",@SW_HIDE)) but whenever the autoit script causes the open file dialog to open it still shows up and steals focus even though the main application window is completely hidden.

Thanks in advance to anyone that can help.

Share this post


Link to post
Share on other sites
FireFox

Hi,

I think it is not possible.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
JLogan3o13

More importantly, why are you trying to hide the window instead of just automating the file selection?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
garbb

More importantly, why are you trying to hide the window instead of just automating the file selection?

It is part of a script that takes a long time to run and I would like to be able to to other things with my computer without being interrupted by windows flashing on the screen and stealing focus.

What do you mean by "automating the file selection"? That is exactly what I am trying to to, its just that the only way I can seem to do this with the particular program I am automating is to have autoit open the file open dialog and insert text and then click the "open" button. Ideally I could have it open the file via the command line (program.exe file.ext) or something like that but i have tried this and the program doesn't support this. Is there some other way?

Share this post


Link to post
Share on other sites
garbb

For some reason I cannot edit my posts, but it had occurred to me that there might be some way to do this involving some sort of hooking of the open file dialog. This sort of thing is a bit over my head though. Does anyone know anything about this or have a good tutorial or example?

Share this post


Link to post
Share on other sites
Melba23

garbb,

You need 5 posts to open up the "Edit" permission - along with a few other ones. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, garbb. Regarding a "hook" for the file open dialog, it would help greatly if you could explain what program you're trying to manipulate. Each application is different in what you can and cannot do, so without knowing what application you're working in we're shooting in the dark :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
garbb

Unfortunately it is a program I use for work and so it is not something that is available to everyone nor can I share it but the file open dialog looks just like the standard windows file open dialog; for example open up notepad and click on file, then open. Here is a screenshot: http://imgur.com/EVyhu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×