| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Notepad++
Revision: 304
Author: donho
Date: 05 Aug 2008 21:33:46
Changes:[NEW] Make x64 compiling compatible.
Files:| ... | ...@@ -128,7 +128,7 @@ | |
| 128 | 128 | |
| 129 | 129 | static int _dialogFileBoxId; |
| 130 | 130 | protected : |
| 131 | static UINT APIENTRY OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
| 131 | static UINT_PTR CALLBACK OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
| 132 | 132 | BOOL APIENTRY run(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
| 133 | 133 | |
| 134 | 134 | private: |
| ... | ...@@ -183,7 +183,7 @@ | |
| 183 | 183 | nmhdr.hwndFrom = _hParent; |
| 184 | 184 | nmhdr.idFrom = ::GetDlgCtrlID(_hParent); |
| 185 | 185 | ::SendMessage(hWnd, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr); |
| 186 | return ::GetWindowLong(hWnd, DWL_MSGRESULT); | |
| 186 | return ::GetWindowLongPtr(hWnd, DWL_MSGRESULT); | |
| 187 | 187 | }; |
| 188 | 188 | |
| 189 | 189 | private: |
| ... | ...@@ -52,7 +52,7 @@ | |
| 52 | 52 | bool _isEnabled; |
| 53 | 53 | |
| 54 | 54 | static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { |
| 55 | return (((ColourPicker *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); | |
| 55 | return (((ColourPicker *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); | |
| 56 | 56 | }; |
| 57 | 57 | LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam); |
| 58 | 58 | void drawForeground(HDC hDC); |
| ... | ...@@ -4012,9 +4012,9 @@ | |
| 4012 | 4012 | case IDM_EDIT_RTL : |
| 4013 | 4013 | case IDM_EDIT_LTR : |
| 4014 | 4014 | { |
| 4015 | long exStyle = ::GetWindowLong(_pEditView->getHSelf(), GWL_EXSTYLE); | |
| 4015 | long exStyle = ::GetWindowLongPtr(_pEditView->getHSelf(), GWL_EXSTYLE); | |
| 4016 | 4016 | exStyle = (id == IDM_EDIT_RTL)?exStyle|WS_EX_LAYOUTRTL:exStyle&(~WS_EX_LAYOUTRTL); |
| 4017 | ::SetWindowLong(_pEditView->getHSelf(), GWL_EXSTYLE, exStyle); | |
| 4017 | ::SetWindowLongPtr(_pEditView->getHSelf(), GWL_EXSTYLE, exStyle); | |
| 4018 | 4018 | //_pEditView->defineDocType(_pEditView->getCurrentDocType()); |
| 4019 | 4019 | _pEditView->redraw(); |
| 4020 | 4020 | } |
| ... | ...@@ -7620,14 +7620,14 @@ | |
| 7620 | 7620 | { |
| 7621 | 7621 | Notepad_plus *pM30ide = (Notepad_plus *)(((LPCREATESTRUCT)lParam)->lpCreateParams); |
| 7622 | 7622 | pM30ide->_hSelf = hwnd; |
| 7623 | ::SetWindowLong(hwnd, GWL_USERDATA, (LONG)pM30ide); | |
| 7623 | ::SetWindowLongPtr(hwnd, GWL_USERDATA, (LONG)pM30ide); | |
| 7624 | 7624 | |
| 7625 | 7625 | return TRUE; |
| 7626 | 7626 | } |
| 7627 | 7627 | |
| 7628 | 7628 | default : |
| 7629 | 7629 | { |
| 7630 | return ((Notepad_plus *)::GetWindowLong(hwnd, GWL_USERDATA))->runProc(hwnd, Message, wParam, lParam); | |
| 7630 | return ((Notepad_plus *)::GetWindowLongPtr(hwnd, GWL_USERDATA))->runProc(hwnd, Message, wParam, lParam); | |
| 7631 | 7631 | } |
| 7632 | 7632 | } |
| 7633 | 7633 | } |
| ... | ...@@ -81,7 +81,7 @@ | |
| 81 | 81 | static bool _isRegistered; |
| 82 | 82 | /* |
| 83 | 83 | static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { |
| 84 | return (((BabyGridWrapper *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); | |
| 84 | return (((BabyGridWrapper *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); | |
| 85 | 85 | }; |
| 86 | 86 | LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam); |
| 87 | 87 | */ |
| ... | ...@@ -115,7 +115,7 @@ | |
| 115 | 115 | { |
| 116 | 116 | StaticDialog *pStaticDlg = (StaticDialog *)(lParam); |
| 117 | 117 | pStaticDlg->_hSelf = hwnd; |
| 118 | ::SetWindowLong(hwnd, GWL_USERDATA, (long)lParam); | |
| 118 | ::SetWindowLongPtr(hwnd, GWL_USERDATA, (long)lParam); | |
| 119 | 119 | ::GetWindowRect(hwnd, &(pStaticDlg->_rc)); |
| 120 | 120 | pStaticDlg->run_dlgProc(message, wParam, lParam); |
| 121 | 121 | |
| ... | ...@@ -124,7 +124,7 @@ | |
| 124 | 124 | |
| 125 | 125 | default : |
| 126 | 126 | { |
| 127 | StaticDialog *pStaticDlg = reinterpret_cast<StaticDialog *>(::GetWindowLong(hwnd, GWL_USERDATA)); | |
| 127 | StaticDialog *pStaticDlg = reinterpret_cast<StaticDialog *>(::GetWindowLongPtr(hwnd, GWL_USERDATA)); | |
| 128 | 128 | if (!pStaticDlg) |
| 129 | 129 | return FALSE; |
| 130 | 130 | return pStaticDlg->run_dlgProc(message, wParam, lParam); |
| ... | ...@@ -1154,17 +1154,17 @@ | |
| 1154 | 1154 | _status = !_status; |
| 1155 | 1155 | ::SetDlgItemText(_hSelf, IDC_DOCK_BUTTON, (_status == DOCK)?"Undock":"Dock"); |
| 1156 | 1156 | |
| 1157 | long style = ::GetWindowLong(_hSelf, GWL_STYLE); | |
| 1157 | long style = ::GetWindowLongPtr(_hSelf, GWL_STYLE); | |
| 1158 | 1158 | if (!style) |
| 1159 | ::MessageBox(NULL,"echou GetWindowLong", "", MB_OK); | |
| 1159 | ::MessageBox(NULL,"echou GetWindowLongPtr", "", MB_OK); | |
| 1160 | 1160 | |
| 1161 | 1161 | style = (_status == DOCK)? |
| 1162 | 1162 | ((style & ~WS_POPUP) & ~DS_MODALFRAME & ~WS_CAPTION) | WS_CHILD : |
| 1163 | 1163 | (style & ~WS_CHILD) | WS_POPUP | DS_MODALFRAME | WS_CAPTION; |
| 1164 | 1164 | |
| 1165 | long result = ::SetWindowLong(_hSelf, GWL_STYLE, style); | |
| 1165 | long result = ::SetWindowLongPtr(_hSelf, GWL_STYLE, style); | |
| 1166 | 1166 | if (!result) |
| 1167 | ::MessageBox(NULL,"echou SetWindowLong", "", MB_OK); | |
| 1167 | ::MessageBox(NULL,"echou SetWindowLongPtr", "", MB_OK); | |
| 1168 | 1168 | |
| 1169 | 1169 | if (_status == DOCK) |
| 1170 | 1170 | getActualPosSize(); |
| ... | ...@@ -238,12 +238,12 @@ | |
| 238 | 238 | { |
| 239 | 239 | Splitter * pSplitter = (Splitter *)((LPCREATESTRUCT)lParam)->lpCreateParams; |
| 240 | 240 | pSplitter->_hSelf = hWnd; |
| 241 | ::SetWindowLong(hWnd, GWL_USERDATA, (long)pSplitter); | |
| 241 | ::SetWindowLongPtr(hWnd, GWL_USERDATA, (long)pSplitter); | |
| 242 | 242 | return TRUE; |
| 243 | 243 | } |
| 244 | 244 | default: |
| 245 | 245 | { |
| 246 | Splitter * pSplitter = (Splitter *)::GetWindowLong(hWnd, GWL_USERDATA); | |
| 246 | Splitter * pSplitter = (Splitter *)::GetWindowLongPtr(hWnd, GWL_USERDATA); | |
| 247 | 247 | if (!pSplitter) |
| 248 | 248 | return ::DefWindowProc(hWnd, uMsg, wParam, lParam); |
| 249 | 249 |
| ... | ...@@ -114,11 +114,11 @@ | |
| 114 | 114 | case WM_NCCREATE : |
| 115 | 115 | pSplitterContainer = (SplitterContainer *)(((LPCREATESTRUCT)lParam)->lpCreateParams); |
| 116 | 116 | pSplitterContainer->_hSelf = hwnd; |
| 117 | ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pSplitterContainer)); | |
| 117 | ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pSplitterContainer)); | |
| 118 | 118 | return TRUE; |
| 119 | 119 | |
| 120 | 120 | default : |
| 121 | pSplitterContainer = (SplitterContainer *)::GetWindowLong(hwnd, GWL_USERDATA); | |
| 121 | pSplitterContainer = (SplitterContainer *)::GetWindowLongPtr(hwnd, GWL_USERDATA); | |
| 122 | 122 | if (!pSplitterContainer) |
| 123 | 123 | return ::DefWindowProc(hwnd, message, wParam, lParam); |
| 124 | 124 | return pSplitterContainer->runProc(message, wParam, lParam); |
| ... | ...@@ -39,8 +39,8 @@ | |
| 39 | 39 | throw int(6969); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 43 | _defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc))); | |
| 42 | ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 43 | _defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc))); | |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 |
| ... | ...@@ -14,11 +14,11 @@ | |
| 14 | 14 | |
| 15 | 15 | // Theo - Style Helpers |
| 16 | 16 | inline static DWORD GetStyle(HWND hWnd) { |
| 17 | return (DWORD)GetWindowLong(hWnd, GWL_STYLE); | |
| 17 | return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE); | |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | inline static DWORD GetExStyle(HWND hWnd) { |
| 21 | return (DWORD)GetWindowLong(hWnd, GWL_EXSTYLE); | |
| 21 | return (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | const UINT WM_WINMGR = RegisterWindowMessage("WM_WINMGR"); |
| ... | ...@@ -210,8 +210,8 @@ | |
| 210 | 210 | } |
| 211 | 211 | _nbCtrl++; |
| 212 | 212 | |
| 213 | ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 214 | _tabBarDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(TabBarPlus_Proc))); | |
| 213 | ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 214 | _tabBarDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(TabBarPlus_Proc))); | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | LOGFONT LogFont; |
| ... | ...@@ -244,7 +244,7 @@ | |
| 244 | 244 | { |
| 245 | 245 | DWORD style; |
| 246 | 246 | //::SendMessage(upDownWnd, UDM_SETBUDDY, NULL, 0); |
| 247 | style = ::GetWindowLong(hwnd, GWL_STYLE); | |
| 247 | style = ::GetWindowLongPtr(hwnd, GWL_STYLE); | |
| 248 | 248 | |
| 249 | 249 | if (wParam > 0) |
| 250 | 250 | style |= lParam; |
| ... | ...@@ -254,7 +254,7 @@ | |
| 254 | 254 | _isVertical = ((style & TCS_VERTICAL) != 0); |
| 255 | 255 | _isMultiLine = ((style & TCS_MULTILINE) != 0); |
| 256 | 256 | |
| 257 | ::SetWindowLong(hwnd, GWL_STYLE, style); | |
| 257 | ::SetWindowLongPtr(hwnd, GWL_STYLE, style); | |
| 258 | 258 | ::InvalidateRect(hwnd, NULL, TRUE); |
| 259 | 259 | |
| 260 | 260 | return TRUE; |
| ... | ...@@ -986,13 +986,13 @@ | |
| 986 | 986 | void SetTransparent(HWND hwnd, int percent) { |
| 987 | 987 | //WNDPROC transparentFunc = (NppParameters::getInstance())->getTransparentFunc(); |
| 988 | 988 | if (!_transparentFuncAddr) return; |
| 989 | ::SetWindowLong(hwnd, GWL_EXSTYLE, ::GetWindowLong(hwnd, GWL_EXSTYLE) | /*WS_EX_LAYERED*/0x00080000); | |
| 989 | ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, ::GetWindowLongPtr(hwnd, GWL_EXSTYLE) | /*WS_EX_LAYERED*/0x00080000); | |
| 990 | 990 | |
| 991 | 991 | _transparentFuncAddr(hwnd, 0, percent, 0x00000002); |
| 992 | 992 | }; |
| 993 | 993 | |
| 994 | 994 | void removeTransparent(HWND hwnd) { |
| 995 | ::SetWindowLong(hwnd, GWL_EXSTYLE, ::GetWindowLong(hwnd, GWL_EXSTYLE) & ~/*WS_EX_LAYERED*/0x00080000); | |
| 995 | ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, ::GetWindowLongPtr(hwnd, GWL_EXSTYLE) & ~/*WS_EX_LAYERED*/0x00080000); | |
| 996 | 996 | }; |
| 997 | 997 | |
| 998 | 998 | void setCmdlineParam(const CmdLineParams & cmdLineParams) { |
| ... | ...@@ -62,14 +62,14 @@ | |
| 62 | 62 | { |
| 63 | 63 | ColourPopup *pColourPopup = (ColourPopup *)(lParam); |
| 64 | 64 | pColourPopup->_hSelf = hwnd; |
| 65 | ::SetWindowLong(hwnd, GWL_USERDATA, (long)lParam); | |
| 65 | ::SetWindowLongPtr(hwnd, GWL_USERDATA, (long)lParam); | |
| 66 | 66 | pColourPopup->run_dlgProc(message, wParam, lParam); |
| 67 | 67 | return TRUE; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | default : |
| 71 | 71 | { |
| 72 | ColourPopup *pColourPopup = reinterpret_cast<ColourPopup *>(::GetWindowLong(hwnd, GWL_USERDATA)); | |
| 72 | ColourPopup *pColourPopup = reinterpret_cast<ColourPopup *>(::GetWindowLongPtr(hwnd, GWL_USERDATA)); | |
| 73 | 73 | if (!pColourPopup) |
| 74 | 74 | return FALSE; |
| 75 | 75 | return pColourPopup->run_dlgProc(message, wParam, lParam); |
| ... | ...@@ -119,7 +119,7 @@ | |
| 119 | 119 | void URLCtrl::create(HWND itemHandle, char * link, COLORREF linkColor) |
| 120 | 120 | { |
| 121 | 121 | // turn on notify style |
| 122 | ::SetWindowLong(itemHandle, GWL_STYLE, ::GetWindowLong(itemHandle, GWL_STYLE) | SS_NOTIFY); | |
| 122 | ::SetWindowLongPtr(itemHandle, GWL_STYLE, ::GetWindowLongPtr(itemHandle, GWL_STYLE) | SS_NOTIFY); | |
| 123 | 123 | |
| 124 | 124 | // set the URL text (not the display text) |
| 125 | 125 | if (link) |
| ... | ...@@ -132,16 +132,16 @@ | |
| 132 | 132 | _visitedColor = RGB(128,0,128); |
| 133 | 133 | |
| 134 | 134 | // subclass the static control |
| 135 | _oldproc = (WNDPROC)::SetWindowLong(itemHandle, GWL_WNDPROC, (LONG)URLCtrlProc); | |
| 135 | _oldproc = (WNDPROC)::SetWindowLongPtr(itemHandle, GWL_WNDPROC, (LONG)URLCtrlProc); | |
| 136 | 136 | |
| 137 | 137 | // associate the URL structure with the static control |
| 138 | ::SetWindowLong(itemHandle, GWL_USERDATA, (LONG)this); | |
| 138 | ::SetWindowLongPtr(itemHandle, GWL_USERDATA, (LONG)this); | |
| 139 | 139 | |
| 140 | 140 | } |
| 141 | 141 | void URLCtrl::create(HWND itemHandle, int cmd, HWND msgDest) |
| 142 | 142 | { |
| 143 | 143 | // turn on notify style |
| 144 | ::SetWindowLong(itemHandle, GWL_STYLE, ::GetWindowLong(itemHandle, GWL_STYLE) | SS_NOTIFY); | |
| 144 | ::SetWindowLongPtr(itemHandle, GWL_STYLE, ::GetWindowLongPtr(itemHandle, GWL_STYLE) | SS_NOTIFY); | |
| 145 | 145 | |
| 146 | 146 | _cmdID = cmd; |
| 147 | 147 | _msgDest = msgDest; |
| ... | ...@@ -150,10 +150,10 @@ | |
| 150 | 150 | _linkColor = RGB(0,0,255); |
| 151 | 151 | |
| 152 | 152 | // subclass the static control |
| 153 | _oldproc = (WNDPROC)::SetWindowLong(itemHandle, GWL_WNDPROC, (LONG)URLCtrlProc); | |
| 153 | _oldproc = (WNDPROC)::SetWindowLongPtr(itemHandle, GWL_WNDPROC, (LONG)URLCtrlProc); | |
| 154 | 154 | |
| 155 | 155 | // associate the URL structure with the static control |
| 156 | ::SetWindowLong(itemHandle, GWL_USERDATA, (LONG)this); | |
| 156 | ::SetWindowLongPtr(itemHandle, GWL_USERDATA, (LONG)this); | |
| 157 | 157 | } |
| 158 | 158 | LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) |
| 159 | 159 | { |
| ... | ...@@ -168,7 +168,7 @@ | |
| 168 | 168 | // colours, and with an underline text style |
| 169 | 169 | case WM_PAINT: |
| 170 | 170 | { |
| 171 | DWORD dwStyle = ::GetWindowLong(hwnd, GWL_STYLE); | |
| 171 | DWORD dwStyle = ::GetWindowLongPtr(hwnd, GWL_STYLE); | |
| 172 | 172 | DWORD dwDTStyle = DT_SINGLELINE; |
| 173 | 173 | |
| 174 | 174 | //Test if centered horizontally or vertically |
| ... | ...@@ -54,7 +54,7 @@ | |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { |
| 57 | return (((ToolTip *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); | |
| 57 | return (((ToolTip *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam)); | |
| 58 | 58 | }; |
| 59 | 59 | LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam); |
| 60 | 60 | void SendHitMessage(void); |
| ... | ...@@ -195,15 +195,15 @@ | |
| 195 | 195 | //Use either Unicode or ANSI setwindowlong, depending on environment |
| 196 | 196 | if (::IsWindowUnicode(_hSelf)) |
| 197 | 197 | { |
| 198 | ::SetWindowLongW(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 198 | ::SetWindowLongPtrW(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 199 | 199 | _callWindowProc = CallWindowProcW; |
| 200 | _scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongW(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc))); | |
| 200 | _scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrW(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc))); | |
| 201 | 201 | } |
| 202 | 202 | else |
| 203 | 203 | { |
| 204 | ::SetWindowLongA(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 204 | ::SetWindowLongPtrA(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 205 | 205 | _callWindowProc = CallWindowProcA; |
| 206 | _scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongA(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc))); | |
| 206 | _scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrA(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc))); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | //Get the startup document and make a buffer for it so it can be accessed like a file |
| ... | ...@@ -47,15 +47,15 @@ | |
| 47 | 47 | return oldColour; |
| 48 | 48 | }; |
| 49 | 49 | void hookOn(HWND staticHandle) { |
| 50 | ::SetWindowLong(staticHandle, GWL_USERDATA, (LONG)this); | |
| 51 | _oldProc = (WNDPROC)::SetWindowLong(staticHandle, GWL_WNDPROC, (LONG)staticProc); | |
| 50 | ::SetWindowLongPtr(staticHandle, GWL_USERDATA, (LONG)this); | |
| 51 | _oldProc = (WNDPROC)::SetWindowLongPtr(staticHandle, GWL_WNDPROC, (LONG)staticProc); | |
| 52 | 52 | }; |
| 53 | 53 | private : |
| 54 | 54 | COLORREF _colour; |
| 55 | 55 | WNDPROC _oldProc; |
| 56 | 56 | |
| 57 | 57 | static BOOL CALLBACK staticProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ |
| 58 | ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast<ColourStaticTextHooker *>(::GetWindowLong(hwnd, GWL_USERDATA)); | |
| 58 | ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast<ColourStaticTextHooker *>(::GetWindowLongPtr(hwnd, GWL_USERDATA)); | |
| 59 | 59 | return pColourStaticTextHooker->colourStaticProc(hwnd, message, wParam, lParam); |
| 60 | 60 | }; |
| 61 | 61 | BOOL CALLBACK colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); |
| ... | ...@@ -98,14 +98,14 @@ | |
| 98 | 98 | |
| 99 | 99 | if (_isFloating) |
| 100 | 100 | { |
| 101 | ::SetWindowLong(_hSelf, GWL_STYLE, POPUP_STYLES); | |
| 102 | ::SetWindowLong(_hSelf, GWL_EXSTYLE, POPUP_EXSTYLES); | |
| 101 | ::SetWindowLongPtr(_hSelf, GWL_STYLE, POPUP_STYLES); | |
| 102 | ::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, POPUP_EXSTYLES); | |
| 103 | 103 | ::ShowWindow(_hCaption, SW_HIDE); |
| 104 | 104 | } |
| 105 | 105 | else |
| 106 | 106 | { |
| 107 | ::SetWindowLong(_hSelf, GWL_STYLE, CHILD_STYLES); | |
| 108 | ::SetWindowLong(_hSelf, GWL_EXSTYLE, CHILD_EXSTYLES); | |
| 107 | ::SetWindowLongPtr(_hSelf, GWL_STYLE, CHILD_STYLES); | |
| 108 | ::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, CHILD_EXSTYLES); | |
| 109 | 109 | ::ShowWindow(_hCaption, SW_SHOW); |
| 110 | 110 | } |
| 111 | 111 | |
| ... | ...@@ -124,8 +124,8 @@ | |
| 124 | 124 | *pTbData = data; |
| 125 | 125 | |
| 126 | 126 | /* force window style of client window */ |
| 127 | ::SetWindowLong(pTbData->hClient, GWL_STYLE, CHILD_STYLES); | |
| 128 | ::SetWindowLong(pTbData->hClient, GWL_EXSTYLE, CHILD_EXSTYLES); | |
| 127 | ::SetWindowLongPtr(pTbData->hClient, GWL_STYLE, CHILD_STYLES); | |
| 128 | ::SetWindowLongPtr(pTbData->hClient, GWL_EXSTYLE, CHILD_EXSTYLES); | |
| 129 | 129 | |
| 130 | 130 | /* restore position if plugin is in floating state */ |
| 131 | 131 | if ((_isFloating) && (::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0) == 0)) |
| ... | ...@@ -912,12 +912,12 @@ | |
| 912 | 912 | _hCaption = ::GetDlgItem(_hSelf, IDC_BTN_CAPTION); |
| 913 | 913 | |
| 914 | 914 | /* intial subclassing of caption */ |
| 915 | ::SetWindowLong(_hCaption, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 916 | _hDefaultCaptionProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hCaption, GWL_WNDPROC, reinterpret_cast<LONG>(wndCaptionProc))); | |
| 915 | ::SetWindowLongPtr(_hCaption, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 916 | _hDefaultCaptionProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hCaption, GWL_WNDPROC, reinterpret_cast<LONG>(wndCaptionProc))); | |
| 917 | 917 | |
| 918 | 918 | /* intial subclassing of tab */ |
| 919 | ::SetWindowLong(_hContTab, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 920 | _hDefaultTabProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hContTab, GWL_WNDPROC, reinterpret_cast<LONG>(wndTabProc))); | |
| 919 | ::SetWindowLongPtr(_hContTab, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 920 | _hDefaultTabProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hContTab, GWL_WNDPROC, reinterpret_cast<LONG>(wndTabProc))); | |
| 921 | 921 | |
| 922 | 922 | /* set min tab width */ |
| 923 | 923 | ::SendMessage(_hContTab, TCM_SETMINTABWIDTH, 0, (LPARAM)MIN_TABWIDTH); |
| ... | ...@@ -225,13 +225,13 @@ | |
| 225 | 225 | { |
| 226 | 226 | if (_hwndArray[i]) |
| 227 | 227 | { |
| 228 | DWORD style = ::GetWindowLong(_hwndArray[i], GWL_STYLE); | |
| 228 | DWORD style = ::GetWindowLongPtr(_hwndArray[i], GWL_STYLE); | |
| 229 | 229 | if (isOwnerDrawTab()) |
| 230 | 230 | style |= TCS_OWNERDRAWFIXED; |
| 231 | 231 | else |
| 232 | 232 | style &= ~TCS_OWNERDRAWFIXED; |
| 233 | 233 | |
| 234 | ::SetWindowLong(_hwndArray[i], GWL_STYLE, style); | |
| 234 | ::SetWindowLongPtr(_hwndArray[i], GWL_STYLE, style); | |
| 235 | 235 | ::InvalidateRect(_hwndArray[i], NULL, TRUE); |
| 236 | 236 | |
| 237 | 237 | const int base = 6; |
| ... | ...@@ -337,7 +337,7 @@ | |
| 337 | 337 | LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); |
| 338 | 338 | |
| 339 | 339 | static LRESULT CALLBACK TabBarPlus_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { |
| 340 | return (((TabBarPlus *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); | |
| 340 | return (((TabBarPlus *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); | |
| 341 | 341 | }; |
| 342 | 342 | void exchangeItemData(POINT point); |
| 343 | 343 |
| ... | ...@@ -121,11 +121,11 @@ | |
| 121 | 121 | case WM_NCCREATE : |
| 122 | 122 | pDockingSplitter = (DockingSplitter *)(((LPCREATESTRUCT)lParam)->lpCreateParams); |
| 123 | 123 | pDockingSplitter->_hSelf = hwnd; |
| 124 | ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDockingSplitter)); | |
| 124 | ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDockingSplitter)); | |
| 125 | 125 | return TRUE; |
| 126 | 126 | |
| 127 | 127 | default : |
| 128 | pDockingSplitter = (DockingSplitter *)::GetWindowLong(hwnd, GWL_USERDATA); | |
| 128 | pDockingSplitter = (DockingSplitter *)::GetWindowLongPtr(hwnd, GWL_USERDATA); | |
| 129 | 129 | if (!pDockingSplitter) |
| 130 | 130 | return ::DefWindowProc(hwnd, message, wParam, lParam); |
| 131 | 131 | return pDockingSplitter->runProc(hwnd, message, wParam, lParam); |
| ... | ...@@ -57,8 +57,8 @@ | |
| 57 | 57 | throw int(69); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 61 | _defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticProc))); | |
| 60 | ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 61 | _defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticProc))); | |
| 62 | 62 | |
| 63 | 63 | DWORD exStyle = ListView_GetExtendedListViewStyle(_hSelf); |
| 64 | 64 | exStyle |= LVS_EX_FULLROWSELECT | LVS_EX_BORDERSELECT ; |
| ... | ...@@ -35,7 +35,7 @@ | |
| 35 | 35 | bool _clicking; |
| 36 | 36 | |
| 37 | 37 | static LRESULT CALLBACK URLCtrlProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam){ |
| 38 | return ((URLCtrl *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam); | |
| 38 | return ((URLCtrl *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam); | |
| 39 | 39 | }; |
| 40 | 40 | LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); |
| 41 | 41 | }; |
| ... | ...@@ -147,13 +147,13 @@ | |
| 147 | 147 | /* Subclassing caption */ |
| 148 | 148 | LRESULT runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); |
| 149 | 149 | static LRESULT CALLBACK wndCaptionProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { |
| 150 | return (((DockingCont *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProcCaption(hwnd, Message, wParam, lParam)); | |
| 150 | return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProcCaption(hwnd, Message, wParam, lParam)); | |
| 151 | 151 | }; |
| 152 | 152 | |
| 153 | 153 | /* Subclassing tab */ |
| 154 | 154 | LRESULT runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); |
| 155 | 155 | static LRESULT CALLBACK wndTabProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { |
| 156 | return (((DockingCont *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProcTab(hwnd, Message, wParam, lParam)); | |
| 156 | return (((DockingCont *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProcTab(hwnd, Message, wParam, lParam)); | |
| 157 | 157 | }; |
| 158 | 158 | |
| 159 | 159 | virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); |
| ... | ...@@ -510,7 +510,7 @@ | |
| 510 | 510 | static const int _markersArray[][NB_FOLDER_STATE]; |
| 511 | 511 | |
| 512 | 512 | static LRESULT CALLBACK scintillaStatic_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { |
| 513 | ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLong(hwnd, GWL_USERDATA)); | |
| 513 | ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)); | |
| 514 | 514 | // |
| 515 | 515 | if (Message == WM_MOUSEWHEEL || Message == WM_MOUSEHWHEEL) |
| 516 | 516 | { |
| ... | ...@@ -518,7 +518,7 @@ | |
| 518 | 518 | POINTS pts = MAKEPOINTS(lParam); |
| 519 | 519 | POINTSTOPOINT(pt, pts); |
| 520 | 520 | HWND hwndOnMouse = WindowFromPoint(pt); |
| 521 | ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLong(hwndOnMouse, GWL_USERDATA)); | |
| 521 | ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLongPtr(hwndOnMouse, GWL_USERDATA)); | |
| 522 | 522 | if (pScintillaOnMouse != pScint) |
| 523 | 523 | return ::SendMessage(hwndOnMouse, Message, wParam, lParam); |
| 524 | 524 | } |
| ... | ...@@ -169,11 +169,11 @@ | |
| 169 | 169 | case WM_NCCREATE : |
| 170 | 170 | pDlgMoving = (Gripper *)(((LPCREATESTRUCT)lParam)->lpCreateParams); |
| 171 | 171 | pDlgMoving->_hSelf = hwnd; |
| 172 | ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDlgMoving)); | |
| 172 | ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDlgMoving)); | |
| 173 | 173 | return TRUE; |
| 174 | 174 | |
| 175 | 175 | default : |
| 176 | pDlgMoving = (Gripper *)::GetWindowLong(hwnd, GWL_USERDATA); | |
| 176 | pDlgMoving = (Gripper *)::GetWindowLongPtr(hwnd, GWL_USERDATA); | |
| 177 | 177 | if (!pDlgMoving) |
| 178 | 178 | return ::DefWindowProc(hwnd, message, wParam, lParam); |
| 179 | 179 | return pDlgMoving->runProc(message, wParam, lParam); |
| ... | ...@@ -281,7 +281,7 @@ | |
| 281 | 281 | NppParameters *pNppParam = NppParameters::getInstance(); |
| 282 | 282 | int index = pNppParam->getFileSaveDlgFilterIndex(); |
| 283 | 283 | |
| 284 | ::SetWindowLong(hWnd, GWL_USERDATA, (long)staticThis); | |
| 284 | ::SetWindowLongPtr(hWnd, GWL_USERDATA, (long)staticThis); | |
| 285 | 285 | hFileDlg = ::GetParent(hWnd); |
| 286 | 286 | goToCenter(hFileDlg); |
| 287 | 287 | |
| ... | ...@@ -292,16 +292,16 @@ | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | // Don't touch the following 3 lines, they are cursed !!! |
| 295 | oldProc = (WNDPROC)::GetWindowLong(hFileDlg, GWL_WNDPROC); | |
| 295 | oldProc = (WNDPROC)::GetWindowLongPtr(hFileDlg, GWL_WNDPROC); | |
| 296 | 296 | if ((long)oldProc > 0) |
| 297 | ::SetWindowLong(hFileDlg, GWL_WNDPROC, (LONG)fileDlgProc); | |
| 297 | ::SetWindowLongPtr(hFileDlg, GWL_WNDPROC, (LONG)fileDlgProc); | |
| 298 | 298 | |
| 299 | 299 | return FALSE; |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | default : |
| 303 | 303 | { |
| 304 | FileDialog *pFileDialog = reinterpret_cast<FileDialog *>(::GetWindowLong(hWnd, GWL_USERDATA)); | |
| 304 | FileDialog *pFileDialog = reinterpret_cast<FileDialog *>(::GetWindowLongPtr(hWnd, GWL_USERDATA)); | |
| 305 | 305 | if (!pFileDialog) |
| 306 | 306 | { |
| 307 | 307 | return FALSE; |
| ... | ...@@ -34,7 +34,7 @@ | |
| 34 | 34 | /* Callback function that handles messages (to test focus) */ |
| 35 | 35 | LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam) { |
| 36 | 36 | if (nCode == HC_ACTION && hWndServer) { |
| 37 | DockingManager *pDockingManager = (DockingManager *)::GetWindowLong(hWndServer, GWL_USERDATA); | |
| 37 | DockingManager *pDockingManager = (DockingManager *)::GetWindowLongPtr(hWndServer, GWL_USERDATA); | |
| 38 | 38 | if (pDockingManager) { |
| 39 | 39 | vector<DockingCont*> & vcontainer = pDockingManager->getContainerInfo(); |
| 40 | 40 | CWPSTRUCT * pCwp = (CWPSTRUCT*)lParam; |
| ... | ...@@ -162,11 +162,11 @@ | |
| 162 | 162 | case WM_NCCREATE : |
| 163 | 163 | pDockingManager = (DockingManager *)(((LPCREATESTRUCT)lParam)->lpCreateParams); |
| 164 | 164 | pDockingManager->_hSelf = hwnd; |
| 165 | ::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDockingManager)); | |
| 165 | ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDockingManager)); | |
| 166 | 166 | return TRUE; |
| 167 | 167 | |
| 168 | 168 | default : |
| 169 | pDockingManager = (DockingManager *)::GetWindowLong(hwnd, GWL_USERDATA); | |
| 169 | pDockingManager = (DockingManager *)::GetWindowLongPtr(hwnd, GWL_USERDATA); | |
| 170 | 170 | if (!pDockingManager) |
| 171 | 171 | return ::DefWindowProc(hwnd, message, wParam, lParam); |
| 172 | 172 | return pDockingManager->runProc(hwnd, message, wParam, lParam); |
| ... | ...@@ -77,7 +77,7 @@ | |
| 77 | 77 | LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); |
| 78 | 78 | |
| 79 | 79 | static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { |
| 80 | return (((TaskList *)(::GetWindowLong(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); | |
| 80 | return (((TaskList *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(hwnd, Message, wParam, lParam)); | |
| 81 | 81 | }; |
| 82 | 82 | |
| 83 | 83 | HFONT _hFont; |
| ... | ...@@ -43,8 +43,8 @@ | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| 46 | ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 47 | _buttonDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc))); | |
| 46 | ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); | |
| 47 | _buttonDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc))); | |
| 48 | 48 | |
| 49 | 49 | } |
| 50 | 50 |
| ... | ...@@ -18,27 +18,27 @@ | |
| 18 | 18 | const UINT WDN_NOTIFY = RegisterWindowMessage("WDN_NOTIFY"); |
| 19 | 19 | |
| 20 | 20 | inline static DWORD GetStyle(HWND hWnd) { |
| 21 | return (DWORD)GetWindowLong(hWnd, GWL_STYLE); | |
| 21 | return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE); | |
| 22 | 22 | } |
| 23 | 23 | inline static DWORD GetExStyle(HWND hWnd) { |
| 24 | return (DWORD)GetWindowLong(hWnd, GWL_EXSTYLE); | |
| 24 | return (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | inline static BOOL ModifyStyle(HWND hWnd, DWORD dwRemove, DWORD dwAdd) { |
| 28 | DWORD dwStyle = ::GetWindowLong(hWnd, GWL_STYLE); | |
| 28 | DWORD dwStyle = ::GetWindowLongPtr(hWnd, GWL_STYLE); | |
| 29 | 29 | DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd; |
| 30 | 30 | if(dwStyle == dwNewStyle) |
| 31 | 31 | return FALSE; |
| 32 | ::SetWindowLong(hWnd, GWL_STYLE, dwNewStyle); | |
| 32 | ::SetWindowLongPtr(hWnd, GWL_STYLE, dwNewStyle); | |
| 33 | 33 | return TRUE; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | inline static BOOL ModifyStyleEx(HWND hWnd, DWORD dwRemove, DWORD dwAdd) { |
| 37 | DWORD dwStyle = ::GetWindowLong(hWnd, GWL_EXSTYLE); | |
| 37 | DWORD dwStyle = ::GetWindowLongPtr(hWnd, GWL_EXSTYLE); | |
| 38 | 38 | DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd; |
| 39 | 39 | if(dwStyle == dwNewStyle) |
| 40 | 40 | return FALSE; |
| 41 | ::SetWindowLong(hWnd, GWL_EXSTYLE, dwNewStyle); | |
| 41 | ::SetWindowLongPtr(hWnd, GWL_EXSTYLE, dwNewStyle); | |
| 42 | 42 | return TRUE; |
| 43 | 43 | } |
| 44 | 44 |