Index: src/ch/Theme Helpers.cpp =================================================================== diff -u -r4c272b19c74694c428c943011f279ec064fbd894 -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 --- src/ch/Theme Helpers.cpp (.../Theme Helpers.cpp) (revision 4c272b19c74694c428c943011f279ec064fbd894) +++ src/ch/Theme Helpers.cpp (.../Theme Helpers.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) @@ -1,22 +1,21 @@ -/************************************************************************ - Copy Handler 1.x - program for copying data in Microsoft Windows - systems. - Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*************************************************************************/ +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ #include "stdafx.h" #include "Theme Helpers.h" @@ -38,6 +37,8 @@ HTHEME CUxThemeSupport::OpenThemeData(HWND hwnd, LPCWSTR pszClassList) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return NULL; PFNOPENTHEMEDATA pfnProc=(PFNOPENTHEMEDATA)GetProcAddress(m_hThemesDll, "OpenThemeData"); @@ -50,6 +51,8 @@ HRESULT CUxThemeSupport::CloseThemeData(HTHEME hTheme) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return E_FAIL; PFNCLOSETHEMEDATA pfnProc=(PFNCLOSETHEMEDATA)GetProcAddress(m_hThemesDll, "CloseThemeData"); @@ -62,6 +65,8 @@ HRESULT CUxThemeSupport::DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pDestRect, UINT uEdge, UINT uFlags, RECT* pContentRect) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return E_FAIL; PFNDRAWTHEMEEDGE pfnProc=(PFNDRAWTHEMEEDGE)GetProcAddress(m_hThemesDll, "DrawThemeEdge"); @@ -74,6 +79,8 @@ HRESULT CUxThemeSupport::DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return E_FAIL; PFNDRAWTHEMEBACKGROUND pfnProc=(PFNDRAWTHEMEBACKGROUND)GetProcAddress(m_hThemesDll, "DrawThemeBackground"); @@ -86,6 +93,8 @@ HRESULT CUxThemeSupport::DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return E_FAIL; PFNDRAWTHEMEPARENTBACKGROUND pfnProc=(PFNDRAWTHEMEPARENTBACKGROUND)GetProcAddress(m_hThemesDll, "DrawThemeParentBackground"); @@ -98,6 +107,8 @@ BOOL CUxThemeSupport::IsAppThemed() { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return FALSE; PFNISAPPTHEMED pfnProc=(PFNISAPPTHEMED)GetProcAddress(m_hThemesDll, "IsAppThemed");