I couldn't find info anywhere around and im a bit curious, from C# where you have all nice buttons and classes and events to do all you please, im wondering how is this really implemented in a low level scenario. For example if i click on a point in the screen, whats algorythm used to detect which control was pressed, what action was done, which events fire and so on. Im guessing this is all depends on the OS and its api.
Just in case its not clear, i would like to know the event chain from where the mouse click or move interrupt is done from the device to the CPU, to where the event is fired in my C# code :)