1. If you are trying to prevent hacks / cheats, do not even try. You can not prevent injection of code into any others process memory. If you are thinking of deliberate hacks, you can never prevent them, in the best case your program will get "fixed" with a hex editor, even before it starts, including the code that checks if the app is correct (CRC check).
2. If you are trying to prevent "user code" from crashing the dethronement, you can make a number of problems by installing custom error handlers in the OS. But it will never be safe. Take for example:
char* hello = "Hello";
for (int i = 5; i > -100; i--)
{
hello[i] = 0;
}
This piece of code will corrupt the stack, event before it raises a access violation. Now what?! You do not have a valid return address to return to?
All in all, do not try to prevent the things you can not prevent. If you are thinking DRM / cheat prevention, the best is none at all. The point is your implementation will be circumvented in under two weeks, hence useless. Those you try to protect your app from will not be stopped and those that rightfully use your app will curse you to death, because of the odd side behaviors.