From 85db072c3e2001d294e3c1d2a6d71a3afaaaee58 Mon Sep 17 00:00:00 2001 From: donho Date: Wed, 6 Aug 2008 01:33:46 +0000 Subject: [PATCH] [NEW] Make x64 compiling compatible. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@304 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 8 ++++---- PowerEditor/src/Parameters.h | 4 ++-- .../ScitillaComponent/ScintillaEditView.cpp | 8 ++++---- .../src/ScitillaComponent/ScintillaEditView.h | 4 ++-- .../ScitillaComponent/UserDefineDialog.cpp | 8 ++++---- .../src/WinControls/AboutDlg/URLCtrl.cpp | 14 ++++++------- .../src/WinControls/AboutDlg/URLCtrl.h | 2 +- .../WinControls/ColourPicker/ColourPicker.cpp | 4 ++-- .../WinControls/ColourPicker/ColourPicker.h | 2 +- .../WinControls/ColourPicker/ColourPopup.cpp | 4 ++-- .../WinControls/ColourPicker/WordStyleDlg.h | 6 +++--- .../WinControls/DockingWnd/DockingCont.cpp | 20 +++++++++---------- .../src/WinControls/DockingWnd/DockingCont.h | 4 ++-- .../WinControls/DockingWnd/DockingManager.cpp | 6 +++--- .../WinControls/DockingWnd/DockingManager.h | 2 +- .../DockingWnd/DockingSplitter.cpp | 4 ++-- .../src/WinControls/DockingWnd/Gripper.cpp | 4 ++-- .../src/WinControls/Grid/BabyGridWrapper.h | 2 +- .../OpenSaveFileDialog/FileDialog.cpp | 8 ++++---- .../OpenSaveFileDialog/FileDialog.h | 2 +- .../SplitterContainer/Splitter.cpp | 4 ++-- .../SplitterContainer/SplitterContainer.cpp | 4 ++-- .../WinControls/StaticDialog/StaticDialog.cpp | 4 ++-- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 8 ++++---- PowerEditor/src/WinControls/TabBar/TabBar.h | 6 +++--- .../src/WinControls/TaskList/TaskList.cpp | 4 ++-- .../src/WinControls/TaskList/TaskList.h | 2 +- .../src/WinControls/ToolTip/ToolTip.cpp | 4 ++-- PowerEditor/src/WinControls/ToolTip/ToolTip.h | 2 +- .../src/WinControls/WindowsDlg/WinMgr.cpp | 4 ++-- .../src/WinControls/WindowsDlg/WindowsDlg.cpp | 12 +++++------ 31 files changed, 85 insertions(+), 85 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index f7c14344..0410417c 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4012,9 +4012,9 @@ void Notepad_plus::command(int id) case IDM_EDIT_RTL : case IDM_EDIT_LTR : { - long exStyle = ::GetWindowLong(_pEditView->getHSelf(), GWL_EXSTYLE); + long exStyle = ::GetWindowLongPtr(_pEditView->getHSelf(), GWL_EXSTYLE); exStyle = (id == IDM_EDIT_RTL)?exStyle|WS_EX_LAYOUTRTL:exStyle&(~WS_EX_LAYOUTRTL); - ::SetWindowLong(_pEditView->getHSelf(), GWL_EXSTYLE, exStyle); + ::SetWindowLongPtr(_pEditView->getHSelf(), GWL_EXSTYLE, exStyle); //_pEditView->defineDocType(_pEditView->getCurrentDocType()); _pEditView->redraw(); } @@ -7620,14 +7620,14 @@ LRESULT CALLBACK Notepad_plus::Notepad_plus_Proc(HWND hwnd, UINT Message, WPARAM { Notepad_plus *pM30ide = (Notepad_plus *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pM30ide->_hSelf = hwnd; - ::SetWindowLong(hwnd, GWL_USERDATA, (LONG)pM30ide); + ::SetWindowLongPtr(hwnd, GWL_USERDATA, (LONG)pM30ide); return TRUE; } default : { - return ((Notepad_plus *)::GetWindowLong(hwnd, GWL_USERDATA))->runProc(hwnd, Message, wParam, lParam); + return ((Notepad_plus *)::GetWindowLongPtr(hwnd, GWL_USERDATA))->runProc(hwnd, Message, wParam, lParam); } } } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index bca89cac..e4f8bba6 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -986,13 +986,13 @@ public: void SetTransparent(HWND hwnd, int percent) { //WNDPROC transparentFunc = (NppParameters::getInstance())->getTransparentFunc(); if (!_transparentFuncAddr) return; - ::SetWindowLong(hwnd, GWL_EXSTYLE, ::GetWindowLong(hwnd, GWL_EXSTYLE) | /*WS_EX_LAYERED*/0x00080000); + ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, ::GetWindowLongPtr(hwnd, GWL_EXSTYLE) | /*WS_EX_LAYERED*/0x00080000); _transparentFuncAddr(hwnd, 0, percent, 0x00000002); }; void removeTransparent(HWND hwnd) { - ::SetWindowLong(hwnd, GWL_EXSTYLE, ::GetWindowLong(hwnd, GWL_EXSTYLE) & ~/*WS_EX_LAYERED*/0x00080000); + ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, ::GetWindowLongPtr(hwnd, GWL_EXSTYLE) & ~/*WS_EX_LAYERED*/0x00080000); }; void setCmdlineParam(const CmdLineParams & cmdLineParams) { diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index b5e717cc..0d5469dc 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -195,15 +195,15 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) //Use either Unicode or ANSI setwindowlong, depending on environment if (::IsWindowUnicode(_hSelf)) { - ::SetWindowLongW(_hSelf, GWL_USERDATA, reinterpret_cast(this)); + ::SetWindowLongPtrW(_hSelf, GWL_USERDATA, reinterpret_cast(this)); _callWindowProc = CallWindowProcW; - _scintillaDefaultProc = reinterpret_cast(::SetWindowLongW(_hSelf, GWL_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); + _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrW(_hSelf, GWL_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); } else { - ::SetWindowLongA(_hSelf, GWL_USERDATA, reinterpret_cast(this)); + ::SetWindowLongPtrA(_hSelf, GWL_USERDATA, reinterpret_cast(this)); _callWindowProc = CallWindowProcA; - _scintillaDefaultProc = reinterpret_cast(::SetWindowLongA(_hSelf, GWL_WNDPROC, reinterpret_cast(scintillaStatic_Proc))); + _scintillaDefaultProc = reinterpret_cast(::SetWindowLongPtrA(_hSelf, GWL_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/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 7acd0945..61033202 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -510,7 +510,7 @@ protected: static const int _markersArray[][NB_FOLDER_STATE]; static LRESULT CALLBACK scintillaStatic_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLong(hwnd, GWL_USERDATA)); + ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)); // if (Message == WM_MOUSEWHEEL || Message == WM_MOUSEHWHEEL) { @@ -518,7 +518,7 @@ protected: POINTS pts = MAKEPOINTS(lParam); POINTSTOPOINT(pt, pts); HWND hwndOnMouse = WindowFromPoint(pt); - ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLong(hwndOnMouse, GWL_USERDATA)); + ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLongPtr(hwndOnMouse, GWL_USERDATA)); if (pScintillaOnMouse != pScint) return ::SendMessage(hwndOnMouse, Message, wParam, lParam); } diff --git a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp index 1d66005f..1c4dd02a 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp @@ -1154,17 +1154,17 @@ void UserDefineDialog::changeStyle() _status = !_status; ::SetDlgItemText(_hSelf, IDC_DOCK_BUTTON, (_status == DOCK)?"Undock":"Dock"); - long style = ::GetWindowLong(_hSelf, GWL_STYLE); + long style = ::GetWindowLongPtr(_hSelf, GWL_STYLE); if (!style) - ::MessageBox(NULL,"echou GetWindowLong", "", MB_OK); + ::MessageBox(NULL,"echou GetWindowLongPtr", "", MB_OK); style = (_status == DOCK)? ((style & ~WS_POPUP) & ~DS_MODALFRAME & ~WS_CAPTION) | WS_CHILD : (style & ~WS_CHILD) | WS_POPUP | DS_MODALFRAME | WS_CAPTION; - long result = ::SetWindowLong(_hSelf, GWL_STYLE, style); + long result = ::SetWindowLongPtr(_hSelf, GWL_STYLE, style); if (!result) - ::MessageBox(NULL,"echou SetWindowLong", "", MB_OK); + ::MessageBox(NULL,"echou SetWindowLongPtr", "", MB_OK); if (_status == DOCK) getActualPosSize(); diff --git a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.cpp b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.cpp index d9b603c1..a2336358 100644 --- a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.cpp +++ b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.cpp @@ -119,7 +119,7 @@ static COLORREF getParentDlgBkColor(HWND hWnd) void URLCtrl::create(HWND itemHandle, char * link, COLORREF linkColor) { // turn on notify style - ::SetWindowLong(itemHandle, GWL_STYLE, ::GetWindowLong(itemHandle, GWL_STYLE) | SS_NOTIFY); + ::SetWindowLongPtr(itemHandle, GWL_STYLE, ::GetWindowLongPtr(itemHandle, GWL_STYLE) | SS_NOTIFY); // set the URL text (not the display text) if (link) @@ -132,16 +132,16 @@ void URLCtrl::create(HWND itemHandle, char * link, COLORREF linkColor) _visitedColor = RGB(128,0,128); // subclass the static control - _oldproc = (WNDPROC)::SetWindowLong(itemHandle, GWL_WNDPROC, (LONG)URLCtrlProc); + _oldproc = (WNDPROC)::SetWindowLongPtr(itemHandle, GWL_WNDPROC, (LONG)URLCtrlProc); // associate the URL structure with the static control - ::SetWindowLong(itemHandle, GWL_USERDATA, (LONG)this); + ::SetWindowLongPtr(itemHandle, GWL_USERDATA, (LONG)this); } void URLCtrl::create(HWND itemHandle, int cmd, HWND msgDest) { // turn on notify style - ::SetWindowLong(itemHandle, GWL_STYLE, ::GetWindowLong(itemHandle, GWL_STYLE) | SS_NOTIFY); + ::SetWindowLongPtr(itemHandle, GWL_STYLE, ::GetWindowLongPtr(itemHandle, GWL_STYLE) | SS_NOTIFY); _cmdID = cmd; _msgDest = msgDest; @@ -150,10 +150,10 @@ void URLCtrl::create(HWND itemHandle, int cmd, HWND msgDest) _linkColor = RGB(0,0,255); // subclass the static control - _oldproc = (WNDPROC)::SetWindowLong(itemHandle, GWL_WNDPROC, (LONG)URLCtrlProc); + _oldproc = (WNDPROC)::SetWindowLongPtr(itemHandle, GWL_WNDPROC, (LONG)URLCtrlProc); // associate the URL structure with the static control - ::SetWindowLong(itemHandle, GWL_USERDATA, (LONG)this); + ::SetWindowLongPtr(itemHandle, GWL_USERDATA, (LONG)this); } LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { @@ -168,7 +168,7 @@ LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) // colours, and with an underline text style case WM_PAINT: { - DWORD dwStyle = ::GetWindowLong(hwnd, GWL_STYLE); + DWORD dwStyle = ::GetWindowLongPtr(hwnd, GWL_STYLE); DWORD dwDTStyle = DT_SINGLELINE; //Test if centered horizontally or vertically diff --git a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h index 3ad18afc..1af96739 100644 --- a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h +++ b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h @@ -35,7 +35,7 @@ protected : bool _clicking; static LRESULT CALLBACK URLCtrlProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam){ - return ((URLCtrl *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam); + return ((URLCtrl *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam); }; LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); }; diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp index ff751617..1b19587f 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp @@ -43,8 +43,8 @@ void ColourPicker::init(HINSTANCE hInst, HWND parent) } - ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast(this)); - _buttonDefaultProc = reinterpret_cast(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast(staticWinProc))); + ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast(this)); + _buttonDefaultProc = reinterpret_cast(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast(staticWinProc))); } diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h index 9b01aab5..37cae49c 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h @@ -52,7 +52,7 @@ private : bool _isEnabled; static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((ColourPicker *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); + return (((ColourPicker *)(::GetWindowLongPtr(hwnd, GWL_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 54f67dad..c5c87f7e 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp @@ -62,14 +62,14 @@ BOOL CALLBACK ColourPopup::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA { ColourPopup *pColourPopup = (ColourPopup *)(lParam); pColourPopup->_hSelf = hwnd; - ::SetWindowLong(hwnd, GWL_USERDATA, (long)lParam); + ::SetWindowLongPtr(hwnd, GWL_USERDATA, (long)lParam); pColourPopup->run_dlgProc(message, wParam, lParam); return TRUE; } default : { - ColourPopup *pColourPopup = reinterpret_cast(::GetWindowLong(hwnd, GWL_USERDATA)); + ColourPopup *pColourPopup = reinterpret_cast(::GetWindowLongPtr(hwnd, GWL_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 0598e5e5..2277e949 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -47,15 +47,15 @@ public : return oldColour; }; void hookOn(HWND staticHandle) { - ::SetWindowLong(staticHandle, GWL_USERDATA, (LONG)this); - _oldProc = (WNDPROC)::SetWindowLong(staticHandle, GWL_WNDPROC, (LONG)staticProc); + ::SetWindowLongPtr(staticHandle, GWL_USERDATA, (LONG)this); + _oldProc = (WNDPROC)::SetWindowLongPtr(staticHandle, GWL_WNDPROC, (LONG)staticProc); }; private : COLORREF _colour; WNDPROC _oldProc; static BOOL CALLBACK staticProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ - ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast(::GetWindowLong(hwnd, GWL_USERDATA)); + ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast(::GetWindowLongPtr(hwnd, GWL_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.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index 26af7d5a..92189097 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -98,14 +98,14 @@ void DockingCont::doDialog(bool willBeShown, bool isFloating) if (_isFloating) { - ::SetWindowLong(_hSelf, GWL_STYLE, POPUP_STYLES); - ::SetWindowLong(_hSelf, GWL_EXSTYLE, POPUP_EXSTYLES); + ::SetWindowLongPtr(_hSelf, GWL_STYLE, POPUP_STYLES); + ::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, POPUP_EXSTYLES); ::ShowWindow(_hCaption, SW_HIDE); } else { - ::SetWindowLong(_hSelf, GWL_STYLE, CHILD_STYLES); - ::SetWindowLong(_hSelf, GWL_EXSTYLE, CHILD_EXSTYLES); + ::SetWindowLongPtr(_hSelf, GWL_STYLE, CHILD_STYLES); + ::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, CHILD_EXSTYLES); ::ShowWindow(_hCaption, SW_SHOW); } @@ -124,8 +124,8 @@ tTbData* DockingCont::createToolbar(tTbData data, Window **ppWin) *pTbData = data; /* force window style of client window */ - ::SetWindowLong(pTbData->hClient, GWL_STYLE, CHILD_STYLES); - ::SetWindowLong(pTbData->hClient, GWL_EXSTYLE, CHILD_EXSTYLES); + ::SetWindowLongPtr(pTbData->hClient, GWL_STYLE, CHILD_STYLES); + ::SetWindowLongPtr(pTbData->hClient, GWL_EXSTYLE, CHILD_EXSTYLES); /* restore position if plugin is in floating state */ if ((_isFloating) && (::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0) == 0)) @@ -912,12 +912,12 @@ BOOL CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara _hCaption = ::GetDlgItem(_hSelf, IDC_BTN_CAPTION); /* intial subclassing of caption */ - ::SetWindowLong(_hCaption, GWL_USERDATA, reinterpret_cast(this)); - _hDefaultCaptionProc = reinterpret_cast(::SetWindowLong(_hCaption, GWL_WNDPROC, reinterpret_cast(wndCaptionProc))); + ::SetWindowLongPtr(_hCaption, GWL_USERDATA, reinterpret_cast(this)); + _hDefaultCaptionProc = reinterpret_cast(::SetWindowLongPtr(_hCaption, GWL_WNDPROC, reinterpret_cast(wndCaptionProc))); /* intial subclassing of tab */ - ::SetWindowLong(_hContTab, GWL_USERDATA, reinterpret_cast(this)); - _hDefaultTabProc = reinterpret_cast(::SetWindowLong(_hContTab, GWL_WNDPROC, reinterpret_cast(wndTabProc))); + ::SetWindowLongPtr(_hContTab, GWL_USERDATA, reinterpret_cast(this)); + _hDefaultTabProc = reinterpret_cast(::SetWindowLongPtr(_hContTab, GWL_WNDPROC, reinterpret_cast(wndTabProc))); /* set min tab width */ ::SendMessage(_hContTab, TCM_SETMINTABWIDTH, 0, (LPARAM)MIN_TABWIDTH); diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h index 003c1a0c..9eea6cbe 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h @@ -147,13 +147,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 *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProcCaption(hwnd, Message, wParam, lParam)); + return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWL_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 *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProcTab(hwnd, Message, wParam, lParam)); + return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWL_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 bd244e61..87119ee8 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp @@ -34,7 +34,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 *)::GetWindowLong(hWndServer, GWL_USERDATA); + DockingManager *pDockingManager = (DockingManager *)::GetWindowLongPtr(hWndServer, GWL_USERDATA); if (pDockingManager) { vector & vcontainer = pDockingManager->getContainerInfo(); CWPSTRUCT * pCwp = (CWPSTRUCT*)lParam; @@ -162,11 +162,11 @@ LRESULT CALLBACK DockingManager::staticWinProc(HWND hwnd, UINT message, WPARAM w case WM_NCCREATE : pDockingManager = (DockingManager *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pDockingManager->_hSelf = hwnd; - ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast(pDockingManager)); + ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast(pDockingManager)); return TRUE; default : - pDockingManager = (DockingManager *)::GetWindowLong(hwnd, GWL_USERDATA); + pDockingManager = (DockingManager *)::GetWindowLongPtr(hwnd, GWL_USERDATA); if (!pDockingManager) return ::DefWindowProc(hwnd, message, wParam, lParam); return pDockingManager->runProc(hwnd, message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingManager.h b/PowerEditor/src/WinControls/DockingWnd/DockingManager.h index c5cb8c0f..44c4123c 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.h @@ -183,7 +183,7 @@ private : nmhdr.hwndFrom = _hParent; nmhdr.idFrom = ::GetDlgCtrlID(_hParent); ::SendMessage(hWnd, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr); - return ::GetWindowLong(hWnd, DWL_MSGRESULT); + return ::GetWindowLongPtr(hWnd, DWL_MSGRESULT); }; private: diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp index 75ccce7a..b3c533bf 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp @@ -121,11 +121,11 @@ LRESULT CALLBACK DockingSplitter::staticWinProc(HWND hwnd, UINT message, WPARAM case WM_NCCREATE : pDockingSplitter = (DockingSplitter *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pDockingSplitter->_hSelf = hwnd; - ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast(pDockingSplitter)); + ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast(pDockingSplitter)); return TRUE; default : - pDockingSplitter = (DockingSplitter *)::GetWindowLong(hwnd, GWL_USERDATA); + pDockingSplitter = (DockingSplitter *)::GetWindowLongPtr(hwnd, GWL_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 fd48adf6..362d1381 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp @@ -169,11 +169,11 @@ LRESULT CALLBACK Gripper::staticWinProc(HWND hwnd, UINT message, WPARAM wParam, case WM_NCCREATE : pDlgMoving = (Gripper *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pDlgMoving->_hSelf = hwnd; - ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast(pDlgMoving)); + ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast(pDlgMoving)); return TRUE; default : - pDlgMoving = (Gripper *)::GetWindowLong(hwnd, GWL_USERDATA); + pDlgMoving = (Gripper *)::GetWindowLongPtr(hwnd, GWL_USERDATA); if (!pDlgMoving) return ::DefWindowProc(hwnd, message, wParam, lParam); return pDlgMoving->runProc(message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h b/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h index 9e414480..0033337d 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h +++ b/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h @@ -81,7 +81,7 @@ private : static bool _isRegistered; /* static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((BabyGridWrapper *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); + return (((BabyGridWrapper *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); }; LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam); */ diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp index ba082998..2ba66d89 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp @@ -281,7 +281,7 @@ UINT_PTR CALLBACK FileDialog::OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, L NppParameters *pNppParam = NppParameters::getInstance(); int index = pNppParam->getFileSaveDlgFilterIndex(); - ::SetWindowLong(hWnd, GWL_USERDATA, (long)staticThis); + ::SetWindowLongPtr(hWnd, GWL_USERDATA, (long)staticThis); hFileDlg = ::GetParent(hWnd); goToCenter(hFileDlg); @@ -292,16 +292,16 @@ UINT_PTR CALLBACK FileDialog::OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, L } // Don't touch the following 3 lines, they are cursed !!! - oldProc = (WNDPROC)::GetWindowLong(hFileDlg, GWL_WNDPROC); + oldProc = (WNDPROC)::GetWindowLongPtr(hFileDlg, GWL_WNDPROC); if ((long)oldProc > 0) - ::SetWindowLong(hFileDlg, GWL_WNDPROC, (LONG)fileDlgProc); + ::SetWindowLongPtr(hFileDlg, GWL_WNDPROC, (LONG)fileDlgProc); return FALSE; } default : { - FileDialog *pFileDialog = reinterpret_cast(::GetWindowLong(hWnd, GWL_USERDATA)); + FileDialog *pFileDialog = reinterpret_cast(::GetWindowLongPtr(hWnd, GWL_USERDATA)); if (!pFileDialog) { return FALSE; diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h index 83762b7a..782b4dba 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h @@ -128,7 +128,7 @@ public: static int _dialogFileBoxId; protected : - static UINT APIENTRY OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + static UINT_PTR CALLBACK OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); BOOL APIENTRY run(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); private: diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp index e0536330..90067d98 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp @@ -238,12 +238,12 @@ LRESULT CALLBACK Splitter::staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP { Splitter * pSplitter = (Splitter *)((LPCREATESTRUCT)lParam)->lpCreateParams; pSplitter->_hSelf = hWnd; - ::SetWindowLong(hWnd, GWL_USERDATA, (long)pSplitter); + ::SetWindowLongPtr(hWnd, GWL_USERDATA, (long)pSplitter); return TRUE; } default: { - Splitter * pSplitter = (Splitter *)::GetWindowLong(hWnd, GWL_USERDATA); + Splitter * pSplitter = (Splitter *)::GetWindowLongPtr(hWnd, GWL_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 0405de67..6eb06d2b 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp @@ -114,11 +114,11 @@ LRESULT CALLBACK SplitterContainer::staticWinProc(HWND hwnd, UINT message, WPARA case WM_NCCREATE : pSplitterContainer = (SplitterContainer *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pSplitterContainer->_hSelf = hwnd; - ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast(pSplitterContainer)); + ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast(pSplitterContainer)); return TRUE; default : - pSplitterContainer = (SplitterContainer *)::GetWindowLong(hwnd, GWL_USERDATA); + pSplitterContainer = (SplitterContainer *)::GetWindowLongPtr(hwnd, GWL_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 645a6ad4..826fe6c9 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp @@ -115,7 +115,7 @@ BOOL CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPAR { StaticDialog *pStaticDlg = (StaticDialog *)(lParam); pStaticDlg->_hSelf = hwnd; - ::SetWindowLong(hwnd, GWL_USERDATA, (long)lParam); + ::SetWindowLongPtr(hwnd, GWL_USERDATA, (long)lParam); ::GetWindowRect(hwnd, &(pStaticDlg->_rc)); pStaticDlg->run_dlgProc(message, wParam, lParam); @@ -124,7 +124,7 @@ BOOL CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPAR default : { - StaticDialog *pStaticDlg = reinterpret_cast(::GetWindowLong(hwnd, GWL_USERDATA)); + StaticDialog *pStaticDlg = reinterpret_cast(::GetWindowLongPtr(hwnd, GWL_USERDATA)); if (!pStaticDlg) return FALSE; return pStaticDlg->run_dlgProc(message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 90912691..b7d134ac 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -210,8 +210,8 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad } _nbCtrl++; - ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast(this)); - _tabBarDefaultProc = reinterpret_cast(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast(TabBarPlus_Proc))); + ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast(this)); + _tabBarDefaultProc = reinterpret_cast(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast(TabBarPlus_Proc))); } LOGFONT LogFont; @@ -244,7 +244,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara { DWORD style; //::SendMessage(upDownWnd, UDM_SETBUDDY, NULL, 0); - style = ::GetWindowLong(hwnd, GWL_STYLE); + style = ::GetWindowLongPtr(hwnd, GWL_STYLE); if (wParam > 0) style |= lParam; @@ -254,7 +254,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara _isVertical = ((style & TCS_VERTICAL) != 0); _isMultiLine = ((style & TCS_MULTILINE) != 0); - ::SetWindowLong(hwnd, GWL_STYLE, style); + ::SetWindowLongPtr(hwnd, GWL_STYLE, style); ::InvalidateRect(hwnd, NULL, TRUE); return TRUE; diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.h b/PowerEditor/src/WinControls/TabBar/TabBar.h index cbea04ca..56453ffd 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.h +++ b/PowerEditor/src/WinControls/TabBar/TabBar.h @@ -225,13 +225,13 @@ public : { if (_hwndArray[i]) { - DWORD style = ::GetWindowLong(_hwndArray[i], GWL_STYLE); + DWORD style = ::GetWindowLongPtr(_hwndArray[i], GWL_STYLE); if (isOwnerDrawTab()) style |= TCS_OWNERDRAWFIXED; else style &= ~TCS_OWNERDRAWFIXED; - ::SetWindowLong(_hwndArray[i], GWL_STYLE, style); + ::SetWindowLongPtr(_hwndArray[i], GWL_STYLE, style); ::InvalidateRect(_hwndArray[i], NULL, TRUE); const int base = 6; @@ -337,7 +337,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 *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); + return (((TabBarPlus *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); }; void exchangeItemData(POINT point); diff --git a/PowerEditor/src/WinControls/TaskList/TaskList.cpp b/PowerEditor/src/WinControls/TaskList/TaskList.cpp index fb037a4b..24fcb243 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskList.cpp +++ b/PowerEditor/src/WinControls/TaskList/TaskList.cpp @@ -57,8 +57,8 @@ void TaskList::init(HINSTANCE hInst, HWND parent, HIMAGELIST hImaLst, int nbItem throw int(69); } - ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast(this)); - _defaultProc = reinterpret_cast(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast(staticProc))); + ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast(this)); + _defaultProc = reinterpret_cast(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast(staticProc))); DWORD exStyle = ListView_GetExtendedListViewStyle(_hSelf); exStyle |= LVS_EX_FULLROWSELECT | LVS_EX_BORDERSELECT ; diff --git a/PowerEditor/src/WinControls/TaskList/TaskList.h b/PowerEditor/src/WinControls/TaskList/TaskList.h index c9b0baf4..04b34e8f 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskList.h +++ b/PowerEditor/src/WinControls/TaskList/TaskList.h @@ -77,7 +77,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 *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); + return (((TaskList *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); }; HFONT _hFont; diff --git a/PowerEditor/src/WinControls/ToolTip/ToolTip.cpp b/PowerEditor/src/WinControls/ToolTip/ToolTip.cpp index 50004932..15e466cf 100644 --- a/PowerEditor/src/WinControls/ToolTip/ToolTip.cpp +++ b/PowerEditor/src/WinControls/ToolTip/ToolTip.cpp @@ -39,8 +39,8 @@ void ToolTip::init(HINSTANCE hInst, HWND hParent) throw int(6969); } - ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast(this)); - _defaultProc = reinterpret_cast(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast(staticWinProc))); + ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast(this)); + _defaultProc = reinterpret_cast(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast(staticWinProc))); } } diff --git a/PowerEditor/src/WinControls/ToolTip/ToolTip.h b/PowerEditor/src/WinControls/ToolTip/ToolTip.h index 0f26c55c..e586a6d3 100644 --- a/PowerEditor/src/WinControls/ToolTip/ToolTip.h +++ b/PowerEditor/src/WinControls/ToolTip/ToolTip.h @@ -54,7 +54,7 @@ protected: static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - return (((ToolTip *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); + return (((ToolTip *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); }; LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam); void SendHitMessage(void); diff --git a/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp b/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp index 14fdccc2..88b78fb0 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp @@ -14,11 +14,11 @@ // Theo - Style Helpers inline static DWORD GetStyle(HWND hWnd) { - return (DWORD)GetWindowLong(hWnd, GWL_STYLE); + return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE); } inline static DWORD GetExStyle(HWND hWnd) { - return (DWORD)GetWindowLong(hWnd, GWL_EXSTYLE); + return (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE); } const UINT WM_WINMGR = RegisterWindowMessage("WM_WINMGR"); diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index 720e7c53..b72a96f6 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -18,27 +18,27 @@ static const char *readonlyString = " [Read Only]"; const UINT WDN_NOTIFY = RegisterWindowMessage("WDN_NOTIFY"); inline static DWORD GetStyle(HWND hWnd) { - return (DWORD)GetWindowLong(hWnd, GWL_STYLE); + return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE); } inline static DWORD GetExStyle(HWND hWnd) { - return (DWORD)GetWindowLong(hWnd, GWL_EXSTYLE); + return (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE); } inline static BOOL ModifyStyle(HWND hWnd, DWORD dwRemove, DWORD dwAdd) { - DWORD dwStyle = ::GetWindowLong(hWnd, GWL_STYLE); + DWORD dwStyle = ::GetWindowLongPtr(hWnd, GWL_STYLE); DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd; if(dwStyle == dwNewStyle) return FALSE; - ::SetWindowLong(hWnd, GWL_STYLE, dwNewStyle); + ::SetWindowLongPtr(hWnd, GWL_STYLE, dwNewStyle); return TRUE; } inline static BOOL ModifyStyleEx(HWND hWnd, DWORD dwRemove, DWORD dwAdd) { - DWORD dwStyle = ::GetWindowLong(hWnd, GWL_EXSTYLE); + DWORD dwStyle = ::GetWindowLongPtr(hWnd, GWL_EXSTYLE); DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd; if(dwStyle == dwNewStyle) return FALSE; - ::SetWindowLong(hWnd, GWL_EXSTYLE, dwNewStyle); + ::SetWindowLongPtr(hWnd, GWL_EXSTYLE, dwNewStyle); return TRUE; }