C
C#2y ago
Alizer

❔ how to get the current selected text from any window just like how clipboard does it?

I want to simulate Ctrl + C without pressing Ctrl + C, basically able to read any selected text from any window be it a browser, notepad or word, most solutions I found online requires me to call SendKeys to do Ctrl + C every mouse release but some programs (such as VLC media player) performs a different action if Ctrl + C is pressed, and hell, I have no idea if text is even being selected in the first place, so currently my question is, how do I simulate clipboard copy without pressing Ctrl + C?
5 Replies
TheBoxyBear
TheBoxyBear2y ago
Getting text from other window without the user knowing it pretty fishy. If you want your own app to have al alternate way of copying, you can set the text in the clipboard manually
Alizer
Alizer2y ago
im making an auto translator app for selected text, i just basically have to know what the current highlighted/selected text is
Anton
Anton2y ago
afaik copying is handled by the app in question, by it just processing the key presses, so I would guess you can't
Jester
Jester2y ago
yeah Anton is right and its the application that copies it to the clipboard, not the clipboard that takes it from the application
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
✅ Sorting nestedSo I've got this data model that looks something like this (some parts of the fields have been omitt❔ Async Await On Logging - Waiting Response Without Await KeywordI have logging service where I call the logger.log async method without awaiting the response, expec❔ Validate Crypto addressI want to validate a cryptoaddress. The user can input an cryptoaddress... I want to validate this..✅ Creating a generic type based on a Type variable rather than a specific typeI've got the following code: ```cs public class QueryResponse<T> { T? Data { get; set; } bool Swhen an enemy hits the player it doesn't stop for some reason, and when the form loads I can't moveI'm not sure what I'm doing wrong when a bulletbill hits the bird it should stop and show up a messa❔ C Sharp Windows Form executable with local databaseHello guys, I've made a project in C# Windows Forms that uses local database (Azure). Since it's loc❔ Process.Exited immediately fired if corresponding app is already openedI wrote a function that downloads a PDF from some API and then attempts to open it. For this reason,❔ [Avalonia UI] - How to bind a process method to PointerPressed in ScrollViewer in xaml?Quite confused. It's not quite same as WPF and I cannot find anything in official document.✅ Using Linq's Cast MethodI've never been able to get it to not warn and throw errors except for one, maybe two times. It is a❔ Binary tree pre orderHow to make a loop out of this ? ``` Tree tree = new Tree(); tree.root = new Node(1); tr