How to disable visual style to the whole project
-
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 -
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 AtropoWhy 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.
-
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 Atropowhich version of visual studio are you using?
nave [OpenedFileFinder]
-
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.
> 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).
-
which version of visual studio are you using?
nave [OpenedFileFinder]
-
VS 2008. It includes application manifest; I thought it could be modified to disable visual styles, but I don't know how.
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]
-
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]