Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to disable visual style to the whole project

How to disable visual style to the whole project

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Atropus
    wrote on last edited by
    #1

    Hi. I need to disable visual style to a MFC project; that is, no window had to be rendered with visual style. I've tried the code SetWindowTheme(m_hWnd, L" ", L" "); in the MainFrame, but it removes the style to only the title bar. The application is SDI with a single view and I've tried to use the above line even in the OnInitialUpdate handler, but seems it doesn't work. Any hint? Thanks Atropo

    B N 2 Replies Last reply
    0
    • A Atropus

      Hi. I need to disable visual style to a MFC project; that is, no window had to be rendered with visual style. I've tried the code SetWindowTheme(m_hWnd, L" ", L" "); in the MainFrame, but it removes the style to only the title bar. The application is SDI with a single view and I've tried to use the above line even in the OnInitialUpdate handler, but seems it doesn't work. Any hint? Thanks Atropo

      B Offline
      B Offline
      BadKarma
      wrote on last edited by
      #2

      Why do you need to do this? Can't you use a console application? Or is it just one single window, then again what do you want to do with it? Because the only use of an invisible window is to receive events. And this can be done by creating a CWnd dummy object. Please clarify your needs.

      Learn from the mistakes of others, you may not live long enough to make them all yourself.

      A 1 Reply Last reply
      0
      • A Atropus

        Hi. I need to disable visual style to a MFC project; that is, no window had to be rendered with visual style. I've tried the code SetWindowTheme(m_hWnd, L" ", L" "); in the MainFrame, but it removes the style to only the title bar. The application is SDI with a single view and I've tried to use the above line even in the OnInitialUpdate handler, but seems it doesn't work. Any hint? Thanks Atropo

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        which version of visual studio are you using?

        nave [OpenedFileFinder]

        A 1 Reply Last reply
        0
        • B BadKarma

          Why do you need to do this? Can't you use a console application? Or is it just one single window, then again what do you want to do with it? Because the only use of an invisible window is to receive events. And this can be done by creating a CWnd dummy object. Please clarify your needs.

          Learn from the mistakes of others, you may not live long enough to make them all yourself.

          A Offline
          A Offline
          Atropus
          wrote on last edited by
          #4

          > Why do you need to do this? 'Cause with visual styles, the appearence of the application's controls (sizes, position, ecc.) changes. > Can't you use a console application? :wtf: :confused: No! I need to use a GUI application!!! >Or is it just one single window, then again what do you want to do with it? Because the only use of an invisible window is to receive events. And this can be done by creating a CWnd dummy object. > Please clarify your needs. It shouldn't matter. I simply need a window that is rendered with the basic visual style (classic Windows XP style).

          1 Reply Last reply
          0
          • N Naveen

            which version of visual studio are you using?

            nave [OpenedFileFinder]

            A Offline
            A Offline
            Atropus
            wrote on last edited by
            #5

            VS 2008. It includes application manifest; I thought it could be modified to disable visual styles, but I don't know how.

            N 1 Reply Last reply
            0
            • A Atropus

              VS 2008. It includes application manifest; I thought it could be modified to disable visual styles, but I don't know how.

              N Offline
              N Offline
              Naveen
              wrote on last edited by
              #6

              If you open the stdafx.h, you can find some statements like... #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") Comment it all. Doing so will prevent your application from creating a manifest file that have dependency with comctrl version 6.

              nave [OpenedFileFinder]

              A 1 Reply Last reply
              0
              • N Naveen

                If you open the stdafx.h, you can find some statements like... #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") Comment it all. Doing so will prevent your application from creating a manifest file that have dependency with comctrl version 6.

                nave [OpenedFileFinder]

                A Offline
                A Offline
                Atropus
                wrote on last edited by
                #7

                :-D It works!!! Thanks a lot!!!!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups