Liga
Liga

Reputation: 3439

Buttons look ugly on a Windows GUI app (instead of windows native)

I am making a simple Windows GUI app using C. But the UI elements looks very ugly (like from 1990) instead of the native Windows 7 controls that I would normally expect. Why is that? What do I need to do to get the native Windows 7 controls? (I'm using Windows 7)

Also I'm wondering about

  1. Why do the title bars look Windows 7 native (with transparency) instead of old style?
  2. But the rest of controls look old?

Here is my C program

#include <windows.h>

int STDCALL;

WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
{
    MessageBox (NULL, "Hello, Windows!", "Hello", MB_OK);
    return 0;
}

The result looks like the 2 windows on the top. But I'm expecting it to look like the one on the bottom.

enter image description here

Upvotes: 3

Views: 945

Answers (1)

Liga
Liga

Reputation: 3439

Thank you for the comments and pointing me in the right direction, I solved it by adding a appname.exe.manifest file and then re-compiling my program and it now has Windows 7 native style instead of the classic style.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0" processorArchitecture="*"
        name="CompanyName.ProductName.YourApplication" type="win32"/>
    <description>Your application description here.</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0" type="win32" processorArchitecture="*"
                publicKeyToken="6595b64144ccf1df" language="*"/>
        </dependentAssembly>
    </dependency>
</assembly>

Upvotes: 2

Related Questions