Jump to content
Sign in to follow this  

Cold windows

Recommended Posts

It seems that when a window is "Cold", that is, it has not had the focus for a long time, keystrokes (Send function) do not play properly.

I have code that copies the names of 2 , maybe 3 files from a "My Computer" explorer window and puts them into an array. This is the window you get by clicking on "My Computor, rather than "Windows explorer")

If Not WinActivate("folder name") Then

MsgBox(0,'',"Proper window is not open, Exiting")



Sleep(500) ;Let the window have time to come fully alive, however, it does not help

Dim $FL[10]

;FC is file count, previously calculated (which is an array)

Send("{home}") ;This highlights the first file (In details view)

;put all file names into array

For $I = 1 to $FC[1]

Send("!fm") ;Rename command, this makes the currently highlighted file name editable (and copy-able to clip board)

Send("^c") ;copy to clipboard

Send("{enter}{down}") ;Press enter without making any changes and move down to the next file name

$FL[$I]=ClipGet() ;put the file name into the array


What I end up with is 1, 2 or 3 of the elements in the array $FL that was already in the clipboard from an other application.

It Always works correctly the second time in succession.

Any ideas anyone??


Edited by AutoitMike

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...