
The topic of displaying the current layout has been harassed by the community
more than once . I tried many existing solutions, but for various reasons they did not suit me. To find the most convenient way to display the current layout, I wrote a small C ++ application that,
when I clicked on the left Shift, displays the language in the text editing system cursor. Less than 100 lines of code and about 4 kilobytes in the compiled form - based on this, you can simply realize your view on how the display layout should look like.
How is this done?
Since we do not need anything other than WinAPI, the program is compiled
without RTL in Visual Studio 2010. Thus, we get a very small amount of the executable file. To keep track of pressing Shift
, a keyboard hook is installed without using a dll. To change the text editing system cursor, use the
SetSystemCursor function - it allows you to replace the required type of standard cursor in all applications at once. Thus, we avoid the need to spend additional resources on the display of the indicator on the screen - this is the system itself. By default, the cursor is text editing without a shadow and inverts the color of each pixel below it. This is possible only in two-color cursors, so in order to preserve this useful feature, we must make our indicator black and white.
Where can I download the result?
The source code can be seen in the
main.cpp file (on bitbucket.org) or downloaded as a
langcursor-1.0-src.zip project (5 kb).
Attention! The project is compiled only in the Release-version (due to the lack of RTL).
Ready executable file in the archive:
langcursor-1.0-bin.zip (1 kb).
What can I change?
If you want to add a display of other layouts, just add the cursor resource with the layout identifier as a name (you can set the value from the last column
of the language identifier table in the resource.h file). If you don’t like the little black and white language display, you can replace the cursors with your own, for example, with colored flags. However, when using color cursors, you will not be able to invert the colors under the cursor and the cursor will start to cast a shadow (if it is not turned off in the settings).
Moreover, if you are familiar with C / C ++, you can completely change the code for yourself! Try, experiment, share your experience! All people are different, that suits one - not a fact that suits others. But together, I hope we can come up with the most convenient solution :)
')
Modified Versions
Permanent display of the language icon without having to press Shift
here .
Version with constant display and support of the Ukrainian language
here .