Answer the question
In order to leave comments, you need to log in
How to get selected text from windows application without using clipboard?
I have a Windows application that cannot copy text. But I need to somehow copy (or just output) the selected text, I tried this
import pyautogui as pya
import pyperclip
import time
import keyboard
def copy_clipboard():
pya.hotkey('ctrl', 'c')
time.sleep(0.1)
return pyperclip.paste()
while True:
try:
if keyboard.is_pressed('q'):
print('You Pressed A Key!')
pya.doubleClick(pya.position())
var = copy_clipboard()
print(var)
break
else:
pass
except:
break
Answer the question
In order to leave comments, you need to log in
Find the window Handler, then the control. And EM_GETSELTEXT .
Program:
Look for programs that work with windows, there were dozens of them before, now they are not so popular, but they still work, even very old ones (I have a special selection of such programs).
Search by keywords "Window Scanner", "Window Scanner", "Window Spy", etc. Here the difficulty will be only in choosing between different ones and wasting time trying a dozen utilities.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question