A C# class help you to set a global mouse or keyboard hook simply, just only three lines code.