   Why can't I make a not-fullscreen window?
  Hello!I've been working with direct3d for some time and I have always used the same code to make windows. I really have trouble understanding the winAPI so I decided to do a class that would create my window without I having to re-type 200 lines.my class contains these functions:bool RegisterWinClass(HINSTANCE hInstance, char* classname, WNDPROC ProcedureFunction);bool CreateWin(char* title, RECT winrect, bool fullscreen, bool console);Now when I create a window, I ask the user if he wants windowed or fullscreen and which resolution in messageboxes. If fullscreen is selected, I have no problem, all works perfectly. However, if I chose windowed, the console window I requested will appear but no sign of the window itself...I am almost sure my mistake is in CreateWin.Here's my code:bool D3DY::CD3DYWinManager::RegisterWinClass(HINSTANCE hInstance, char* classname, WNDPROC ProcedureFunction){if(m_hInstance) return true;if(!hInstance)  return false;m_hInstance=hInstance;m_hInstance = GetModuleHandle(NULL); // Grab An Instance For Our Windowm_strClassName=classname;WNDCLASSwc;wc.style    = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;// Redraw On Size, And Own DC For Window.wc.lpfnWndProc   = ProcedureFunction;// WndProc Handles Messageswc.cbClsExtra    = 0;// No Extra Window Datawc.cbWndExtra    = 0;// No Extra Window Datawc.hInstance= m_hInstance;// Set The Instancewc.hIcon    = LoadIcon(NULL, IDI_WINLOGO);// Load The Default Iconwc.hCursor  = LoadCursor(NULL, IDC_ARROW);// Load The Arrow Pointerwc.hbrBackground = NULL;// No Background Required For D3Dwc.lpszMenuName  = NULL;// We Don't Want A Menuwc.lpszClassName = m_strClassName.c_str();// Set The Class Nameif(!RegisterClass(&wc))// Attempt To Register The Window Class{MessageBox(NULL,"Failed To Register The Window Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);return false;}return true;}bool D3DY::CD3DYWinManager::CreateWin(char* title, RECT winrect, bool fullscreen, bool console){if(m_hDC) return true;m_strTitle=title;m_bFullscreen=fullscreen;DWORDdwExStyle; // Window Extended StyleDWORDdwStyle;   // Window Styleif(m_bFullscreen){dwExStyle=WS_EX_APPWINDOW; // Window Extended StyledwStyle=WS_POPUP;// Windows StyleShowCursor(FALSE);    // Hide Mouse Pointer}else{dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; // Window Extended StyledwStyle=WS_OVERLAPPEDWINDOW;   // Windows Style}AdjustWindowRectEx(&winrect, dwStyle, FALSE, dwExStyle); // Adjust Window To True Requested Sizem_Rect = winrect;// Create The Windowif(!(m_hWnd=CreateWindowEx(dwExStyle,// Extended Style For The Window   m_strClassName.c_str(),// Class Name   m_strTitle.c_str(),// Window Title   dwStyle |// Defined Window Style   WS_CLIPSIBLINGS |// Required Window Style   WS_CLIPCHILDREN,// Required Window Style   m_Rect.left, m_Rect.top,// Window Position   m_Rect.right-m_Rect.left,// Calculate Window Width   m_Rect.bottom-m_Rect.top,// Calculate Window Height   NULL,// No Parent Window   NULL,// No Menu   m_hInstance,// Instance   NULL)))// Dont Pass Anything To WM_CREATE{Release();MessageBox(NULL,"Could not create window.","ERROR",MB_OK|MB_ICONEXCLAMATION);return false;}if(!(m_hDC=GetDC(m_hWnd))) // Did We Get A Device Context?{Release();MessageBox(NULL,"Could not get device context.","ERROR",MB_OK|MB_ICONEXCLAMATION);return false;}if(console){AllocConsole();freopen( "CONOUT$", "w", stdout );}return true;}Note that the hInstance I use as the argument is the one I get with winMain()I have run the program line-by-line and all my error-checking code never fails.Do you see any problems with that code?   
  You need to add the line ShowWindow( ... ) to your created window.   ;Quote:Original post by Deception666You need to add the line ShowWindow( ... ) to your created window.Or specify WS_SHOW in CreateWindowEx:WS_CLIPSIBLINGS |// Required Window styleWS_SHOW  |// Window is visible when createdWS_CLIPCHILDREN,// Required Window styleSpecifying FullScreen effectively includes WS_SHOW so you didn't notice that, you may refer to MSDN for more infos.   