0

My problem is regarding the look and feel of my dialog.

First, I enabled this source code on stdafx.h:

//#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
//#endif

Then, on my problematic dialog's OnInitDialog(), I added this:

#include "Uxtheme.h"

if (IsAppThemed())
{
    EnableThemeDialogTexture(*this, ETDT_ENABLETAB);
}

The purpose of this is to theme also the CTabCtrl on my dialog.

Now, when I build the project, it shows error:

LNK2001 unresolved extenal symbol __imp__IsAppThemed@0
LNK2001 unresolved extenal symbol __imp__EnableThemeDialogTexture@8

What other things am I missing for this "theming" to properly work?

  • Documentation for `IsAppThemed` shows that it needs `UxTheme.lib`. Add the library in project manager, or add this in any file `#pragma comment(lib, "UxTheme.lib")` – Barmak Shemirani Aug 08 '18 at 09:11
  • @BarmakShemirani thanks for pointing out `#pragma comment`. I didn't know before that aside from `#include` there needs to be something else to "include" the external library. Thanks again! – Shawn Mogensen Aug 08 '18 at 23:52
  • You are welcome. By the way `#pragma comment...` is specific to Visual Studio. I think `EnableThemeDialogTexture` applies to Windows XP only, XP is no longer supported by Microsoft. – Barmak Shemirani Aug 09 '18 at 04:02

0 Answers0