fishysheep
Programmer
Hi, need to select block of plain text from external app window (IE). tried using getWindowDC and getWindowRect without success. Code so far is:
ie = New SHDocVw.InternetExplorer
ie.Visible = True
ie.Navigate("
mouse_event(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE, 20000, 47000, 0, 0) 'move to text
singleClickMouse(3) 'fn to mousedown/up simulate click
SendKeys.Flush()
SendKeys.Sendwait("^C") 'copy
Above works fine, mouse moves to correct co-ords, click three times to select text, and copies.
But what I need to acheive is to be able to copy a block of selected text - so then I tried this:
mouse_event(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE, 20000, 47000, 0, 0) 'move to text
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE, 26000, 53000, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
SendKeys.SendWait("^C") 'copy
above does select the text, but nothing is copied. I've tried keybd_event instead of sendkeys.sendwait but that didn't work either. Also tried it without mouse_leftup statement.
Any suggestions grateuflly accepted - still convinced there is a better way to tackle this
ta
ie = New SHDocVw.InternetExplorer
ie.Visible = True
ie.Navigate("
mouse_event(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE, 20000, 47000, 0, 0) 'move to text
singleClickMouse(3) 'fn to mousedown/up simulate click
SendKeys.Flush()
SendKeys.Sendwait("^C") 'copy
Above works fine, mouse moves to correct co-ords, click three times to select text, and copies.
But what I need to acheive is to be able to copy a block of selected text - so then I tried this:
mouse_event(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE, 20000, 47000, 0, 0) 'move to text
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE, 26000, 53000, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
SendKeys.SendWait("^C") 'copy
above does select the text, but nothing is copied. I've tried keybd_event instead of sendkeys.sendwait but that didn't work either. Also tried it without mouse_leftup statement.
Any suggestions grateuflly accepted - still convinced there is a better way to tackle this
ta