diff options
Diffstat (limited to 'plugins/SendScreenshotPlus/src')
| -rw-r--r-- | plugins/SendScreenshotPlus/src/ctrl_button.cpp | 63 | ||||
| -rw-r--r-- | plugins/SendScreenshotPlus/src/ctrl_button.h | 13 | ||||
| -rw-r--r-- | plugins/SendScreenshotPlus/src/global.h | 2 | 
3 files changed, 9 insertions, 69 deletions
diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp index 7a3b2b5380..152e3b17db 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp +++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp @@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA	02111-1307, USA.  #define BUTTON_POLLID			 100
  #define BUTTON_POLLDELAY		50
 -#define MGPROC(x) GetProcAddress(themeAPIHandle,x)
 -
  typedef struct TMBCtrl{
  	HWND		hwnd;
  	HANDLE		hThemeButton;
 @@ -47,53 +45,6 @@ typedef struct TMBCtrl{  // External theme methods and properties
  CRITICAL_SECTION csTips;
  HWND hwndToolTips = NULL;
 -HMODULE	themeAPIHandle = NULL;
 -
 -// theme procedures
 -HANDLE	(WINAPI *OpenThemeData)(HWND,LPCWSTR);
 -HRESULT	(WINAPI *CloseThemeData)(HANDLE);
 -BOOL	(WINAPI *IsThemeBackgroundPartiallyTransparent)(HANDLE,INT,INT);
 -HRESULT	(WINAPI *DrawThemeParentBackground)(HWND,HDC,RECT *);
 -HRESULT	(WINAPI *DrawThemeBackground)(HANDLE,HDC,INT,INT,const RECT *,const RECT *);
 -HRESULT	(WINAPI *DrawThemeText)(HANDLE,HDC,INT,INT,LPCWSTR,INT,DWORD,DWORD,const RECT *);
 -HRESULT	(WINAPI *GetThemeTextExtent)(HANDLE,HDC,INT,INT,LPCWSTR,INT,DWORD,OPTIONAL const RECT*, RECT *);
 -HRESULT	(WINAPI *GetThemeBackgroundRegion)(HANDLE,HDC,INT,INT,const RECT *,HRGN *);
 -
 -/**
 - * name:	ThemeSupport
 - * desc:	Loads the uxtheme functions, if supported by the os
 - * param:	none
 - * return:	TRUE if themes are supported, FALSE if not
 - **/
 -BOOLEAN __fastcall ThemeSupport() {
 -	if (IsWinVerXPPlus()) {
 -		if (!themeAPIHandle) {
 -			themeAPIHandle = GetModuleHandleA("uxtheme");
 -			if (themeAPIHandle) {
 -				OpenThemeData = (HANDLE (WINAPI *)(HWND,LPCWSTR))MGPROC("OpenThemeData");
 -				CloseThemeData = (HRESULT (WINAPI *)(HANDLE))MGPROC("CloseThemeData");
 -				IsThemeBackgroundPartiallyTransparent = (BOOL (WINAPI *)(HANDLE,INT,INT))MGPROC("IsThemeBackgroundPartiallyTransparent");
 -				DrawThemeParentBackground = (HRESULT (WINAPI *)(HWND,HDC,RECT *))MGPROC("DrawThemeParentBackground");
 -				DrawThemeBackground = (HRESULT (WINAPI *)(HANDLE,HDC,INT,INT,const RECT *,const RECT *))MGPROC("DrawThemeBackground");
 -				DrawThemeText = (HRESULT (WINAPI *)(HANDLE,HDC,INT,INT,LPCWSTR,INT,DWORD,DWORD,const RECT *))MGPROC("DrawThemeText");
 -				GetThemeTextExtent = (HRESULT (WINAPI *)(HANDLE,HDC,INT,INT,LPCWSTR,INT,DWORD,OPTIONAL const RECT*, RECT *))MGPROC("GetThemeTextExtent");
 -				GetThemeBackgroundRegion = (HRESULT (WINAPI *)(HANDLE,HDC,INT,INT,const RECT *,HRGN *))MGPROC("GetThemeBackgroundRegion");
 -			}
 -		}
 -		// Make sure all of these methods are valid (i would hope either all or none work)
 -		if (OpenThemeData
 -			&& CloseThemeData
 -			&& IsThemeBackgroundPartiallyTransparent
 -			&& DrawThemeParentBackground
 -			&& DrawThemeBackground
 -			&& DrawThemeText
 -			&& GetThemeTextExtent)
 -		{
 -			return TRUE;
 -		}
 -	}
 -	return FALSE;
 -}
  /**
   * name:	DestroyTheme
 @@ -101,7 +52,8 @@ BOOLEAN __fastcall ThemeSupport() {   * param:	ctl - BTNCTRL structure with the information about the theme to close
   * return:	nothing
   **/
 -static VOID __fastcall DestroyTheme(BTNCTRL *ctl) {
 +static VOID __fastcall DestroyTheme(BTNCTRL *ctl)
 +{
  	if (ctl->hThemeButton) {
  		CloseThemeData(ctl->hThemeButton);
  		ctl->hThemeButton = NULL;
 @@ -118,12 +70,11 @@ static VOID __fastcall DestroyTheme(BTNCTRL *ctl) {   * param:	ctl - BTNCTRL structure with the information about the theme to load
   * return:	nothing
   **/
 -static VOID __fastcall LoadTheme(BTNCTRL *ctl) {
 -	if (ThemeSupport()) {
 -		DestroyTheme(ctl);
 -		ctl->hThemeButton = OpenThemeData(ctl->hwnd,L"BUTTON");
 -		ctl->hThemeToolbar = OpenThemeData(ctl->hwnd,L"TOOLBAR");
 -	}
 +static VOID __fastcall LoadTheme(BTNCTRL *ctl)
 +{
 +	DestroyTheme(ctl);
 +	ctl->hThemeButton = OpenThemeData(ctl->hwnd,L"BUTTON");
 +	ctl->hThemeToolbar = OpenThemeData(ctl->hwnd,L"TOOLBAR");
  }
  /**
 diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.h b/plugins/SendScreenshotPlus/src/ctrl_button.h index dc77334b05..0e4106460d 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.h +++ b/plugins/SendScreenshotPlus/src/ctrl_button.h @@ -24,20 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA	02111-1307, USA.  #ifndef _UINFOEX_BOTTONS_H_INCLUDED_
  #define _UINFOEX_BOTTONS_H_INCLUDED_ 1
 -// theme procedures
 -extern HANDLE	(WINAPI *OpenThemeData)(HWND,LPCWSTR);
 -extern HRESULT	(WINAPI *CloseThemeData)(HANDLE);
 -extern BOOL		(WINAPI *IsThemeBackgroundPartiallyTransparent)(HANDLE,INT,INT);
 -extern HRESULT	(WINAPI *DrawThemeParentBackground)(HWND,HDC,RECT *);
 -extern HRESULT	(WINAPI *DrawThemeBackground)(HANDLE,HDC,INT,INT,const RECT *,const RECT *);
 -extern HRESULT	(WINAPI *DrawThemeText)(HANDLE,HDC,INT,INT,LPCWSTR,INT,DWORD,DWORD,const RECT *);
 -extern HRESULT	(WINAPI *GetThemeTextExtent)(HANDLE,HDC,INT,INT,LPCWSTR,INT,DWORD,OPTIONAL const RECT*, RECT *);
 -extern HRESULT	(WINAPI *GetThemeBackgroundRegion)(HANDLE,HDC,INT,INT,const RECT *,HRGN *);
 -
 -
  VOID CtrlButtonLoadModule();
  VOID CtrlButtonUnloadModule();
 -BOOLEAN __fastcall ThemeSupport();
 -
  #endif /* _UINFOEX_BOTTONS_H_INCLUDED_ */
\ No newline at end of file diff --git a/plugins/SendScreenshotPlus/src/global.h b/plugins/SendScreenshotPlus/src/global.h index cb1a374d0e..60a9cc05c6 100644 --- a/plugins/SendScreenshotPlus/src/global.h +++ b/plugins/SendScreenshotPlus/src/global.h @@ -40,6 +40,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  #include <Shlwapi.h>
  #include <gdiplus.h>
  #include <mapi.h>
 +#include <UxTheme.h>
 +
  #include <map>
  #include <string>
  using namespace std;
  | 
