|
-
Dec 12th, 2006, 01:29 AM
#1
Thread Starter
New Member
[RESOLVED] "Can't open Clipboard" message, what to do ?
I need grab the data from the scrolling window in another application. The data have a table structure, so I can get them manually using Ctrl-C,Ctrl-V method and stepping down row-by-row.
I am trying to create a simple program in VB6 which could do it automatically. I imitated all keyboard keys and it works. However, I must introduce some time delays at each step like "Sleep 400" or I get "Can't open Clipboard" message". However, if the number of rows 200 or so it is slow. I read somewhere to try the following to avoid "Sleep" command:
Get ProcID of the process and insert WaitForInputIdle ProcID.
I did that at each step of the cycle for the process where the window belongs to and for the clipboard process like
hwnd1 = GetClipboardOwner()
GetWindowThreadProcessId hwnd, procid
GetWindowThreadProcessId hwnd1, procid1
WaitForInputIdle procid, INFINITE
WaitForInputIdle procid1, INFINITE
Here hwnd is the handle to the scrolling window. It is not working. I am getting occasionally that message "Can't open Clipboard". I tried to introduce Error handling trying to repeat Ctrl-C,Ctrl-V sequence few times, but the program locks in such loop of error corrections.
Could anyone advise me how to handle this "Can't open Clipboard" problem ?
Last edited by butsefal; Dec 14th, 2006 at 06:59 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|