If you want to write your own application to use as the desktop, then you need to follow some guidelines which can be found
here[
^].
It tells you how to replace the shell, and also disable other functionality to prevent users from getting around your desktop replacement.