Jump to content

FileFindNextFile can I stop 'OK' Popup?


 Share

Recommended Posts

I need to put all filenames from a directory into an array but without intervention. The FileFindNextFile popup window named 'File:' stops execution and waits for input to 'OK' button after each file is found.

I have tried WinClose,WinKill,ControlSend and ControlCommand but the window will not respond to any of these even though the control ID and name are used.

Is there a way to get around this or a better way to read all the file names into the array?

Thanks for any suggestions.

Link to comment
Share on other sites

FileFindNextFile does not cause any windows to popup.  It only returns a filename.  Please post some code so we can see what you're doing.

<{POST_SNAPBACK}>

if i had to guess.... i'd say his code is this:

; Shows the filenames of all files in the current directory
$search = FileFindFirstFile("*.*")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
    MsgBox(4096, "File:", $file)
WEnd

; Close the search handle
FileClose($search)

that's what's in the help file for example. remove the following line and you should be fine.

MsgBox(4096, "File:", $file)
Link to comment
Share on other sites

...that was my guess too (that the code was from the help file)... but you beat me to the post.

...remove the following line and you should be fine.

<{POST_SNAPBACK}>

...but where is the array that jaycee asked for? :-)

I cannot test right now - so don't want to post code.........later

edit:typos and add smilie to indicate that I did not expected cameronsdad to write all of the code for jaycee :-)

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

I need to put all filenames from a directory into an array but without  intervention.

help file: _FileListToArray()

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Thanks for the replies.

It was past midnight when I posted message and was too tired to see the obvious.

Looked at code 6am today and reason was obvious....had left in a msgbox from an earlier testing session....just couldn't see it for looking!!

It is part of a subroutine in a set of progs which enables WindowsXP printing using a touchscreen (without mouse or keyboard).

Have been using AutIt for just a few days but it is a great tool.

Thanks again.

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...