Read word from external application from the cursor position [duplicate] - c#

This question already has answers here:
C# window application get word from the cursor position from the other application
(7 answers)
Closed 9 years ago.
I have window application of Hotkey and pressing hotkey (e.g. Ctrl + 1) I want a text from the cursor position from the external application like notepad, notepad++, Microsoft Word, Browsers etc.
This functionality is already implemented in "WordWeb" Application Hotkey. The same functionality I expect.
Please help me with sample code if any one have idea.

There is no a simple way to do this. The possible ways are OCR, using of Accessibility API and winapi hooking. Probably you should narrow your problem statement before taking any further steps.

Related

Get current keyboard language name in background [duplicate]

This question already has an answer here:
Hook/detect windows language change even when app not focused
(1 answer)
Closed 4 years ago.
I'm trying to get current keyboard language name in background. I used InputLanguage.CurrentInputLanguage.Culture.Name but I understood that this code doesn't work when application isn't focused. I mean it can't detect language changes when app isn't focused and it always returns the last focused language.
So what can I do to detect current language in background? I'm using windows forms for my application.
Refer to this answer to achieve what you want.
Detect current keyboard language/layout name in multi-language computer
Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName in the namespace System.Threading

Is it possible to programmatically make an optical click? [duplicate]

This question already has an answer here:
Winforms Button Right-Click visual feedback (Show button in pushed state)
(1 answer)
Closed 5 years ago.
I'Ve got a winform application where specific Buttons should be visibly pressed whenever a specific key is pressed.
Capturing the key is not so much a Problem, but I did not find a method that allowed me to make it visible that a specific button as been "pressed".
(Even with button1.PerformClick() there was no visualization of the "click").
Is there any way to accomplish this?
You can use Control.Select() to activate the control.

Not sure what this tool is called [duplicate]

This question already has answers here:
How to create an Explorer-like folder browser control?
(3 answers)
Closed 5 years ago.
Not sure if this is off topic or not, if it is i will gladly delete.
I am converting one of my companies utility programs to C#.NET in winforms it is written in vb6, DEFINITELY NOT .NET as it is 15 years old. and in the UI it has a tool which looks like this
it acts like a folder browser put stays on the UI unlike a folder browser dialog which is a popup. is there a .NET tool which does the same thing or do i have to use a folder browser dialog. ideally i would like to keep it on the screen because i think it looks better to keep it on the screen rather than a separate box. if anyone knows if this is actually a tool in C#.NET winforms or not that would be great
Yes these controls are no longer avaiable in .net, you can create one yourself relatively easily, here is a MSDN link describing what you want
https://msdn.microsoft.com/en-us/library/ms171645(v=vs.110).aspx

add code syntax color winforms [duplicate]

This question already has answers here:
A textbox/richtextbox that has syntax highlighting? [C#] [closed]
(8 answers)
Closed 7 years ago.
In my winform application I allow the user to write/read some c# code (simple text in a RichTextBox, I would like to add the functionality to highlight the syntax like VS or notepad++ does, nothing advanced like intellisense and so on, just the text colour change would do.
I've been looking around but I couldn't find anything, do you know if there's a ready to use library or something that I can use?
I found FastColoredTextBox component which seems to be exactly what I need, answering in here in case someone else needs it.

Easy way to create MessageBox with "custom button" [duplicate]

This question already has answers here:
Custom button captions in .NET messagebox?
(8 answers)
Closed 9 years ago.
I've a winform application, and we are trying to make it ergonomic as possible, so we respect a lot microsoft guidelines.
We have some "Deletion confirmation" to implement, and according the guidelines and what I found accross the web, the more adequate buttons would be:
Delete and Cancel
But since we use the MessageBoxButtons to specify which buttons we have to display, I can't see how we can do this except implementing ourself a confirmation dialog.
I don't find very logical that microsoft encourage in one side the use of "action" text on button, and the other side doesn't give us the tools to be compliant, so I think I'm missing something?
Please note that I don't need more results possibility than currently, My Delete option would be the same as Ok for me, I just want to have differents texts.
So: Is there a way to specify easily buttons we want to show different text here?
There is no easy way other than creating your own implementation using form and show it as dialog?
We did the same some time back because of localization specialities in our project.

Categories

Resources