   Device lost when I click on the corner
  Does anyone know the best way to avoid lost device every time I click on any of upper left or upper right corners of my fullscreen window? (Direct3D 9)   
  If you can click on the corners (=NC area) of your window it isn't covering fullscreen (the client area, the size passed to CreateWindow(Ex) also covers the borders and caption). I assume you mean you've got the device set to fullscreen?In that case you have to create a borderless window. Just WS_POPUP | WS_VISIBLE should be enough.Just to be sure: You still have to handle a lost device for other purposes though.   