Get current keyboard language name in background [duplicate] - c#

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

Related

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.

Read word from external application from the cursor position [duplicate]

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.

Title-bar's context menu [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I customize the system menu of a Windows Form?
How could I insert new items to the title-bar's context menu as in Google's Chrome:
I would prefer a C# WPF solution, but I have no problem to do this in C++ (Interops are all set already).
Thank you.
Some other alternatives here:
http://www.codeproject.com/Articles/70568/An-MVVM-friendly-approach-to-adding-system-menu-en
http://www.codeproject.com/Tips/320885/Customize-Window-System-Menu-in-WPF
You might consider using the 2nd link where it actually creates a WPF menu instead of modifying the existing native system menu, if you wanted to skin the menu for your application.
I'd suggest you extended the code to scan the native System Menu so you could create WPF menu items that mirrored the expected System Menu items.

Categories

Resources