Okay so I've been working on this directx 11 application and have came across two problems. The most important one being, this application takes a heavy usage of the cpu and I have no idea what is causing it. The less important problem is that upon destroying the application it still stays within the process list on the task manager.
the problem is probably message loop, you should look around other solution for this part of your program( like excellent site: http://www.directxtutorial.com )
the problem is still in your message loop. Since peekMessage is non-blocking, this thread will never wait (create console app with while(true) {cout<<"aa";} - high cpu usage will also happen}.