Help With Windows 7 Controls

Hello all :)

I need a little assistance with a problem I'm having. I'm trying to develop a simple Win32 program that has a group-box control. The program starts normally, but the controls look like they're from Windows '95. I've Searched about 20 to 30 sites about this issue, but nothing seems to work.

So far, I've had minimal success. I've done the following:

1.) Created a manifest file with the information Windows needs to load the necessary libraries.

2.) Created a resource file with this line: 1 24 "Manifest.xml"
3.) Linked my application with the DLL needed.
4.) Ensured WINVER >= 0x501, _WIN32_WINNT >= 0x501, and_WIN32_IE >= 0x900
5.) Loaded the controls with InitCommonControlsEx( ), which succeeds.

As I said, the program compiles just fine and the controls appear, but they look outdated. For example, the group-box I created has rounded edges, but the text looks like command prompts font with a grey background.

The strange thing is, however, that I also created a button, but the style of the button is the same as the Windows 7 theme, but the text on the button has the same problem as the group box's font.

Any help is greatly appreciated as at the moment, I'm at a loss.

Thank you :)
Thank you for the reply, Kind9. I tried following that guide previously, but to no avail. The controls still look partially loaded or as of they're not loaded correctly. I'll upload a screenshot as soon as I can.

Regards,
I guess I should have read your first post more thoroughly... Do you use MSVC and did you try the pragma directive from that page?

1
2
3
#pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 


^ This always did the trick for me.

Other than that I don't know what the problem could be. I'm sure someone else here will know better.
Sorry, I didn't specify my compiler. I'm using MinGW, version 4.6, I think. I tried using the pragma directive, however, the compiler said that it was being ignored because it didn't recognise it. I do believe that pragma is MSC specific, though.

Thank you for the assistance, regardless, Kind9.

Edit: Here's a picture of what's going on:
http://postimg.org/image/r1u0l57cn/

Regards,
Last edited on
Yes, I had some problem with this as well. The answer is actually very simple. It's *all* about the manifest file, you do not need to add / edit your source code in any way.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

  <!--This is information about your program-->
  <assemblyIdentity type="win32"
                    name="myOrganization.myDivision.mySampleApp"
                    version="0.1.2.3"
                    processorArchitecture="*"
                    publicKeyToken="0000000000000000"
  />
  
  <!--Compatibility information about your program-->
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!--This Id value indicates the application supports Windows Vista functionality -->
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
      <!--This Id value indicates the application supports Windows 7 functionality-->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
      <!--This Id value indicates the application supports Windows 8 functionality-->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
      <!--This Id value indicates the application supports Windows 8.1 functionality-->
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
      <!--This Id value indicates the application supports Windows 10 functionality-->
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
    </application>
  </compatibility>

  <!--This dependancy is for Microsoft Windows Common Controls (Windows Vista+ styles)-->
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32"
                        name="Microsoft.Windows.Common-Controls"
                        version="6.0.0.0"
                        processorArchitecture="*"
                        publicKeyToken="6595b64144ccf1df"
                        language="*"
      />
    </dependentAssembly>
  </dependency>

  <!--This is the description of the program-->
  <description>DESRIPTION HERE</description>
  
</assembly>


That is the XML manifest which is linked in when compiled. I made an example to use myself, it also contains compatibility support and description. Use the link from Kind9 to read up more.

I find MSDN useful, but also you tend to come out with more questions... Good luck!

P.S/ A little side note: You can change the asterisks as they are or specify them for every build. I am not sure if it is correct, but I just leave them as asterisks.
Last edited on
Thank you, Jack Hammered. I tried your manifest, but it still didn't work. The whole battle really isn't worth result. As a result, I'll be switching to Visual C++ and hope it loads properly using that. Thank you to all who helped me, however. It's really appreciated.

Regards,
VS really makes it easier to develop Windows apps so I think you're doing yourself a favor.
Topic archived. No new replies allowed.