Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: SendKeysTo
With my latest run of this last night, I got the same message. Came in and an error window saying it couldn't find a window titled "~File Save". The rub is that the error window was sitting on top of the window I wanted it to see..."File Save"!.
The program found the file save window correctly 68 times before screwing up. Likewise, this problem occurs with other windows as well.
Maybe it took the FileSave window 11 seconds to appear?
Try adding:
WinWaitExist("~File Save",-1)
IntControl(43,0,0,0,0)Re-enable it shortly thereafter with
IntControl(43,1,0,0,0)
IntControl(43, p1, 0, 0, 0) (32-bit only) Enable/disable "WaitForInputIdle". p1 Meaning 0 Don't wait for application to be ready. 1 Wait for application to be ready (default). -1 Don't change (just return current setting) This controls whether SendKey , SendKeysTo and SendKeysChild attempt to wait until the active application is ready to accept input before sending each keystroke. Returns the previous setting.
SendKeysTo("Cardfile","{f4}")is what is hanging.
I tried the following also, which breaks it down and gives me 3 Sendkeys commands. It only is slow on the first SendKeys command. The other two are immediate.
SendKeysTo("Cardfile","{alt}") SendKeysTo("Cardfile","s") SendKeysTo("Cardfile","g")
If you can find the a SendKey statement that is hanging...
Add:
IntControl(43,0,0,0,0)before the statement and
IntControl(43,1,0,0,0)after it.
Try #1
SendKeysTo("Cardfile","!sg")Try #2
IntControl(43,0,0,0,0) SendKeysTo("Cardfile","{alt}") SendKeysTo("Cardfile","s") SendKeysTo("Cardfile","g") IntControl(43,1,0,0,0)
>Try #1 >SendKeysTo("Cardfile","!sg")Still a 12 second delay
>Try #2 >IntControl(43,0,0,0,0) >SendKeysTo("Cardfile","{alt}") >SendKeysTo("Cardfile","s") >SendKeysTo("Cardfile","g") >IntControl(43,1,0,0,0)Immediate response.
Article ID: W13842
Filename: Sendkeysto Slow or Not Working Sometimes.txt
File Created: 2001:01:05:13:30:08
Last Updated: 2001:01:05:13:30:08