   slight annoyance - recovering lost device
  Hi,I'm trying to recover a lost direct3d device of a fullscreen application.It all works as it should except for one annoying thing, I have to click the tab of my program in the windows taskbar 3 (and exactly 3) times before the application opens again.After clicking the tab once, the application is actually open, but seems to be in a non fullscreen format and invisible (I know this because after clicking the tab once there is a rectangular area on my screen where the mouse disappears, this area corresponds to the area occupied by the application when compiled for windowed mode).It tried to follow the method given in "D3D #24: A perfect Direct3D9 application structure"  here is my device recovery function:void handlelostdevice(){HRESULT h = d3ddev->TestCooperativeLevel();if (h == D3DERR_DEVICELOST)devicelost = true;else if (h == D3DERR_DEVICENOTRESET){d3dspr->OnLostDevice();cursor->Release();TileSet.tilesheet->Release();d3ddev->Reset(&d3dpp);VERSUTIAcore.initD3D(hWnd);d3dspr->OnResetDevice();cursor = VERSUTIAcore.LoadSprite(L"cursor.png");TileSet.load_tileset(L"isoTiles.png");devicelost = false;}}the cursor and tilesheet are both POOL_MANAGED although not resetting them results in their graphics being plain white rectangles after the device is reset.I hope you can help me :)A_B   
  after 12 hours still no replies, is there something extremely unclear about my post?hmm, well, I tried to narrow down the problem and it seems that d3dspr->OnResetDevice(); doesn't do anything. It doesn't return S_OK nor D3DERR_INVALIDCALL. (btw d3dspr is a pointer to a ID3DXSprite interface).this is for now my new function (where onresetdevice(); doesn't do anything):void handlelostdevice(){HRESULT h = d3ddev->TestCooperativeLevel();if (h == D3DERR_DEVICELOST)devicelost = true;else if (h == D3DERR_DEVICENOTRESET){d3dspr->OnLostDevice();//cursor->Release();//TileSet.tilesheet->Release();d3ddev->Reset(&d3dpp);d3dspr->OnResetDevice();//cursor = VERSUTIAcore.LoadSprite(L"cursor.png");//TileSet.load_tileset(L"isoTiles.png");h = d3ddev->TestCooperativeLevel();if (h == D3D_OK)devicelost = false;elsereturn;}return;};  another update on the problem;the problem does not occur when I make the resolution of my app the same as the resolution of my desktop.   