Jump to content

prevent open file dialog from appearing and interact with it


garbb
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • Moderators

garbb,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

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 :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...