   Device events with C++
  I had this problem with my app that when I alt-tabbed out and tried to get in again it didn't immediately work. I think I found the solution but it is in C#code, while I need C++ (and I can't find any C++ example on the web).This is the C# code: device.DeviceResizing += new System.ComponentModel.CancelEventHandler(this.CancelResize);private void CancelResize(object sender, System.ComponentModel.CancelEventArgs e){e.Cancel = true;}where device is (I think) the direct3d device, although in C++ this has to be accessed using -> and does not have a member "DeviceResizing"   
  C++ has no native support for "events" like C# does. The device-resize even you have found is something MDX (the now-dead official managed wrapper for DirectX) provided. These events, incidentally, were not a good idea. But that's neither here nor there, as you are on the right track but have not yet found the solution.What you're looking for is information about handling a "lost device." This Google search provides a bunch of useful hits -- the top link is the MSDN documentation, and the remainder are tutorials (of varying quality) that explain how to detect and recover from a lost device.   ;  Thank you, jpetrieI already went through various tutorials and my device recovery works ALMOST as it should. The exact problem is that when I want to go back to my app, I have to click my program's icon several times before it actually shows up again. This problem only occurs when the resolution of my app is different from the resolution of my desktop so I assumed canceling a resize of my app when the device gets lost might be a solution. Clearly, it is not, so now I'll have to look at another one.ThanksA_B