So the other day, I saw this:
http://www.edgeofnowhere.cc/viewtopic.php?p=2483118
and it goes over three different methods of DLL injection. How would I preven
I'm not intimately familiar with the Windows API, but I can give you some more generalized pointers:
See if you can use Windows Data Execution Prevention (DEP). It will probably not work for all (read: most) situations, because the process outlined in your link is a valid process from the OS's standpoint. Defense in depth though
Ensure that your process methods assert security permissions throughout the application
Statically allocate your memory space so that any new threads spawned into it will either fail or overwrite existing memory space; you'll need probably a hefty chunk of logic to detect and correct for this though.
Factor your code into a device driver or some other low-level type process that you can get covered under the Windows File Protection umbrella.
Just saw Cthulon's answer and I'm afraid he's probably correct: anyone who wants to perform code injection on your application will find a way to do so. The steps above might merely make it a bit more difficult.
Hope this helps