   Problem switching from fullscreen to windowed
  Hi there. ;)I've been coding with DirectX for a while now, but my apps were never very resistant to alt-tabs and didn't accept full-screen / windowed toggles.So I've decided to rework the framework recently... and it seems ok so far, except for one thing :When switching from Full-Screen to Windowed mode, my window has no border, no title bar... despite a call to SetWindowLong( .. ,GWL_style, .. ) with same window style that the ones used on the creation (which were ok when starting the app directly in windowed mode)I've tried with several styles, and tried to call SetWindowLong() before or after the recreation of the device, nothing seems to work...any ideas ? :(many thanks :)   
  You need to call SetWindowPos() with the SWP_FRAMECHANGED flag to update the window frame after you change the style, since the frame is cached by Windows.   ;Quote:Original post by Evil SteveYou need to call SetWindowPos() with the SWP_FRAMECHANGED flag to update the window frame after you change the style, since the frame is cached by Windows.oooh THANKS A LOT ! :):):);  Hi again...I have another problem and... well, maybe it is related, maybe it's not. Since I can't find a better place to post I'll enqueue it here.Switching from windowed to fullscreen is ok... and from fullscreen to windowed WAS ok... until I tried to mess with textures for render targets.What was happening then was a kind of instability when going from fullscreen to windowed mode. Meaning: the recreation of the device was failing at least once and needed a second try, plus the desktop size was resized to the size of my fullscreen app etc... erk.After a little search I could isolate only one line of my code that made things go crazy. But this is really weird if you ask me.The incrimined code is :HRESULT Main_Graphics::DestroyTexture(long lTextureIndex){  Main_Texture* pTextureObject = GetTextureObject(lTextureIndex);  if (!pTextureObject)  {    return GRAPHICERR_WRONGRESOURCEINDEX;  }  SAFE_DELETE(m_tlpResources[lTextureIndex]); // <-- This is the bad guy  m_lResourceCount--;  return S_OK;}Some declarations you may need to understand a little more :#define SAFE_DELETE(p) { if(p) { delete p; p = NULL;} }typedef interface IGraphicsReloadableObject {// ...} INTERFACE_GRAPHICS_RELOADABLEOBJECT, *LP_INTERFACE_GRAPHICS_RELOADABLEOBJECT;class Main_Texture: public IGraphicsReloadableObject{// ...};class Main_Graphics{// ...private :  Main_Texture* GetTextureObject(long lTextureIndex);  LP_INTERFACE_GRAPHICS_RELOADABLEOBJECT m_tlpResources[GRAPHICS_MAXRESOURCES];};now what's the weird part, you ask ? if I replace :  SAFE_DELETE(m_tlpResources[lTextureIndex]);with  SAFE_DELETE(pTextureObject);  m_tlpResources[lTextureIndex] = NULL;The fullscreen to windowed toggle works FINE again...trying to put parenthesis around the 'p' in SAFE_DELETE macro didn't change anything.???if you ask, the object was created with the following part of code :  long pos = GetFreeSlot();  Main_Texture* pTextureObject = new Main_Texture();  m_tlpResources[pos] = pTextureObject;running some debug tests around this (cause I'm not SO easy with table of pointers and the like, especially when heritage is involved), I checked successfully that SAFE_DELETE(m_tlpResources[lTextureIndex]); was effectively deleting the "lTextureIndex"e element of the table, which was passing to NULL afterwards, and did not harm the whole "m_tlpResources" table.could someone have a possible explanation to this ?thanks :)   ;  Hold on, I got it... sorry I cannot delete.IGraphicsReloadableObject was running with default destructor, so it was not virtual.all apologies for the long crappy post.   