How to turn off Windows XP visual style
I I need to disable the visualstyle of a child window which is a rebar control.
Following is the code I use to achieve the same.
//This is declared globally
typedef void (CALLBACK* SETWINDOWTHEME)(HWND,LPCWSTR,LPCWSTR);
SETWINDOWTHEME pfnSetWindowTheme;
//This is what I do in the parent when I create the child window
m_RebarCtrl = new Crebar(hParent);
if(m_RebarCtrl)
{
HINSTANCE m_hInstTest = ::LoadLibrary(TEXT("D:\\WINDOWS\\system32\\UxTheme.dll"));
pfnSetWindowTheme= (SETWINDOWTHEME)GetProcAddress(m_hInstTest, TEXT("SetWindowTheme"));
if(!pfnSetWindowTheme)
{
::FreeLibrary(m_hInstTest);
}
else
{
pfnSetWindowTheme(m_RebarCtrl->m_hWnd,L" ",L" ");
::FreeLibrary(m_hInstTest);
}
}
I do get a valid m_hInstTest & pfnSetWindowTheme. But my rebar control still have the visual style applied.
Could anyone help me in this.Am I doing something wrong here?
Thanks in advance
Raj

