From 6ec31f4f8540ba52ec51f63c6e64cd9cff4604d9 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 8 Jun 2015 09:07:41 +0200 Subject: [PATCH] avoid x64 pointer issues, leading to crash on tab resorting --- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index bcb9aa207..372dbf588 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -152,7 +152,7 @@ void TabBar::activateAt(int index) const TBHDR nmhdr; nmhdr.hdr.hwndFrom = _hSelf; nmhdr.hdr.code = TCN_SELCHANGE; - nmhdr.hdr.idFrom = reinterpret_cast(this); + nmhdr.hdr.idFrom = reinterpret_cast(this); nmhdr.tabOrigin = index; } @@ -339,7 +339,7 @@ void TabBarPlus::doOwnerDrawTab() { if (_hwndArray[i]) { - DWORD style = ::GetWindowLongPtr(_hwndArray[i], GWL_STYLE); + LONG_PTR style = ::GetWindowLongPtr(_hwndArray[i], GWL_STYLE); if (isOwnerDrawTab()) style |= TCS_OWNERDRAWFIXED; else @@ -405,9 +405,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara // Custom window message to change tab control style on the fly case WM_TABSETSTYLE: { - DWORD style; - //::SendMessage(upDownWnd, UDM_SETBUDDY, NULL, 0); - style = ::GetWindowLongPtr(hwnd, GWL_STYLE); + LONG_PTR style = ::GetWindowLongPtr(hwnd, GWL_STYLE); if (wParam > 0) style |= lParam; @@ -463,7 +461,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara TBHDR nmhdr; nmhdr.hdr.hwndFrom = _hSelf; nmhdr.hdr.code = NM_CLICK; - nmhdr.hdr.idFrom = reinterpret_cast(this); + nmhdr.hdr.idFrom = reinterpret_cast(this); nmhdr.tabOrigin = currentTabOn; ::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast(&nmhdr)); @@ -558,7 +556,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara TBHDR nmhdr; nmhdr.hdr.hwndFrom = _hSelf; nmhdr.hdr.code = _isDraggingInside?TCN_TABDROPPED:TCN_TABDROPPEDOUTSIDE; - nmhdr.hdr.idFrom = reinterpret_cast(this); + nmhdr.hdr.idFrom = reinterpret_cast(this); nmhdr.tabOrigin = currentTabOn; ::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast(&nmhdr)); @@ -572,7 +570,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara TBHDR nmhdr; nmhdr.hdr.hwndFrom = _hSelf; nmhdr.hdr.code = TCN_TABDELETE; - nmhdr.hdr.idFrom = reinterpret_cast(this); + nmhdr.hdr.idFrom = reinterpret_cast(this); nmhdr.tabOrigin = currentTabOn; ::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast(&nmhdr)); @@ -617,7 +615,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara TBHDR nmhdr; nmhdr.hdr.hwndFrom = _hSelf; nmhdr.hdr.code = TCN_TABDELETE; - nmhdr.hdr.idFrom = reinterpret_cast(this); + nmhdr.hdr.idFrom = reinterpret_cast(this); nmhdr.tabOrigin = currentTabOn; ::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast(&nmhdr)); @@ -634,7 +632,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara TBHDR nmhdr; nmhdr.hdr.hwndFrom = _hSelf; nmhdr.hdr.code = TCN_TABDELETE; - nmhdr.hdr.idFrom = reinterpret_cast(this); + nmhdr.hdr.idFrom = reinterpret_cast(this); nmhdr.tabOrigin = currentTabOn; ::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast(&nmhdr));