Board index » cppbuilder » How to turn off theming to a component
|
daryl
CBuilder Developer |
|
daryl
CBuilder Developer |
How to turn off theming to a component2006-01-28 09:42:19 AM cppbuilder46 What is the correct way to turn off theming on a particular control. from Microsoft help I got: SetWindowTheme (hwndButton, TEXT (" "), TEXT (" ")); I converted to, compiler was OK with it: SetWindowTheme (ProgressBar->Handle, (wchar_t*)(L""), (wchar_t*)(L"")); but I then got: [Linker Error] Unresolved external 'SetWindowTheme' referenced from D:\BORLAND\BUILDER_6\TESTING\SB_TEST\UNIT1.OBJ What am I doing wrong? thanks daryl |
| Clayton Arends
CBuilder Developer |
2006-01-28 12:12:41 PM
Re:How to turn off theming to a component
You will need to dynamically load the UxTheme.dll and useGetProcAddress to
access SetWindowTheme(). typedef HRESULT STDAPICALLTYPE (*TSetWindowTheme)( HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList); HINSTANCE dll = ::LoadLibrary("UxTheme.dll"); if (dll) { TSetWindowTheme setWindowTheme = (TSetWindowTheme) ::GetProcAddress(dll, "SetWindowTheme"); if (setWindowTheme) setWindowTheme(ProgressBar->Handle, L"", L""); ::FreeLibrary(dll); } HTH, - Clayton |
