title: Customizing Win32's Save File Dialog
body: <p>I am trying to save a file using <code>GetSaveFileName</code> and want to have a couple extra popups at the bottom of my save file dialog to allow the user to specify further options. I am trying to follow the <a href="http://msdn.microsoft.com/en-us/library/ms646960%28VS.85%29.aspx#_win32_Open_and_Save_As_Dialog_Box_Customization" rel="nofollow noreferrer">MSDN documentation</a> (specifically the <a href="http://msdn.microsoft.com/en-us/library/ms646960%28VS.85%29.aspx#_win32_Explorer_Style_Hook_Procedures" rel="nofollow noreferrer">Explorer-style customization</a>) on the subject but can't seem to get my custom item to appear. I believe I set up the <code>OPENFILENAME</code> struct properly as I'm getting calls into my <code>OFNHookProc</code>. As far as I know it is during the <code>WM_INITDIALOG</code> message that I should be creating my subcontrols, which is what I'm doing:</p>
  
  <pre><code>HWND settings_popup =
      ::CreateWindowExW(WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY,
                        L"COMBOBOX",
                        L"Settings:",
                        WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL | WS_BORDER | CBS_DROPDOWNLIST,
                        10,
                        10,
                        150,
                        30,
                        dialog, // the window parameter from the OFNHookProc
                        NULL,
                        ::GetModuleHandle(NULL),
                        NULL);
  
  if (settings_popup)
  {
      HWND parent = ::GetParent(settings_popup); // for verification
      ::ShowWindow(settings_popup, SW_SHOW);
      ::EnableWindow(settings_popup, true);
  }
  </code></pre>
  
  <p>I also return 1 from my <code>OFNHookProc</code> for the <code>WM_INITDIALOG</code> message and 0 for everything else.</p>
  
  <p>In all my attempts to get the combobox to show in the dialog, it's not coming up. What am I missing from my code to make the combobox a part of my save file dialog customization?</p>