FWIW: if you're doing stuff like this... you're better off leaving the console and using an actual window. Trying to twist and bend the console into doing faux graphics and mouse events is often more difficult than just doing it the normal way.

What kind of program are you looking to make? Is this for a simple game?