Set global hotkeys using C#

Please note that this code will not trigger events in console application projects. You have to use WinForms project for events to fire. This is the correct code: public sealed class KeyboardHook : IDisposable { // Registers a hot key with Windows. [DllImport(“user32.dll”)] private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk); … Read more

Find out what process registered a global hotkey? (Windows API)

One possible way is to use the Visual Studio tool Spy++. Give this a try: Run the tool (for me, it’s at C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\spyxx_amd64.exe or you can download it). Note: there is spyxx.exe (32-bit version) and spyxx_amd64.exe (64-bit version) – if you don’t see anything in 64-bit use the 32-bit version (ie.catches … Read more

Any way (or shortcut) to auto import the classes in IntelliJ IDEA like in Eclipse?

IntelliJ IDEA does not have an action to add imports. Rather it has the ability to do such as you type. If you enable the “Add unambiguous imports on the fly” in Settings > Editor > General > Auto Import, IntelliJ IDEA will add them as you type without the need for any shortcuts. You … Read more

How to comment a block in Eclipse?

Ctrl–/ to toggle “//” comments and Ctrl–Shift–/ to toggle “/* */” comments. At least for Java, anyway – other tooling may have different shortcuts. Ctrl–\ will remove a block of either comment, but won’t add comments. Note: As for Eclipse CDT 4.4.2, Ctrl–Shift–/ will not uncomment a “/* */” block comment. Use Ctrl–Shift–\ in that … Read more