summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorberkeviktor@aol.com <berkeviktor@aol.com>2010-04-04 04:06:25 +0200
committerberkeviktor@aol.com <berkeviktor@aol.com>2010-04-04 04:06:25 +0200
commit3fab4f0d7dc92e70e5f0e6273d75df8c4d972a61 (patch)
tree2c19ff2f2f487567ea8a1718c9499930438636ca
parent5607488e9f64c0190da57e82ea26b85086446197 (diff)
fix for x64 xtray
-rw-r--r--config.h2
-rw-r--r--plugins/xtray/utility.cpp16
-rw-r--r--plugins/xtray/xtray.cpp20
-rw-r--r--plugins/xtray/xtray.h9
-rw-r--r--xchat-wdk.patch12
5 files changed, 32 insertions, 27 deletions
diff --git a/config.h b/config.h
index 15247bc2..127b7e6d 100644
--- a/config.h
+++ b/config.h
@@ -3,7 +3,7 @@
 #define USE_GMODULE
 #define USE_PLUGIN
 #define PACKAGE_NAME "xchat"
-#define PACKAGE_VERSION "r1409-7"
+#define PACKAGE_VERSION "r1409-8"
 #define XCHATLIBDIR "."
 #define XCHATSHAREDIR "."
 #define OLD_PERL
diff --git a/plugins/xtray/utility.cpp b/plugins/xtray/utility.cpp
index 909517df..dd9dd29f 100644
--- a/plugins/xtray/utility.cpp
+++ b/plugins/xtray/utility.cpp
@@ -321,24 +321,16 @@ void CheckPrefs(HWND hwnd, int iDlg)
 				DWORD dwStyle;

 				dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);

 				dwStyle |= (1<<WS_CHILD);

-				SetWindowLong(g_hXchatWnd, GWL_STYLE, dwStyle);

-#ifdef _WIN64

-				SetWindowLong(g_hXchatWnd, GWLP_HWNDPARENT, (long)g_hHotkeyWnd);

-#else

-				SetWindowLong(g_hXchatWnd, GWL_HWNDPARENT, (long)g_hHotkeyWnd);

-#endif

+				SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);

+				SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, (LONG_PTR)g_hHotkeyWnd);

 			}

 			else

 			{

 				DWORD dwStyle;

 				dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);

 				dwStyle &= ~(1<<WS_CHILD);

-				SetWindowLong(g_hXchatWnd, GWL_STYLE, dwStyle);

-#ifdef _WIN64

-				SetWindowLong(g_hXchatWnd, GWLP_HWNDPARENT, NULL);

-#else

-				SetWindowLong(g_hXchatWnd, GWL_HWNDPARENT, NULL);

-#endif

+				SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);

+				SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, NULL);

 			}

 		}

 		break;

diff --git a/plugins/xtray/xtray.cpp b/plugins/xtray/xtray.cpp
index 688464ff..c9f1bd5e 100644
--- a/plugins/xtray/xtray.cpp
+++ b/plugins/xtray/xtray.cpp
@@ -93,7 +93,7 @@ int xchat_plugin_init(xchat_plugin *plugin_handle, char **plugin_name, char **pl
 	}

 

 	g_hOldProc	= (WNDPROC)GetWindowLongPtr(g_hXchatWnd, GWLP_WNDPROC);

-	SetWindowLong(g_hXchatWnd, GWLP_WNDPROC, (long)WindowProc);

+	SetWindowLongPtr(g_hXchatWnd, GWLP_WNDPROC, (LONG_PTR)WindowProc);

 

 	/***************************************************************************************************************************/	

 	/************************* Grab the xChat Icon, Load our menu, create the window to receive the hotkey messages  ***********/

@@ -127,12 +127,8 @@ int xchat_plugin_init(xchat_plugin *plugin_handle, char **plugin_name, char **pl
 		DWORD dwStyle;

 		dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);

 		dwStyle |= (1<<WS_CHILD);

-		SetWindowLong(g_hXchatWnd, GWL_STYLE, dwStyle);

-#ifdef _WIN64

-		SetWindowLong(g_hXchatWnd, GWLP_HWNDPARENT, (long)g_hHotkeyWnd);

-#else

-		SetWindowLong(g_hXchatWnd, GWL_HWNDPARENT, (long)g_hHotkeyWnd);

-#endif

+		SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);

+		SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, (LONG_PTR)g_hHotkeyWnd);

 	}

 

 	/***************************************************************************************************************************/

@@ -171,12 +167,8 @@ int xchat_plugin_deinit(xchat_plugin *plugin_handle)
 		DWORD dwStyle;

 		dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);

 		dwStyle &= ~(1<<WS_CHILD);

-		SetWindowLong(g_hXchatWnd, GWL_STYLE, dwStyle);

-#ifdef _WIN64

-		SetWindowLong(g_hXchatWnd, GWLP_HWNDPARENT, NULL);

-#else

-		SetWindowLong(g_hXchatWnd, GWL_HWNDPARENT, NULL);

-#endif

+		SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);

+		SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, NULL);

 	}

 

 	/******************************************/

@@ -192,7 +184,7 @@ int xchat_plugin_deinit(xchat_plugin *plugin_handle)
 	/******************************************/

 	/****** Remove our window hook ************/

 	/******************************************/

-	SetWindowLong(g_hXchatWnd, GWLP_WNDPROC, (long)g_hOldProc);

+	SetWindowLongPtr(g_hXchatWnd, GWLP_WNDPROC, (LONG_PTR)g_hOldProc);

 

 	/******************************************/

 	/****** Remove our hotkey, and destroy ****/

diff --git a/plugins/xtray/xtray.h b/plugins/xtray/xtray.h
index 2f964860..21ec67a2 100644
--- a/plugins/xtray/xtray.h
+++ b/plugins/xtray/xtray.h
@@ -63,3 +63,12 @@ extern struct _xchat_plugin *ph;
 #define PREF_DNSIT				20 // Do not show in taskbar

 /******************************************************/

 #endif

+

+#ifdef _WIN64

+/* use replacement with the same value, and use SetWindowLongPtr instead

+   of SetWindowLong. more info:

+

+   http://msdn.microsoft.com/en-us/library/ms633591.aspx

+   http://msdn.microsoft.com/en-us/library/ms644898.aspx */

+#define GWL_HWNDPARENT GWLP_HWNDPARENT

+#endif

diff --git a/xchat-wdk.patch b/xchat-wdk.patch
index 3b47222e..39698ad2 100644
--- a/xchat-wdk.patch
+++ b/xchat-wdk.patch
@@ -508,6 +508,18 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/xchat.h xchat-wdk/src/co
  #include <direct.h>
  #define	F_OK	0
  #define	X_OK	1
+diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/about.c xchat-wdk/src/fe-gtk/about.c
+--- xchat-wdk.orig/src/fe-gtk/about.c	2008-06-08 09:58:58 +0200
++++ xchat-wdk/src/fe-gtk/about.c	2010-04-02 10:27:10 +0200
+@@ -119,7 +119,7 @@
+ 				"%s\n\n"
+ #ifdef WIN32
+ 				/* leave this message to avoid time wasting bug reports! */
+-				"This version is unofficial and comes with no support.\n\n"
++				"This version is unofficial and\ncomes with no support.\n\n"
+ #endif
+ 				"%s\n"
+ 				"<b>Charset</b>: %s "
 diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/banlist.c xchat-wdk/src/fe-gtk/banlist.c
 --- xchat-wdk.orig/src/fe-gtk/banlist.c	2008-09-01 11:28:58 +0200
 +++ xchat-wdk/src/fe-gtk/banlist.c	2010-03-29 12:59:40 +0200