A have a C# class which simplifies the handling of global hot keys.
This class uses the Win32-API function RegisterHotKey() to register the hot keys.
According to MSDN this function needs an ID value in the range 0x0000 through 0xBFFF when
calling from an application and an ID value in the range of 0xC000 through 0xFFFF when
calling from a shared DLL. GlobalAddAtom() can be used to get the ID in case of running
in a DLL.
To hide this distinction from the user of the class the class itself should decide which ID range is to be used when registering a hot key. Well, and to do this, the class must be able to detect whether its code is running within an application or within a shared DLL.
But how to do this? What is the best C#/.NET way to do this?
Try this:
MSDN:
Assembly.EntryPoint Property