fix for x64 xtray
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 ****/
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user