From 4d694ea704c6ea6cf9c29741e0c4933f548d68a1 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Wed, 27 May 2015 22:06:53 +0200 Subject: [PATCH 01/20] Add patch from http://sourceforge.net/p/notepad-plus/patches/648/ by Xileer Torias with comment: Updated the GetWindowLongPtr and SetWindowLongPtrW nIndex reference as per https://msdn.microsoft.com/en-us/library/windows/desktop/ms633585%28v=vs.85%29.aspx and https://msdn.microsoft.com/en-us/library/windows/desktop/ms644898(v=vs.85).aspx This alters the function to be compatible with both x86, and x64 as to simplify future x64 builds. --- PowerEditor/src/NppBigSwitch.cpp | 4 ++-- PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp | 4 ++-- .../src/ScitillaComponent/ScintillaEditView.cpp | 12 ++++++------ PowerEditor/src/WinControls/AboutDlg/URLCtrl.h | 2 +- PowerEditor/src/WinControls/AnsiCharPanel/ListView.h | 2 +- .../src/WinControls/ColourPicker/ColourPicker.h | 2 +- .../src/WinControls/ColourPicker/ColourPopup.cpp | 2 +- .../src/WinControls/ColourPicker/WordStyleDlg.h | 2 +- PowerEditor/src/WinControls/DockingWnd/DockingCont.h | 4 ++-- .../src/WinControls/DockingWnd/DockingManager.cpp | 6 +++--- .../src/WinControls/DockingWnd/DockingSplitter.cpp | 2 +- PowerEditor/src/WinControls/DockingWnd/Gripper.cpp | 2 +- .../src/WinControls/DocumentMap/documentMap.cpp | 6 +++--- .../WinControls/FunctionList/functionListPanel.cpp | 2 +- .../WinControls/OpenSaveFileDialog/FileDialog.cpp | 4 ++-- PowerEditor/src/WinControls/ProjectPanel/TreeView.h | 2 +- .../src/WinControls/SplitterContainer/Splitter.cpp | 2 +- .../SplitterContainer/SplitterContainer.cpp | 2 +- .../src/WinControls/StaticDialog/StaticDialog.cpp | 2 +- PowerEditor/src/WinControls/TabBar/TabBar.h | 2 +- PowerEditor/src/WinControls/TaskList/TaskList.h | 2 +- PowerEditor/src/WinControls/ToolTip/ToolTip.h | 2 +- .../VerticalFileSwitcherListView.h | 2 +- 23 files changed, 36 insertions(+), 36 deletions(-) diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index e2c84778..de598014 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -65,7 +65,7 @@ LRESULT CALLBACK Notepad_plus_Window::Notepad_plus_Proc(HWND hwnd, UINT Message, switch(Message) { case WM_NCCREATE : // First message we get the ptr of instantiated object - // then stock it into GWL_USERDATA index in order to retrieve afterward + // then stock it into GWLP_USERDATA index in order to retrieve afterward { Notepad_plus_Window *pM30ide = (Notepad_plus_Window *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pM30ide->_hSelf = hwnd; @@ -76,7 +76,7 @@ LRESULT CALLBACK Notepad_plus_Window::Notepad_plus_Proc(HWND hwnd, UINT Message, default : { - return ((Notepad_plus_Window *)::GetWindowLongPtr(hwnd, GWL_USERDATA))->runProc(hwnd, Message, wParam, lParam); + return ((Notepad_plus_Window *)::GetWindowLongPtr(hwnd, GWLP_USERDATA))->runProc(hwnd, Message, wParam, lParam); } } } diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 7f6fa4b1..12b0e78c 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -2238,8 +2238,8 @@ LRESULT FAR PASCAL FindReplaceDlg::finderProc(HWND hwnd, UINT message, WPARAM wP { if (message == WM_KEYDOWN && (wParam == VK_DELETE || wParam == VK_RETURN)) { - ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)); - Finder *pFinder = (Finder *)(::GetWindowLongPtr(pScint->getHParent(), GWL_USERDATA)); + ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); + Finder *pFinder = (Finder *)(::GetWindowLongPtr(pScint->getHParent(), GWLP_USERDATA)); if (wParam == VK_RETURN) pFinder->GotoFoundLine(); else // VK_DELETE diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index bc22ac59..7e25f2f8 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -258,15 +258,15 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) //Use either Unicode or ANSI setwindowlong, depending on environment if (::IsWindowUnicode(_hSelf)) { - ::SetWindowLongPtrW(_hSelf, GWL_USERDATA, reinterpret_cast(this)); + ::SetWindowLongPtrW(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); _callWindowProc = CallWindowProcW; - _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrW(_hSelf, GWL_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); + _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrW(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); } else { - ::SetWindowLongPtrA(_hSelf, GWL_USERDATA, reinterpret_cast(this)); + ::SetWindowLongPtrA(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); _callWindowProc = CallWindowProcA; - _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrA(_hSelf, GWL_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); + _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrA(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); } //Get the startup document and make a buffer for it so it can be accessed like a file @@ -275,7 +275,7 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) LRESULT CALLBACK ScintillaEditView::scintillaStatic_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)); + ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); if (Message == WM_MOUSEWHEEL || Message == WM_MOUSEHWHEEL) { @@ -293,7 +293,7 @@ LRESULT CALLBACK ScintillaEditView::scintillaStatic_Proc(HWND hwnd, UINT Message if (isSynpnatic || makeTouchPadCompetible) return (pScint->scintillaNew_Proc(hwnd, Message, wParam, lParam)); - ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLongPtr(hwndOnMouse, GWL_USERDATA)); + ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLongPtr(hwndOnMouse, GWLP_USERDATA)); if (pScintillaOnMouse != pScint) return ::SendMessage(hwndOnMouse, Message, wParam, lParam); } diff --git a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h index 776bc466..f1d11772 100644 --- a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h +++ b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h @@ -53,7 +53,7 @@ protected : bool _clicking; static LRESULT CALLBACK URLCtrlProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam){ - return ((URLCtrl *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam); + return ((URLCtrl *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam); }; LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); }; diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h index 0b7faf34..9e0bef65 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h @@ -51,7 +51,7 @@ protected: LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((ListView *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); + return (((ListView *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); }; }; diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h index 16f1f63d..7434ea05 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h @@ -55,7 +55,7 @@ private : bool _isEnabled; static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((ColourPicker *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); + return (((ColourPicker *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(Message, wParam, lParam)); }; LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam); void drawForeground(HDC hDC); diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp index e8f7606e..ff36057a 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp @@ -77,7 +77,7 @@ BOOL CALLBACK ColourPopup::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA default : { - ColourPopup *pColourPopup = reinterpret_cast(::GetWindowLongPtr(hwnd, GWL_USERDATA)); + ColourPopup *pColourPopup = reinterpret_cast(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); if (!pColourPopup) return FALSE; return pColourPopup->run_dlgProc(message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h index 3b18875c..412dad5b 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -67,7 +67,7 @@ private : WNDPROC _oldProc; static BOOL CALLBACK staticProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ - ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast(::GetWindowLongPtr(hwnd, GWL_USERDATA)); + ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); return pColourStaticTextHooker->colourStaticProc(hwnd, message, wParam, lParam); }; BOOL CALLBACK colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h index b5117d8c..2fdb97da 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h @@ -155,13 +155,13 @@ protected : // Subclassing caption LRESULT runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK wndCaptionProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProcCaption(hwnd, Message, wParam, lParam)); + return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProcCaption(hwnd, Message, wParam, lParam)); }; // Subclassing tab LRESULT runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK wndTabProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProcTab(hwnd, Message, wParam, lParam)); + return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProcTab(hwnd, Message, wParam, lParam)); }; virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp index b56a14ac..4cd22ae1 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp @@ -45,7 +45,7 @@ LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam); // Callback function that handles messages (to test focus) LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode == HC_ACTION && hWndServer) { - DockingManager *pDockingManager = (DockingManager *)::GetWindowLongPtr(hWndServer, GWL_USERDATA); + DockingManager *pDockingManager = (DockingManager *)::GetWindowLongPtr(hWndServer, GWLP_USERDATA); if (pDockingManager) { vector & vcontainer = pDockingManager->getContainerInfo(); CWPSTRUCT * pCwp = (CWPSTRUCT*)lParam; @@ -187,7 +187,7 @@ LRESULT CALLBACK DockingManager::staticWinProc(HWND hwnd, UINT message, WPARAM w return TRUE; default : - pDockingManager = (DockingManager *)::GetWindowLongPtr(hwnd, GWL_USERDATA); + pDockingManager = (DockingManager *)::GetWindowLongPtr(hwnd, GWLP_USERDATA); if (!pDockingManager) return ::DefWindowProc(hwnd, message, wParam, lParam); return pDockingManager->runProc(hwnd, message, wParam, lParam); @@ -711,7 +711,7 @@ LRESULT DockingManager::SendNotify(HWND hWnd, UINT message) nmhdr.hwndFrom = _hParent; nmhdr.idFrom = ::GetDlgCtrlID(_hParent); ::SendMessage(hWnd, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr); - return ::GetWindowLongPtr(hWnd, DWL_MSGRESULT); + return ::GetWindowLongPtr(hWnd, DWLP_MSGRESULT); } void DockingManager::setDockedContSize(int iCont, int iSize) diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp index 1778042e..d28fbcdc 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp @@ -135,7 +135,7 @@ LRESULT CALLBACK DockingSplitter::staticWinProc(HWND hwnd, UINT message, WPARAM return TRUE; default : - pDockingSplitter = (DockingSplitter *)::GetWindowLongPtr(hwnd, GWL_USERDATA); + pDockingSplitter = (DockingSplitter *)::GetWindowLongPtr(hwnd, GWLP_USERDATA); if (!pDockingSplitter) return ::DefWindowProc(hwnd, message, wParam, lParam); return pDockingSplitter->runProc(hwnd, message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp index 22bc6281..27a209f4 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp @@ -178,7 +178,7 @@ LRESULT CALLBACK Gripper::staticWinProc(HWND hwnd, UINT message, WPARAM wParam, return TRUE; default : - pDlgMoving = (Gripper *)::GetWindowLongPtr(hwnd, GWL_USERDATA); + pDlgMoving = (Gripper *)::GetWindowLongPtr(hwnd, GWLP_USERDATA); if (!pDlgMoving) return ::DefWindowProc(hwnd, message, wParam, lParam); return pDlgMoving->runProc(message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp index e584a4ab..c60061d8 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp @@ -440,8 +440,8 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara case WM_INITDIALOG : { _viewZoneCanvas = ::GetDlgItem(_hSelf, IDC_VIEWZONECANVAS); - ::SetWindowLongPtrW(_viewZoneCanvas, GWL_USERDATA, reinterpret_cast(this)); - _canvasDefaultProc = reinterpret_cast(::SetWindowLongPtr(_viewZoneCanvas, GWL_WNDPROC, reinterpret_cast(canvasStaticProc))); + ::SetWindowLongPtrW(_viewZoneCanvas, GWLP_USERDATA, reinterpret_cast(this)); + _canvasDefaultProc = reinterpret_cast(::SetWindowLongPtr(_viewZoneCanvas, GWLP_WNDPROC, reinterpret_cast(canvasStaticProc))); return TRUE; } @@ -492,7 +492,7 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara BOOL CALLBACK ViewZoneDlg::canvasStaticProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - ViewZoneDlg *pViewZoneDlg = reinterpret_cast(::GetWindowLongPtr(hwnd, GWL_USERDATA)); + ViewZoneDlg *pViewZoneDlg = reinterpret_cast(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); if (!pViewZoneDlg) return FALSE; return pViewZoneDlg->canvas_runProc(hwnd, message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index db230d9a..5fb28d89 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -572,7 +572,7 @@ BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM _hToolbarMenu = CreateWindowEx(0,TOOLBARCLASSNAME,NULL, style, 0,0,0,0,_hSelf,(HMENU)0, _hInst, NULL); - //::GetWindowLongPtr(_hToolbarMenu, GWL_WNDPROC); + //::GetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC); oldFunclstToolbarProc = (WNDPROC)::SetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC, (LONG_PTR)funclstToolbarProc); TBBUTTON tbButtons[3]; diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp index 9d9fcf30..ca0710ea 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp @@ -367,7 +367,7 @@ UINT_PTR CALLBACK FileDialog::OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, L } // Don't touch the following 3 lines, they are cursed !!! - oldProc = (WNDPROC)::GetWindowLongPtr(hFileDlg, GWL_WNDPROC); + oldProc = (WNDPROC)::GetWindowLongPtr(hFileDlg, GWLP_WNDPROC); if ((long)oldProc > 0) ::SetWindowLongPtr(hFileDlg, GWLP_WNDPROC, (LONG_PTR)fileDlgProc); @@ -376,7 +376,7 @@ UINT_PTR CALLBACK FileDialog::OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, L default : { - FileDialog *pFileDialog = reinterpret_cast(::GetWindowLongPtr(hWnd, GWL_USERDATA)); + FileDialog *pFileDialog = reinterpret_cast(::GetWindowLongPtr(hWnd, GWLP_USERDATA)); if (!pFileDialog) { return FALSE; diff --git a/PowerEditor/src/WinControls/ProjectPanel/TreeView.h b/PowerEditor/src/WinControls/ProjectPanel/TreeView.h index 0138fe8c..758fdee4 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/TreeView.h +++ b/PowerEditor/src/WinControls/ProjectPanel/TreeView.h @@ -115,7 +115,7 @@ protected: LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((TreeView *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); + return (((TreeView *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); }; void cleanSubEntries(HTREEITEM hTreeItem); void dupTree(HTREEITEM hTree2Dup, HTREEITEM hParentItem); diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp index f1d9f912..801f8a21 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp @@ -250,7 +250,7 @@ LRESULT CALLBACK Splitter::staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP } default: { - Splitter * pSplitter = (Splitter *)::GetWindowLongPtr(hWnd, GWL_USERDATA); + Splitter * pSplitter = (Splitter *)::GetWindowLongPtr(hWnd, GWLP_USERDATA); if (!pSplitter) return ::DefWindowProc(hWnd, uMsg, wParam, lParam); diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp index d85b8f11..2a1db449 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp @@ -126,7 +126,7 @@ LRESULT CALLBACK SplitterContainer::staticWinProc(HWND hwnd, UINT message, WPARA return TRUE; default : - pSplitterContainer = (SplitterContainer *)::GetWindowLongPtr(hwnd, GWL_USERDATA); + pSplitterContainer = (SplitterContainer *)::GetWindowLongPtr(hwnd, GWLP_USERDATA); if (!pSplitterContainer) return ::DefWindowProc(hwnd, message, wParam, lParam); return pSplitterContainer->runProc(message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp index 8683c65c..a4bca7cc 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp @@ -138,7 +138,7 @@ BOOL CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPAR default : { - StaticDialog *pStaticDlg = reinterpret_cast(::GetWindowLongPtr(hwnd, GWL_USERDATA)); + StaticDialog *pStaticDlg = reinterpret_cast(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); if (!pStaticDlg) return FALSE; return pStaticDlg->run_dlgProc(message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.h b/PowerEditor/src/WinControls/TabBar/TabBar.h index ab2567c8..e4282647 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.h +++ b/PowerEditor/src/WinControls/TabBar/TabBar.h @@ -241,7 +241,7 @@ protected: LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK TabBarPlus_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((TabBarPlus *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); + return (((TabBarPlus *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); }; void exchangeItemData(POINT point); diff --git a/PowerEditor/src/WinControls/TaskList/TaskList.h b/PowerEditor/src/WinControls/TaskList/TaskList.h index 9645823e..b8255727 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskList.h +++ b/PowerEditor/src/WinControls/TaskList/TaskList.h @@ -63,7 +63,7 @@ protected: LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((TaskList *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); + return (((TaskList *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); }; HFONT _hFont; diff --git a/PowerEditor/src/WinControls/ToolTip/ToolTip.h b/PowerEditor/src/WinControls/ToolTip/ToolTip.h index fb4fd5f7..6a90f067 100644 --- a/PowerEditor/src/WinControls/ToolTip/ToolTip.h +++ b/PowerEditor/src/WinControls/ToolTip/ToolTip.h @@ -55,7 +55,7 @@ protected: TOOLINFO _ti; static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((ToolTip *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); + return (((ToolTip *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(Message, wParam, lParam)); }; LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam); void SendHitMessage(); diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h index 35b383bb..8d48cfc6 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h @@ -89,7 +89,7 @@ protected: LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((VerticalFileSwitcherListView *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); + return (((VerticalFileSwitcherListView *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); }; int find(int bufferID, int iView) const; From 311c7d578e5bb0aa000d759c6a5b839c97ac6c2d Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Wed, 27 May 2015 22:47:40 +0200 Subject: [PATCH 02/20] Further x86, x64 compatibility fix by reinterpret_cast instead of reinterpret_cast for SetWindowLongPtr --- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 8 ++++---- PowerEditor/src/WinControls/DocumentMap/documentMap.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 7e25f2f8..b77f27ec 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -258,15 +258,15 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) //Use either Unicode or ANSI setwindowlong, depending on environment if (::IsWindowUnicode(_hSelf)) { - ::SetWindowLongPtrW(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); + ::SetWindowLongPtrW(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); _callWindowProc = CallWindowProcW; - _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrW(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); + _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrW(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); } else { - ::SetWindowLongPtrA(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); + ::SetWindowLongPtrA(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); _callWindowProc = CallWindowProcA; - _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrA(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); + _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrA(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); } //Get the startup document and make a buffer for it so it can be accessed like a file diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp index c60061d8..650d024f 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp @@ -440,8 +440,8 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara case WM_INITDIALOG : { _viewZoneCanvas = ::GetDlgItem(_hSelf, IDC_VIEWZONECANVAS); - ::SetWindowLongPtrW(_viewZoneCanvas, GWLP_USERDATA, reinterpret_cast(this)); - _canvasDefaultProc = reinterpret_cast(::SetWindowLongPtr(_viewZoneCanvas, GWLP_WNDPROC, reinterpret_cast(canvasStaticProc))); + ::SetWindowLongPtrW(_viewZoneCanvas, GWLP_USERDATA, reinterpret_cast(this)); + _canvasDefaultProc = reinterpret_cast(::SetWindowLongPtr(_viewZoneCanvas, GWLP_WNDPROC, reinterpret_cast(canvasStaticProc))); return TRUE; } From c3697d205537e4578e2b6f66eb38afa5b1e3e16f Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Wed, 27 May 2015 22:59:46 +0200 Subject: [PATCH 03/20] Cleanup usage of remaining Pre-Unicode interface usage of SetWindowLongPtrW, SetWindowLongPtrA -> SetWindowLongPtr; GetWindowLongPtrW -> GetWindowLongPtr --- PowerEditor/src/Parameters.h | 2 +- .../src/ScitillaComponent/ScintillaEditView.cpp | 16 +++------------- .../src/WinControls/DocumentMap/documentMap.cpp | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index d63f3183..cb7273ed 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -1422,7 +1422,7 @@ public: // if (percent == 255) then opacq void SetTransparent(HWND hwnd, int percent) { if (!_transparentFuncAddr) return; - ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, ::GetWindowLongPtrW(hwnd, GWL_EXSTYLE) | 0x00080000); + ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, ::GetWindowLongPtr(hwnd, GWL_EXSTYLE) | 0x00080000); if (percent > 255) percent = 255; if (percent < 0) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index b77f27ec..f3c1c13b 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -255,19 +255,9 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) _codepage = ::GetACP(); - //Use either Unicode or ANSI setwindowlong, depending on environment - if (::IsWindowUnicode(_hSelf)) - { - ::SetWindowLongPtrW(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); - _callWindowProc = CallWindowProcW; - _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrW(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); - } - else - { - ::SetWindowLongPtrA(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); - _callWindowProc = CallWindowProcA; - _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrA(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); - } + ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); + _callWindowProc = CallWindowProcW; + _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); //Get the startup document and make a buffer for it so it can be accessed like a file attachDefaultDoc(); diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp index 650d024f..aa2c83fb 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp @@ -440,7 +440,7 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara case WM_INITDIALOG : { _viewZoneCanvas = ::GetDlgItem(_hSelf, IDC_VIEWZONECANVAS); - ::SetWindowLongPtrW(_viewZoneCanvas, GWLP_USERDATA, reinterpret_cast(this)); + ::SetWindowLongPtr(_viewZoneCanvas, GWLP_USERDATA, reinterpret_cast(this)); _canvasDefaultProc = reinterpret_cast(::SetWindowLongPtr(_viewZoneCanvas, GWLP_WNDPROC, reinterpret_cast(canvasStaticProc))); return TRUE; } From f45f58b4b251decfe45d03f83a14a4be3e1d66f9 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 28 May 2015 19:26:16 +0200 Subject: [PATCH 04/20] Correct build issue on donho master --- PowerEditor/src/Notepad_plus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 5c373259..a618c82b 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -6166,7 +6166,7 @@ bool Notepad_plus::undoStreamComment() //-- First, search all start_comment and end_comment before and after the selectionStart and selectionEnd position. const int iSelStart=0, iSelEnd=1; - const size_t N_CMNT = 2 + const size_t N_CMNT = 2; int posStartCommentBefore[N_CMNT], posEndCommentBefore[N_CMNT], posStartCommentAfter[N_CMNT], posEndCommentAfter[N_CMNT]; bool blnStartCommentBefore[N_CMNT], blnEndCommentBefore[N_CMNT], blnStartCommentAfter[N_CMNT], blnEndCommentAfter[N_CMNT]; int posStartComment, posEndComment; From c8254f89d19400cd717bca103410e2169347767e Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 28 May 2015 19:33:39 +0200 Subject: [PATCH 05/20] renamed missed CallWindowProcW Unicode version also to CallWindowProc --- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index f3c1c13b..74fc47f9 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -256,7 +256,7 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) _codepage = ::GetACP(); ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, reinterpret_cast(this)); - _callWindowProc = CallWindowProcW; + _callWindowProc = CallWindowProc; _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); //Get the startup document and make a buffer for it so it can be accessed like a file From 4a149600900f8e2491afeeb61d3cd914fb02898b Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Wed, 3 Jun 2015 01:38:44 +0200 Subject: [PATCH 06/20] correct whitespace merge difference to master --- PowerEditor/src/WinControls/DocumentMap/documentMap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp index 9b806976..712f3ee5 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp @@ -443,8 +443,8 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara { ::SetWindowLongPtr(_viewZoneCanvas, GWLP_USERDATA, reinterpret_cast(this)); _canvasDefaultProc = reinterpret_cast(::SetWindowLongPtr(_viewZoneCanvas, GWLP_WNDPROC, reinterpret_cast(canvasStaticProc))); - return TRUE; - } + return TRUE; + } break; } From 73dee04dea058a5e55aff4217eaf35c00f4fd55e Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 8 Jun 2015 08:48:05 +0200 Subject: [PATCH 07/20] Further changes for x64 builds --- PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp | 2 +- PowerEditor/src/ScitillaComponent/FindReplaceDlg.h | 2 +- PowerEditor/src/ScitillaComponent/ScintillaEditView.h | 4 ++-- PowerEditor/src/WinControls/Grid/BabyGridWrapper.h | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index cd3891dc..7dec7839 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -197,7 +197,7 @@ void Searching::displaySectionCentered(int posStart, int posEnd, ScintillaEditVi pEditView->execute(SCI_SETANCHOR, posStart); } -LONG FindReplaceDlg::originalFinderProc = NULL; +LONG_PTR FindReplaceDlg::originalFinderProc = NULL; void FindReplaceDlg::addText2Combo(const TCHAR * txt2add, HWND hCombo, bool) { diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index 52a436c0..5e1f1b4a 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -308,7 +308,7 @@ protected : virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); void addText2Combo(const TCHAR * txt2add, HWND comboID, bool isUTF8 = false); generic_string getTextFromCombo(HWND hCombo, bool isUnicode = false) const; - static LONG originalFinderProc; + static LONG_PTR originalFinderProc; // Window procedure for the finder static LRESULT FAR PASCAL finderProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index f218b83e..0fbb5c04 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -83,7 +83,7 @@ class NppParameters; #define NB_WORD_LIST 4 #define WORD_LIST_LEN 256 -typedef int (* SCINTILLA_FUNC) (void*, int, int, int); +typedef sptr_t(*SCINTILLA_FUNC) (void *, unsigned int, uptr_t, sptr_t); typedef void * SCINTILLA_PTR; #define WM_DOCK_USERDEFINE_DLG (SCINTILLA_USER + 1) @@ -238,7 +238,7 @@ public: virtual void init(HINSTANCE hInst, HWND hPere); LRESULT execute(UINT Msg, WPARAM wParam=0, LPARAM lParam=0) const { - return _pScintillaFunc(_pScintillaPtr, static_cast(Msg), static_cast(wParam), static_cast(lParam)); + return _pScintillaFunc(_pScintillaPtr, Msg, wParam, lParam); }; void activateBuffer(BufferID buffer); diff --git a/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h b/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h index 9b87a8d2..57d7270b 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h +++ b/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h @@ -49,7 +49,7 @@ public : }; void setCursorColour(COLORREF coulour) { - ::SendMessage(_hSelf, BGM_SETCURSORCOLOR, (UINT)coulour, 0); + ::SendMessage(_hSelf, BGM_SETCURSORCOLOR, (WPARAM)coulour, 0); }; void hideCursor() { @@ -64,7 +64,7 @@ public : _BGCELL cell; cell.row = row; cell.col = col; - ::SendMessage(_hSelf, BGM_SETCELLDATA, (UINT)&cell, (long)text); + ::SendMessage(_hSelf, BGM_SETCELLDATA, (WPARAM)&cell, (LPARAM)text); }; void makeColAutoWidth(bool autoWidth = true) { @@ -79,7 +79,7 @@ public : _BGCELL cell; cell.row = row; cell.col = col; - ::SendMessage(_hSelf, BGM_DELETECELL, (UINT)&cell, 0); + ::SendMessage(_hSelf, BGM_DELETECELL, (WPARAM)&cell, 0); }; void setColWidth(unsigned int col, unsigned int width) { From 6ec31f4f8540ba52ec51f63c6e64cd9cff4604d9 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 8 Jun 2015 09:07:41 +0200 Subject: [PATCH 08/20] 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 bcb9aa20..372dbf58 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)); From 581c7b2a722b9f50fe8af9a9f8a238c22295c1df Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 8 Jun 2015 09:26:24 +0200 Subject: [PATCH 09/20] enable common controls als for amd64\x64 architecture, otherwise xp style is not available and bitmap buttons are not working correctly --- PowerEditor/src/notepad++.exe.manifest | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/notepad++.exe.manifest b/PowerEditor/src/notepad++.exe.manifest index c80f5855..3e09e9da 100644 --- a/PowerEditor/src/notepad++.exe.manifest +++ b/PowerEditor/src/notepad++.exe.manifest @@ -3,7 +3,7 @@ manifestVersion="1.0"> @@ -14,7 +14,7 @@ type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" - processorArchitecture="X86" + processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> From edfa987f4ea81cd5bb7d54b1b0b3592f36e010ca Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 8 Jun 2015 12:11:10 +0200 Subject: [PATCH 10/20] x64 issue, replace int for bufferid by bufferid itself, otherwise x64 crashes as bufferid aka buffer * differs from int under x64 --- .../MISC/PluginsManager/Notepad_plus_msgs.h | 4 ++-- PowerEditor/src/Notepad_plus.cpp | 6 ++--- PowerEditor/src/NppCommands.cpp | 2 +- PowerEditor/src/NppIO.cpp | 14 +++++------ .../VerticalFileSwitcher.cpp | 6 ++--- .../VerticalFileSwitcher.h | 8 +++---- .../VerticalFileSwitcherListView.cpp | 24 +++++++++---------- .../VerticalFileSwitcherListView.h | 21 +++++++++------- 8 files changed, 44 insertions(+), 41 deletions(-) diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index dc2912a3..39c5d75c 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -228,13 +228,13 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV // allocate fullFilePath with the return values + 1, then call it again to get full path file name #define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59) - // INT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView) + // LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView) // wParam: Position of document // lParam: View to use, 0 = Main, 1 = Secondary // Returns 0 if invalid #define NPPM_GETCURRENTBUFFERID (NPPMSG + 60) - // INT NPPM_GETCURRENTBUFFERID(0, 0) + // LRESULT NPPM_GETCURRENTBUFFERID(0, 0) // Returns active Buffer #define NPPM_RELOADBUFFERID (NPPMSG + 61) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 3a0d078c..a9484bb7 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3197,7 +3197,7 @@ void Notepad_plus::loadBufferIntoView(BufferID id, int whichOne, bool dontClose) activateBuffer(id, whichOne); //activate. DocTab already activated but not a problem MainFileManager->closeBuffer(idToClose, viewToOpen); //delete the buffer if (_pFileSwitcherPanel) - _pFileSwitcherPanel->closeItem((int)idToClose, whichOne); + _pFileSwitcherPanel->closeItem(idToClose, whichOne); } else { @@ -4730,7 +4730,7 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask) } if (_pFileSwitcherPanel) - _pFileSwitcherPanel->setItemIconStatus((int)buffer); + _pFileSwitcherPanel->setItemIconStatus(buffer); if (!mainActive && !subActive) { @@ -4830,7 +4830,7 @@ void Notepad_plus::notifyBufferActivated(BufferID bufid, int view) if (_pFileSwitcherPanel) { - _pFileSwitcherPanel->activateItem((int)bufid, currentView()); + _pFileSwitcherPanel->activateItem(bufid, currentView()); } if (_pDocMap && (!_pDocMap->isClosed()) && _pDocMap->isVisible()) diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index d15c671b..778e0b01 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -101,7 +101,7 @@ void Notepad_plus::command(int id) if (id == IDM_FILESWITCHER_FILESCLOSEOTHERS) { // Get current buffer and its view - _pFileSwitcherPanel->activateItem(int(_pEditView->getCurrentBufferID()), currentView()); + _pFileSwitcherPanel->activateItem(_pEditView->getCurrentBufferID(), currentView()); } } break; diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 9fcc33a7..affb0656 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -244,7 +244,7 @@ BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isRe scnN.nmhdr.code = NPPN_FILEOPENED; _pluginsManager.notify(&scnN); if (_pFileSwitcherPanel) - _pFileSwitcherPanel->newItem((int)buf, currentView()); + _pFileSwitcherPanel->newItem(buf, currentView()); } else { @@ -449,14 +449,14 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup) //Do all the works bool isBufRemoved = removeBufferFromView(id, whichOne); - int hiddenBufferID = -1; + BufferID hiddenBufferID = BUFFER_INVALID; if (nrDocs == 1 && canHideView(whichOne)) { //close the view if both visible hideView(whichOne); // if the current activated buffer is in this view, // then get buffer ID to remove the entry from File Switcher Pannel - hiddenBufferID = ::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETBUFFERIDFROMPOS, 0, whichOne); + hiddenBufferID = reinterpret_cast(::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETBUFFERIDFROMPOS, 0, whichOne)); } // Notify plugins that current file is closed @@ -466,15 +466,15 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup) _pluginsManager.notify(&scnN); // The document could be clonned. - // if the same buffer ID is not found then remove the entry from File Switcher Pannel + // if the same buffer ID is not found then remove the entry from File Switcher Panel if (_pFileSwitcherPanel) { //int posInfo = ::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETPOSFROMBUFFERID, (WPARAM)id ,0); - _pFileSwitcherPanel->closeItem((int)id, whichOne); + _pFileSwitcherPanel->closeItem(id, whichOne); - if (hiddenBufferID != -1) - _pFileSwitcherPanel->closeItem((int)hiddenBufferID, whichOne); + if (hiddenBufferID != BUFFER_INVALID) + _pFileSwitcherPanel->closeItem(hiddenBufferID, whichOne); } } command(IDM_VIEW_REFRESHTABAR); diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp index 658648ad..32bce546 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp @@ -205,15 +205,15 @@ BOOL CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, LPA void VerticalFileSwitcher::activateDoc(TaskLstFnStatus *tlfs) const { int view = tlfs->_iView; - int bufferID = (int)tlfs->_bufID; + BufferID bufferID = static_cast(tlfs->_bufID); int currentView = ::SendMessage(_hParent, NPPM_GETCURRENTVIEW, 0, 0); - int currentBufID = ::SendMessage(_hParent, NPPM_GETCURRENTBUFFERID, 0, 0); + BufferID currentBufID = reinterpret_cast(::SendMessage(_hParent, NPPM_GETCURRENTBUFFERID, 0, 0)); if (bufferID == currentBufID && view == currentView) return; - int docPosInfo = ::SendMessage(_hParent, NPPM_GETPOSFROMBUFFERID, bufferID, view); + int docPosInfo = ::SendMessage(_hParent, NPPM_GETPOSFROMBUFFERID, (WPARAM)bufferID, view); int view2set = docPosInfo >> 30; int index2Switch = (docPosInfo << 2) >> 2 ; diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h index 0276cd00..fa827d3f 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h @@ -55,19 +55,19 @@ public: //Activate document in scintilla by using the internal index void activateDoc(TaskLstFnStatus *tlfs) const; - int newItem(int bufferID, int iView){ + int newItem(BufferID bufferID, int iView){ return _fileListView.newItem(bufferID, iView); }; - int closeItem(int bufferID, int iView){ + int closeItem(BufferID bufferID, int iView){ return _fileListView.closeItem(bufferID, iView); }; - void activateItem(int bufferID, int iView) { + void activateItem(BufferID bufferID, int iView) { _fileListView.activateItem(bufferID, iView); }; - void setItemIconStatus(int bufferID) { + void setItemIconStatus(BufferID bufferID) { _fileListView.setItemIconStatus(bufferID) ; }; diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp index 304b65cc..1f8dbec2 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp @@ -157,11 +157,11 @@ void VerticalFileSwitcherListView::reload() initList(); } -int VerticalFileSwitcherListView::getBufferInfoFromIndex(int index, int & view) const +BufferID VerticalFileSwitcherListView::getBufferInfoFromIndex(int index, int & view) const { int nbItem = ListView_GetItemCount(_hSelf); if (index < 0 || index >= nbItem) - return -1; + return BUFFER_INVALID; LVITEM item; item.mask = LVIF_PARAM; @@ -170,10 +170,10 @@ int VerticalFileSwitcherListView::getBufferInfoFromIndex(int index, int & view) TaskLstFnStatus *tlfs = (TaskLstFnStatus *)item.lParam; view = tlfs->_iView; - return int(tlfs->_bufID); + return static_cast(tlfs->_bufID); } -int VerticalFileSwitcherListView::newItem(int bufferID, int iView) +int VerticalFileSwitcherListView::newItem(BufferID bufferID, int iView) { int i = find(bufferID, iView); if (i == -1) @@ -183,7 +183,7 @@ int VerticalFileSwitcherListView::newItem(int bufferID, int iView) return i; } -void VerticalFileSwitcherListView::setItemIconStatus(int bufferID) +void VerticalFileSwitcherListView::setItemIconStatus(BufferID bufferID) { Buffer *buf = (Buffer *)bufferID; @@ -207,7 +207,7 @@ void VerticalFileSwitcherListView::setItemIconStatus(int bufferID) item.iItem = i; ListView_GetItem(_hSelf, &item); TaskLstFnStatus *tlfs = (TaskLstFnStatus *)(item.lParam); - if (int(tlfs->_bufID) == bufferID) + if (tlfs->_bufID == bufferID) { item.mask = LVIF_TEXT | LVIF_IMAGE; ListView_SetItem(_hSelf, &item); @@ -236,7 +236,7 @@ generic_string VerticalFileSwitcherListView::getFullFilePath(size_t i) const return tlfs->_fn; } -int VerticalFileSwitcherListView::closeItem(int bufferID, int iView) +int VerticalFileSwitcherListView::closeItem(BufferID bufferID, int iView) { int i = find(bufferID, iView); if (i != -1) @@ -244,7 +244,7 @@ int VerticalFileSwitcherListView::closeItem(int bufferID, int iView) return i; } -void VerticalFileSwitcherListView::activateItem(int bufferID, int iView) +void VerticalFileSwitcherListView::activateItem(BufferID bufferID, int iView) { // Clean all selection int nbItem = ListView_GetItemCount(_hSelf); @@ -255,7 +255,7 @@ void VerticalFileSwitcherListView::activateItem(int bufferID, int iView) ListView_SetItemState(_hSelf, i, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED); } -int VerticalFileSwitcherListView::add(int bufferID, int iView) +int VerticalFileSwitcherListView::add(BufferID bufferID, int iView) { int index = ListView_GetItemCount(_hSelf); Buffer *buf = (Buffer *)bufferID; @@ -311,7 +311,7 @@ void VerticalFileSwitcherListView::removeAll() } } -int VerticalFileSwitcherListView::find(int bufferID, int iView) const +int VerticalFileSwitcherListView::find(BufferID bufferID, int iView) const { LVITEM item; bool found = false; @@ -323,7 +323,7 @@ int VerticalFileSwitcherListView::find(int bufferID, int iView) const item.iItem = i; ListView_GetItem(_hSelf, &item); TaskLstFnStatus *tlfs = (TaskLstFnStatus *)item.lParam; - if (int(tlfs->_bufID) == bufferID && tlfs->_iView == iView) + if (tlfs->_bufID == bufferID && tlfs->_iView == iView) { found = true; break; @@ -374,7 +374,7 @@ std::vector VerticalFileSwitcherListView::getSelectedFiles(boo ListView_GetItem(_hSelf, &item); TaskLstFnStatus *tlfs = (TaskLstFnStatus *)item.lParam; - files.push_back(SwitcherFileInfo(int(tlfs->_bufID), tlfs->_iView)); + files.push_back(SwitcherFileInfo(static_cast(tlfs->_bufID), tlfs->_iView)); } } diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h index 8d48cfc6..6877feec 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h @@ -32,13 +32,16 @@ #include "window.h" #include "TaskListDlg.h" +class Buffer; +typedef Buffer * BufferID; //each buffer has unique ID by which it can be retrieved + #define SORT_DIRECTION_UP 0 #define SORT_DIRECTION_DOWN 1 struct SwitcherFileInfo { - int _bufID; + BufferID _bufID; int _iView; - SwitcherFileInfo(int buf, int view): _bufID(buf), _iView(view){}; + SwitcherFileInfo(BufferID buf, int view) : _bufID(buf), _iView(view){}; }; class VerticalFileSwitcherListView : public Window @@ -50,14 +53,14 @@ public: virtual void init(HINSTANCE hInst, HWND parent, HIMAGELIST hImaLst); virtual void destroy(); void initList(); - int getBufferInfoFromIndex(int index, int & view) const; + BufferID getBufferInfoFromIndex(int index, int & view) const; void setBgColour(int i) { ListView_SetItemState(_hSelf, i, LVIS_SELECTED|LVIS_FOCUSED, 0xFF); } - int newItem(int bufferID, int iView); - int closeItem(int bufferID, int iView); - void activateItem(int bufferID, int iView); - void setItemIconStatus(int bufferID); + int newItem(BufferID bufferID, int iView); + int closeItem(BufferID bufferID, int iView); + void activateItem(BufferID bufferID, int iView); + void setItemIconStatus(BufferID bufferID); generic_string getFullFilePath(size_t i) const; void insertColumn(const TCHAR *name, int width, int index); @@ -92,8 +95,8 @@ protected: return (((VerticalFileSwitcherListView *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); }; - int find(int bufferID, int iView) const; - int add(int bufferID, int iView); + int find(BufferID bufferID, int iView) const; + int add(BufferID bufferID, int iView); void remove(int index); void removeAll(); }; From a371ddf8229bf176e879caecee231c18d5319340 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 8 Jun 2015 13:07:45 +0200 Subject: [PATCH 11/20] avoid level 2 warning about variable size mismatch for x64 --- PowerEditor/src/WinControls/FunctionList/functionParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp index a0b80242..a015edd6 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp @@ -598,14 +598,14 @@ void FunctionParser::getInvertZones(vector< pair > & destZones, vecto { if (sourceZones.size() == 0) { - destZones.push_back(pair(begin, end)); + destZones.push_back(pair((int)begin, (int)end)); } else { // check the begin if (int(begin) < sourceZones[0].first) { - destZones.push_back(pair(begin, sourceZones[0].first - 1)); + destZones.push_back(pair((int)begin, sourceZones[0].first - 1)); } size_t i = 0; @@ -618,7 +618,7 @@ void FunctionParser::getInvertZones(vector< pair > & destZones, vecto } int lastBegin = sourceZones[i].second + 1; if (lastBegin < int(end)) - destZones.push_back(pair(lastBegin, end)); + destZones.push_back(pair(lastBegin, (int)end)); } } From 2a9b099a08d762c861df8fdd94571cdea1c24d98 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 10:10:19 +0200 Subject: [PATCH 12/20] - avoid build issue for unicode: 2>..\lexers\LexUser.cxx(1406): error C2664: 'void GenerateVector(vvstring &,const char *,char *,int)' : cannot convert argument 3 from 'const wchar_t [3]' to 'char *' 2> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast --- scintilla/lexers/LexUser.cxx | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/scintilla/lexers/LexUser.cxx b/scintilla/lexers/LexUser.cxx index 62414dfc..2529f9d9 100644 --- a/scintilla/lexers/LexUser.cxx +++ b/scintilla/lexers/LexUser.cxx @@ -1403,36 +1403,36 @@ static void ColouriseUserDoc(unsigned int startPos, int length, int initStyle, W const char * sComments = styler.pprops->Get("userDefine.comments"); // 'GenerateVector' converts strings into vvstring objects - GenerateVector(commentLineOpen, sComments, TEXT("00"), 0); - GenerateVector(commentLineContinue, sComments, TEXT("01"), commentLineOpen.size()); - GenerateVector(commentLineClose, sComments, TEXT("02"), commentLineOpen.size()); - GenerateVector(commentOpen, sComments, TEXT("03"), 0); - GenerateVector(commentClose, sComments, TEXT("04"), commentOpen.size()); + GenerateVector(commentLineOpen, sComments, "00", 0); + GenerateVector(commentLineContinue, sComments, "01", commentLineOpen.size()); + GenerateVector(commentLineClose, sComments, "02", commentLineOpen.size()); + GenerateVector(commentOpen, sComments, "03", 0); + GenerateVector(commentClose, sComments, "04", commentOpen.size()); - GenerateVector(delim1Open, sDelimiters, TEXT("00"), 0); - GenerateVector(delim1Escape, sDelimiters, TEXT("01"), delim1Open.size()); - GenerateVector(delim1Close, sDelimiters, TEXT("02"), delim1Open.size()); - GenerateVector(delim2Open, sDelimiters, TEXT("03"), 0); - GenerateVector(delim2Escape, sDelimiters, TEXT("04"), delim2Open.size()); - GenerateVector(delim2Close, sDelimiters, TEXT("05"), delim2Open.size()); - GenerateVector(delim3Open, sDelimiters, TEXT("06"), 0); - GenerateVector(delim3Escape, sDelimiters, TEXT("07"), delim3Open.size()); - GenerateVector(delim3Close, sDelimiters, TEXT("08"), delim3Open.size()); - GenerateVector(delim4Open, sDelimiters, TEXT("09"), 0); - GenerateVector(delim4Escape, sDelimiters, TEXT("10"), delim4Open.size()); - GenerateVector(delim4Close, sDelimiters, TEXT("11"), delim4Open.size()); - GenerateVector(delim5Open, sDelimiters, TEXT("12"), 0); - GenerateVector(delim5Escape, sDelimiters, TEXT("13"), delim5Open.size()); - GenerateVector(delim5Close, sDelimiters, TEXT("14"), delim5Open.size()); - GenerateVector(delim6Open, sDelimiters, TEXT("15"), 0); - GenerateVector(delim6Escape, sDelimiters, TEXT("16"), delim6Open.size()); - GenerateVector(delim6Close, sDelimiters, TEXT("17"), delim6Open.size()); - GenerateVector(delim7Open, sDelimiters, TEXT("18"), 0); - GenerateVector(delim7Escape, sDelimiters, TEXT("19"), delim7Open.size()); - GenerateVector(delim7Close, sDelimiters, TEXT("20"), delim7Open.size()); - GenerateVector(delim8Open, sDelimiters, TEXT("21"), 0); - GenerateVector(delim8Escape, sDelimiters, TEXT("22"), delim8Open.size()); - GenerateVector(delim8Close, sDelimiters, TEXT("23"), delim8Open.size()); + GenerateVector(delim1Open, sDelimiters, "00", 0); + GenerateVector(delim1Escape, sDelimiters, "01", delim1Open.size()); + GenerateVector(delim1Close, sDelimiters, "02", delim1Open.size()); + GenerateVector(delim2Open, sDelimiters, "03", 0); + GenerateVector(delim2Escape, sDelimiters, "04", delim2Open.size()); + GenerateVector(delim2Close, sDelimiters, "05", delim2Open.size()); + GenerateVector(delim3Open, sDelimiters, "06", 0); + GenerateVector(delim3Escape, sDelimiters, "07", delim3Open.size()); + GenerateVector(delim3Close, sDelimiters, "08", delim3Open.size()); + GenerateVector(delim4Open, sDelimiters, "09", 0); + GenerateVector(delim4Escape, sDelimiters, "10", delim4Open.size()); + GenerateVector(delim4Close, sDelimiters, "11", delim4Open.size()); + GenerateVector(delim5Open, sDelimiters, "12", 0); + GenerateVector(delim5Escape, sDelimiters, "13", delim5Open.size()); + GenerateVector(delim5Close, sDelimiters, "14", delim5Open.size()); + GenerateVector(delim6Open, sDelimiters, "15", 0); + GenerateVector(delim6Escape, sDelimiters, "16", delim6Open.size()); + GenerateVector(delim6Close, sDelimiters, "17", delim6Open.size()); + GenerateVector(delim7Open, sDelimiters, "18", 0); + GenerateVector(delim7Escape, sDelimiters, "19", delim7Open.size()); + GenerateVector(delim7Close, sDelimiters, "20", delim7Open.size()); + GenerateVector(delim8Open, sDelimiters, "21", 0); + GenerateVector(delim8Escape, sDelimiters, "22", delim8Open.size()); + GenerateVector(delim8Close, sDelimiters, "23", delim8Open.size()); operators1.clear(); foldersInCode1Open.clear(); From e0bc440df747e01b6458b6535c3d8e8512172dc6 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 10:10:43 +0200 Subject: [PATCH 13/20] - avoid compiler warning about unused parameter --- scintilla/lexers/LexSearchResult.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scintilla/lexers/LexSearchResult.cxx b/scintilla/lexers/LexSearchResult.cxx index 6742f626..db4dca70 100644 --- a/scintilla/lexers/LexSearchResult.cxx +++ b/scintilla/lexers/LexSearchResult.cxx @@ -96,7 +96,7 @@ static void ColouriseSearchResultLine(SearchResultMarkings* pMarkings, char *lin } } -static void ColouriseSearchResultDoc(unsigned int startPos, int length, int, WordList *keywordlists[], Accessor &styler) { +static void ColouriseSearchResultDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { char lineBuffer[SC_SEARCHRESULT_LINEBUFFERMAXLENGTH]; styler.StartAt(startPos); From 4cfdd40497eb8ea7343bd0f22d098abf41813032 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 11:19:14 +0200 Subject: [PATCH 14/20] avoid build issue due to difference between declaration and definition INT_PTR vs. BOOL --- PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp | 2 +- PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp index 3218ac2c..169c22df 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp @@ -33,7 +33,7 @@ #include "AboutDlg.h" #include "Parameters.h" -BOOL CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp index 0d951dc2..5cd271ae 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp @@ -85,7 +85,7 @@ INT_PTR CALLBACK ColourPopup::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LP } } -BOOL CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { switch (message) From 9d9be045aefdb0451754825249ab9a3281e66e49 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 11:22:05 +0200 Subject: [PATCH 15/20] avoid access violation with empty string s -> length == 0 --- scintilla/lexers/LexUser.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scintilla/lexers/LexUser.cxx b/scintilla/lexers/LexUser.cxx index 2529f9d9..491e6310 100644 --- a/scintilla/lexers/LexUser.cxx +++ b/scintilla/lexers/LexUser.cxx @@ -635,13 +635,13 @@ static inline void SubGroup(const char * s, vvstring & vec, bool group=false) for (unsigned int j=0; j= 2 && s[0] == '(' && s[1] == '(') { i = 2; group = true; } - if (s[length-1] == ')' && s[length-2] == ')') + if (length >= 2 && s[length - 1] == ')' && s[length - 2] == ')') length -= 2; if (!group && *s) From 0d1297b9c77f6715c94a35c6022dad3224d48ff0 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 11:25:16 +0200 Subject: [PATCH 16/20] added x64 build target, copied from win32 version, relaxed treat warning as error, as multiple errors show up due to x64 type truncations on assignments --- PowerEditor/visual.net/notepadPlus.vcxproj | 123 +++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/PowerEditor/visual.net/notepadPlus.vcxproj b/PowerEditor/visual.net/notepadPlus.vcxproj index e0ebab77..fde7afc6 100644 --- a/PowerEditor/visual.net/notepadPlus.vcxproj +++ b/PowerEditor/visual.net/notepadPlus.vcxproj @@ -5,10 +5,18 @@ Unicode Debug Win32 + + Unicode Debug + x64 + Unicode Release Win32 + + Unicode Release + x64 + Notepad++ @@ -23,11 +31,22 @@ Unicode true + + Application + v120_xp + Unicode + true + Application v120_xp Unicode + + Application + v120_xp + Unicode + @@ -35,10 +54,18 @@ + + + + + + + + <_ProjectFileVersion>12.0.21005.1 @@ -48,11 +75,17 @@ $(Configuration)\ false + + false + ..\bin\ $(Configuration)\ false + + false + Disabled @@ -87,6 +120,40 @@ + + + Disabled + Neither + ..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;%(AdditionalIncludeDirectories) + WIN32;_WIN32_WINNT=0x0501;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions) + Async + Default + MultiThreadedDebug + Level4 + false + ProgramDatabase + true + + + /fixed:no %(AdditionalOptions) + comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;%(AdditionalDependencies) + LinkVerboseLib + $(OutDir)notepad++.exe + 1.0 + /TLBID + 5 + true + $(OutDir)notepadPlus.pdb + Windows + + + ..\src\dpiAware.manifest;%(AdditionalManifestFiles) + + + + + + Full @@ -134,6 +201,56 @@ copy ..\src\shortcuts.xml ..\bin\shortcuts.xml copy ..\src\functionList.xml ..\bin\functionList.xml copy ..\src\contextMenu.xml ..\bin\contextMenu.xml ..\misc\vistaIconTool\changeIcon.bat "..\misc\vistaIconTool\ChangeIcon.exe" "$(OutDir)notepad++.exe" + + + + + + Full + Default + Speed + false + false + ..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;%(AdditionalIncludeDirectories) + WIN32;_WIN32_WINNT=0x0501;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions) + false + false + true + Async + MultiThreaded + true + Level4 + false + ProgramDatabase + NoExtensions + true + + + comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;%(AdditionalDependencies) + LinkVerboseLib + $(OutDir)notepad++.exe + 1.0 + + + 1 + true + $(OutDir)npp.pdb + Windows + true + true + UseLinkTimeCodeGeneration + + + ..\src\dpiAware.manifest;%(AdditionalManifestFiles) + + + copy ..\src\config.model.xml ..\bin\config.model.xml +copy ..\src\langs.model.xml ..\bin\langs.model.xml +copy ..\src\stylers.model.xml ..\bin\stylers.model.xml +copy ..\src\shortcuts.xml ..\bin\shortcuts.xml +copy ..\src\functionList.xml ..\bin\functionList.xml +copy ..\src\contextMenu.xml ..\bin\contextMenu.xml +..\misc\vistaIconTool\changeIcon.bat "..\misc\vistaIconTool\ChangeIcon.exe" "$(OutDir)notepad++.exe" @@ -224,10 +341,16 @@ copy ..\src\contextMenu.xml ..\bin\contextMenu.xml + + TurnOffAllWarnings + TurnOffAllWarnings + + TurnOffAllWarnings + TurnOffAllWarnings From a6e0dd9a533187b7437f0596918489cfd427df74 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 11:31:59 +0200 Subject: [PATCH 17/20] adapted scintilla vs project to notepad++ naming of build configurations from Debug -> Unicode Debug and Release -> Unicode Release, to hav a consistent look in VS solution Used same ToolsVersion="12.0" and v120_xp --- scintilla/win32/SciLexer.vcxproj | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scintilla/win32/SciLexer.vcxproj b/scintilla/win32/SciLexer.vcxproj index a151c02d..7a8d385f 100644 --- a/scintilla/win32/SciLexer.vcxproj +++ b/scintilla/win32/SciLexer.vcxproj @@ -1,20 +1,20 @@  - + - - Debug + + Unicode Debug Win32 - - Debug + + Unicode Debug x64 - - Release + + Unicode Release Win32 - - Release + + Unicode Release x64 @@ -27,19 +27,19 @@ DynamicLibrary Unicode - v120 + v120_xp - + true - + true - + false true - + false true @@ -56,7 +56,7 @@ Level4 - WIN32;SCI_LEXER;_CRT_SECURE_NO_DEPRECATE;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;SCI_LEXER;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_NO_DEPRECATE;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) ..\include;..\src;..\lexlib; true true @@ -69,7 +69,7 @@ imm32.lib;%(AdditionalDependencies) - + _DEBUG;%(PreprocessorDefinitions) @@ -77,7 +77,7 @@ Default - + _DEBUG;%(PreprocessorDefinitions) @@ -85,7 +85,7 @@ Default - + true true @@ -96,7 +96,7 @@ true - + true true From fdd2dbc21fb0de8f1ed90cda11f5169d20258c81 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 17:37:54 +0200 Subject: [PATCH 18/20] - add npp boostregex dir/sources and define SCI_OWNREGEX - add boost via nuget package --- scintilla/win32/SciLexer.vcxproj | 19 +++++++++++++++++-- scintilla/win32/packages.config | 5 +++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 scintilla/win32/packages.config diff --git a/scintilla/win32/SciLexer.vcxproj b/scintilla/win32/SciLexer.vcxproj index 7a8d385f..f7f70579 100644 --- a/scintilla/win32/SciLexer.vcxproj +++ b/scintilla/win32/SciLexer.vcxproj @@ -52,11 +52,12 @@ false + ba6a8a13 Level4 - WIN32;SCI_LEXER;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_NO_DEPRECATE;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;SCI_LEXER;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_NO_DEPRECATE;_WINDOWS;_USRDLL;SCI_OWNREGEX;%(PreprocessorDefinitions) ..\include;..\src;..\lexlib; true true @@ -114,17 +115,31 @@ + + + + + + + - + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/scintilla/win32/packages.config b/scintilla/win32/packages.config new file mode 100644 index 00000000..ec2adc26 --- /dev/null +++ b/scintilla/win32/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file From a8a6f2c88196166d535abd3589f649fcc81b1a90 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 17:41:07 +0200 Subject: [PATCH 19/20] - avoid some compiler warning - build also without SCI_OWNREGEX --- PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp | 2 +- scintilla/boostregex/BoostRegExSearch.cxx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index 9048cfae..ce0aebc9 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -417,7 +417,7 @@ void PluginsManager::notify(const SCNotification *notification) ::MessageBoxA(NULL, e.what(), "Exception", MB_OK); } catch (...) { TCHAR funcInfo[128]; - generic_sprintf(funcInfo, TEXT("notify(SCNotification *notification) : \r notification->nmhdr.code == %d\r notification->nmhdr.hwndFrom == %d\r notification->nmhdr.idFrom == %d"),\ + generic_sprintf(funcInfo, TEXT("notify(SCNotification *notification) : \r notification->nmhdr.code == %d\r notification->nmhdr.hwndFrom == %p\r notification->nmhdr.idFrom == %d"),\ scNotif.nmhdr.code, scNotif.nmhdr.hwndFrom, scNotif.nmhdr.idFrom); pluginCrashAlert(_pluginsCommands[i]._pluginName.c_str(), funcInfo); } diff --git a/scintilla/boostregex/BoostRegExSearch.cxx b/scintilla/boostregex/BoostRegExSearch.cxx index 19a41e7d..b2cf275e 100644 --- a/scintilla/boostregex/BoostRegExSearch.cxx +++ b/scintilla/boostregex/BoostRegExSearch.cxx @@ -241,10 +241,12 @@ namespace Scintilla { #endif +#ifdef SCI_OWNREGEX RegexSearchBase *CreateRegexSearch(CharClassify* /* charClassTable */) { return new BoostRegexSearch(); } +#endif #ifdef SCI_NAMESPACE } @@ -444,14 +446,14 @@ const char *BoostRegexSearch::SubstituteByPosition(Document* doc, const char *te template char *BoostRegexSearch::EncodingDependent::SubstituteByPosition(const char *text, int *length) { char *substituted = stringToCharPtr(_match.format((const CharT*)CharTPtr(text), boost::format_all)); - *length = strlen(substituted); + *length = static_cast(strlen(substituted)); return substituted; } wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8) { - int utf8Size = strlen(utf8); - int wcharSize = UTF16Length(utf8, utf8Size); + size_t utf8Size = strlen(utf8); + size_t wcharSize = UTF16Length(utf8, utf8Size); wchar_t *w = new wchar_t[wcharSize + 1]; UTF16FromUTF8(utf8, utf8Size, w, wcharSize + 1); w[wcharSize] = 0; @@ -460,7 +462,7 @@ wchar_t *BoostRegexSearch::utf8ToWchar(const char *utf8) char *BoostRegexSearch::wcharToUtf8(const wchar_t *w) { - int wcharSize = wcslen(w); + int wcharSize = static_cast(wcslen(w)); int charSize = UTF8Length(w, wcharSize); char *c = new char[charSize + 1]; UTF8FromUTF16(w, wcharSize, c, charSize); From 1c25ae96e679240cd9949c257e804a65c7ffb38c Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 18 Jun 2015 07:22:27 +0200 Subject: [PATCH 20/20] Correct issue with missing text in keyboard shortcut mapper grid --- PowerEditor/src/WinControls/Grid/BabyGrid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp index ef833d5f..274c677c 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp @@ -1745,7 +1745,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) int j,k,c; TCHAR tbuffer[1000]; //it was found, get it - SendMessage(BGHS[SelfIndex].hlist1,LB_GETTEXT,FindResult,(long)lParam); + SendMessage(BGHS[SelfIndex].hlist1,LB_GETTEXT,FindResult,(LPARAM)lParam); lstrcpy(tbuffer,(TCHAR*)lParam); k=lstrlen(tbuffer); c=0; @@ -3112,7 +3112,7 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext) if(lbcount < 12) { //not worth doing binary search, do regular search - FindResult = SendMessage(lbhWnd,LB_FINDSTRING,(unsigned int)-1,(LPARAM) searchtext); + FindResult = SendMessage(lbhWnd,LB_FINDSTRING,(unsigned int)-1,(LPARAM) searchtext); ReturnValue = FindResult; return ReturnValue; }