fbrereto
fbrereto

Reputation: 35925

Customized Windows Save Dialog is no Longer Fancy -- Why?

In accordance with this question I am customizing a Win32 Save File dialog with a custom template description. Now I have a problem where the Save File dialog doesn't show the left-hand bar with my computer, recent places, etc. I can confirm that removing the custom template brings the left-hand sidebar back. What am I doing that warrants its removal? How do I get both?

Update: Here's some of the code I have:

info.hInstance = MyGetModuleInstanceRoutine();
info.lpfnHook = MyOFNHookProcRoutine;
info.lpTemplateName = MAKEINTRESOURCEW(myCustomResourceID);
info.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_NOREADONLYRETURN |
              OFN_ENABLESIZING | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLETEMPLATE;

::GetSaveFileNameW(&info);

Notes:

Upvotes: 2

Views: 485

Answers (2)

Mark Ransom
Mark Ransom

Reputation: 308111

Adding to the answer from RED SOFT ADAIR-StefanWoe:

Set WINVER and _WIN32_WINNT to a value >= 0x0500.

The size of the OPENFILENAME structure grew for Windows 2000, and the extra space includes the FlagsEx member; apparently Windows assumes the flag OFN_EX_NOPLACESBAR if the structure is too small to contain it. Make sure the lStructSize member is set correctly too.

Upvotes: 1

RED SOFT ADAIR
RED SOFT ADAIR

Reputation: 12218

Try using

#define _WIN32_WINNT 0x0501 

before

#include "windows.h"

That accidentally solved the same problem for me.

Upvotes: 1

Related Questions