Jump to content

Recommended Posts

Posted

Hi,

In my script i am using both Send() and _ClipBoard_GetData() functions.

In Send method i have passed Ctrl+A and Ctrl+C keys to copies the text from textbox control and then i have passed _ClipBoard_GetData() method to retrieve the copied data.

Send("{^a^c}")
$var = _ClipBoard_GetData() 

but some times _ClipBoard_GetData()  executes before the copied operation completed. I have resolved this issue by adding sleep time between these two methods

Send("{^a^c}")
Sleep(1000)
$var = _ClipBoard_GetData()

How can i achieve this operation without using Sleep() method

Thanks,

--SJ

Posted

the actual operation of copying to clipboard does not depend on your script. script does not copy to clipboard, it only sends the instruction to Windows to perform the copy to clipboard, so you can not delay the script until the copy is completed.

you can either go with what you have, or devise an elaborate function that would read the clipboard before send(), then re-read the clipboard in loop after the send() until the content is different, and only then the script continues.

something like this (not tested, i just scribbled it):

$xPreCopy=_ClipBoard_GetData() 
Send("{^a^c}")
Do
    Sleep(10) 
    $var = _ClipBoard_GetData() 
Until $var<>$xPreCopy

Signature - my forum contributions:

  Reveal hidden contents

 

Posted

If you're interacting with an edit control why not look at the _GUICtrlEdit** functions?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted
  On 12/24/2013 at 7:50 AM, guinness said:

If you're interacting with an edit control why not look at the _GUICtrlEdit** functions?

Hi, 

I am interacting with the control inside the infragistics grid-view. _GuiCtrlEdit methods required control handle to populate the results but i don't know the information about the controls which is present inside the grid-view.

Thanks

--SJ

Posted

  On 12/24/2013 at 9:33 AM, codeninja said:

Hi, 

I am interacting with the control inside the infragistics grid-view. _GuiCtrlEdit methods required control handle to populate the results but i don't know the information about the controls which is present inside the grid-view.

Thanks

--SJ

OK, I am not familiar with that piece of software.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

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
  • Recently Browsing   0 members

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