title: Status bar control not resizing properly when using XP Visual Styles manifest
body: <p>In my program I created a status bar control and then set a new font for it.
  The problem I'm having is that when I include the XP Visual Styles
  manifest (i.e. Common controls 6.0), then the status bar is not resizing to match the new font size. </p>
  
  <p>e.g.</p>
  
  <pre><code>hGiantFont = CreateFont(-48, 0, 0, 0, FW_NORMAL, FALSE, FALSE,      
     FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
     CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH |    
     FF_DONTCARE, L"MS Shell Dlg 2");
  
  hStatusBar = CreateWindowEx ( 
     0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 
     0, 0, 0, 0, hWnd, (HMENU)666, hInst, NULL    
  );      
  
  SendMessage(hStatusBar, WM_SETFONT, (WPARAM)hGiantFont,  
     (LPARAM)MAKELONG(TRUE, 0));
  
  SendMessage(hStatusBar, WM_SIZE, 0, 0);
  </code></pre>
  
  <p>After executing the last line, nothing happens! It doesn't resize.
  Note that if I don't include the visual styles Manifest, it works fine!
  I've tried both InitCommonControls() and InitCommonControlsEX() with ICC_BAR_CLASSES to no avail.</p>
  
  <p>I've also tried using MoveWindow and SetWindowPos to change the size or move the status bar. With the visual styles manifest included, the status bar does not move, it seems glued to that specific size and location.</p>
  
  <p>Is this a bug in ComCtl32.dll 6.0? Or an extremely annoying intended feature. What is the work around?</p>
  
  <p>Also has anoyone else tried doing the same thing with successful results?</p>
  
  <p>Edit:</p>
  
  <p>Ok I've decided to include the whole program below, so people can try it out and see what I mean. It's just a bare basics Win32 app with a few lines added. If you comment out the #pragma manifest line at the top you'll notice it works as expected, and with the manifest line, the status bar doesn't resize.</p>
  
  <pre><code>// StupidStatusBar.cpp : Defines the entry point for the application.
  
  #pragma comment(linker,"\"/manifestdependency:type='win32' \
  name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
  processorArchitecture='*' publicKeyToken='6595b64144ccf1df'    language='*'\"") 
  
  #define WIN32_LEAN_AND_MEAN
  #include &lt;windows.h&gt;
  #include &lt;tchar.h&gt;
  #include &lt;commctrl.h&gt;
  #pragma comment(lib, "comctl32.lib")
  
  // Global Variables:
  HINSTANCE hInst;                                    
  wchar_t *szTitle = L"Stupid Status Bar";    
  wchar_t *szWindowClass = L"StupidClass";    
  
  // Forward declarations of functions included in this code module:
  ATOM                MyRegisterClass(HINSTANCE hInstance);
  BOOL                InitInstance(HINSTANCE, int);
  LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
  
  int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
  {
      MSG msg;
      INITCOMMONCONTROLSEX icex;
  
      icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
      icex.dwICC = ICC_WIN95_CLASSES;
  
      if(!InitCommonControlsEx(&amp;icex))
      {
          MessageBox(NULL, L"Error initializing common controls", L"Error", MB_OK);
          return 1;
      }
  
      MyRegisterClass(hInstance);
  
      // Perform application initialization:
      if (!InitInstance (hInstance, nCmdShow))
          return FALSE;
  
      // Main message loop:
      while (GetMessage(&amp;msg, NULL, 0, 0))
      {
          TranslateMessage(&amp;msg);
          DispatchMessage(&amp;msg);
      }
  
      return (int) msg.wParam;
  }   
  
  ATOM MyRegisterClass(HINSTANCE hInstance)
  {
      WNDCLASSEX wcex;
  
      wcex.cbSize = sizeof(WNDCLASSEX);
  
      wcex.style      = CS_HREDRAW | CS_VREDRAW;
      wcex.lpfnWndProc    = WndProc;
      wcex.cbClsExtra     = 0;
      wcex.cbWndExtra     = 0;
      wcex.hInstance      = hInstance;
      wcex.hIcon      = LoadIcon(NULL, IDI_APPLICATION);
      wcex.hCursor        = LoadCursor(NULL, IDC_ARROW);
      wcex.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
      wcex.lpszMenuName   = NULL;
      wcex.lpszClassName  = szWindowClass;
      wcex.hIconSm        = LoadIcon(NULL, IDI_APPLICATION);
  
      return RegisterClassEx(&amp;wcex);
  }
  
  BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
  {
     HWND hWnd;
  
     hInst = hInstance; // Store instance handle in our global variable
  
     hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
  
     if (!hWnd)
        return FALSE;
  
     ShowWindow(hWnd, nCmdShow);
     UpdateWindow(hWnd);
  
     return TRUE;
  }
  
  LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  {
      HWND hStatusBar;
      HFONT hGiantFont;
  
      switch (message)
      {
      case WM_CREATE:
          hGiantFont = CreateFont(-48, 0, 0, 0, FW_NORMAL, FALSE, FALSE,     FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
          CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"MS Shell Dlg 2");
  
          hStatusBar = CreateWindowEx ( 
              0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 
              0, 0, 0, 0, hWnd, (HMENU)666, hInst, NULL   
          );      
          SendMessage(hStatusBar, WM_SETFONT, (WPARAM)hGiantFont, (LPARAM)MAKELONG(TRUE, 0));
          SendMessage(hStatusBar, WM_SIZE, 0, 0);
          SetWindowText(hStatusBar, L"Testing Testing");
          break;
      case WM_DESTROY:
          PostQuitMessage(0);
          break;
      default:
          return DefWindowProc(hWnd, message, wParam, lParam);
      }
      return 0;
  }
  </code></pre>