... user input as mouse clicks and keyboard input. You can get the text from UI objects.
Every time it is possible to save screenshot of whole desktop or other window. You can also compare the screnshot of a window with saved bitmap.
You do not need to use any foreign code in your software. You can test or automate foreign software.
With best regards,
M.Pobojnyj