Thread: Getting the XP look

  1. #1
    Registered User pronecracker's Avatar
    Join Date
    Oct 2006
    Location
    netherlands
    Posts
    158

    Getting the XP look

    I'm using DevC++ as my IDE with GCC as compiler, but my question in general is: how do I give controls the XP look - if XP is the OS and XP look is on.
    In DevCpp there's an option called "support windows XP themes" but that doesn't work for me - all my controls and messageboxes disappear when I switch this on.
    The option works with some manifest file included as resource, but if I include it or have it in the same directory I see nothing at all.
    Anyone know what's the right way to do this?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Can you give us an example? Perhaps a tiny program that compiles and runs?
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    are you talking about getting the actually IDE to look like XP or your program your developing?
    the option you mentioned is referring to the actually IDE. the option works fine for me.
    if your creating a program on windows they should automatically look like 'XP' (if of course, as you said the option is on)

    can you clarify what it is your referring to?

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    13
    I have never used DevC++ before, so I don't know how to add a manifest file into the resources of the application, but someone on these forums surely knows. All I know is that it should contain this to enable XP-styles:

    Code:
    <?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="X86" 
      name="Application" 
      type="win32"
     /> 
     
     <description></description> 
     <dependency> 
      <dependentAssembly> 
       <assemblyIdentity 
        type="win32" 
        name="Microsoft.Windows.Common-Controls" 
        version="6.0.0.0" 
        processorArchitecture="X86" 
        publicKeyToken="6595b64144ccf1df" 
        language="*" 
       />
      </dependentAssembly> 
     </dependency> 
    </assembly>
    Last edited by feso4; 11-18-2006 at 04:42 PM.

  5. #5
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Moved to windows.

    ***

    Using Windows XP Visual Styles.

    Search the windows board, too, as this has been discussed often in the past.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  6. #6
    Registered User Ktulu's Avatar
    Join Date
    Oct 2006
    Posts
    107
    Enabling the Windows XP look in the project options should work without problems.
    This parameter is reserved

  7. #7
    Registered User pronecracker's Avatar
    Join Date
    Oct 2006
    Location
    netherlands
    Posts
    158
    yeah but it doesn't work of course that's why i'm posting it here. I will try the assembly file you sent me.

  8. #8
    Insane Game Developer Nodtveidt's Avatar
    Join Date
    Nov 2006
    Location
    Isabela, PR
    Posts
    105
    You have to use the manifest (either as a file or as a resource) as well as InitCommonControls. Both are required for the XP look, you can't skip either step.
    Code:
    cout << "Language comparisons are dumb";
    echo("Language comparisons are dumb");
    PRINT "Language comparisons are dumb"
    alert ("Language comparisons are dumb")

  9. #9
    Registered User pronecracker's Avatar
    Join Date
    Oct 2006
    Location
    netherlands
    Posts
    158

    sorry for the *long* delay XD

    Quote Originally Posted by Nodtveidt View Post
    You have to use the manifest (either as a file or as a resource) as well as InitCommonControls. Both are required for the XP look, you can't skip either step.
    I'm not using any common controls. Is linking comctl32.lib really required to make normal buttons look XP-like??

    I found out that my IDE is not the culprit. When using Dev-C++ to create a manifest file (whether I include it as a resource doesn't make a difference I think), it doesn't work. Instead, every messagebox and control is gone!
    I decided to switch to Code::Blocks. Same problem. With a manifest (created by Code::Blocks
    plugin this time), everything is gone. I think this is a problem with my computer. I'm desperate!
    Can anyone advise?

  10. #10
    Registered User pronecracker's Avatar
    Join Date
    Oct 2006
    Location
    netherlands
    Posts
    158
    Maybe this whole thread is just confirming my stupidity, but now my conclusion is:

    To get the standard controls in your program to have the XP look, you need to link commctrl.lib, no matter that you do not use any common controls and you didn't need commctrl before.
    Is that correct?

    Edit: maybe it's pretty much what you said

  11. #11
    Registered User pronecracker's Avatar
    Join Date
    Oct 2006
    Location
    netherlands
    Posts
    158
    You're absolutely right, calling InitCommonControls just works
    Don't call me stupid.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 05-07-2009, 11:31 AM
  2. Trying to Install XP over Vista with SATA HD
    By Shamino in forum Tech Board
    Replies: 2
    Last Post: 12-13-2008, 06:56 PM
  3. Need help with program
    By HAssan in forum C Programming
    Replies: 8
    Last Post: 06-10-2007, 08:05 PM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. Windows XP regression over time
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 12-17-2002, 10:49 AM