[NEW] Make x64 compiling compatible.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@304 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-08-06 01:33:46 +00:00
parent 04f43d8563
commit 85db072c3e
31 changed files with 85 additions and 85 deletions

View File

@ -4012,9 +4012,9 @@ void Notepad_plus::command(int id)
case IDM_EDIT_RTL : case IDM_EDIT_RTL :
case IDM_EDIT_LTR : 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); 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->defineDocType(_pEditView->getCurrentDocType());
_pEditView->redraw(); _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); Notepad_plus *pM30ide = (Notepad_plus *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pM30ide->_hSelf = hwnd; pM30ide->_hSelf = hwnd;
::SetWindowLong(hwnd, GWL_USERDATA, (LONG)pM30ide); ::SetWindowLongPtr(hwnd, GWL_USERDATA, (LONG)pM30ide);
return TRUE; return TRUE;
} }
default : 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);
} }
} }
} }

View File

@ -986,13 +986,13 @@ public:
void SetTransparent(HWND hwnd, int percent) { void SetTransparent(HWND hwnd, int percent) {
//WNDPROC transparentFunc = (NppParameters::getInstance())->getTransparentFunc(); //WNDPROC transparentFunc = (NppParameters::getInstance())->getTransparentFunc();
if (!_transparentFuncAddr) return; 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); _transparentFuncAddr(hwnd, 0, percent, 0x00000002);
}; };
void removeTransparent(HWND hwnd) { 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) { void setCmdlineParam(const CmdLineParams & cmdLineParams) {

View File

@ -195,15 +195,15 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
//Use either Unicode or ANSI setwindowlong, depending on environment //Use either Unicode or ANSI setwindowlong, depending on environment
if (::IsWindowUnicode(_hSelf)) if (::IsWindowUnicode(_hSelf))
{ {
::SetWindowLongW(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtrW(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
_callWindowProc = CallWindowProcW; _callWindowProc = CallWindowProcW;
_scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongW(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc))); _scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrW(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc)));
} }
else else
{ {
::SetWindowLongA(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtrA(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
_callWindowProc = CallWindowProcA; _callWindowProc = CallWindowProcA;
_scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongA(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc))); _scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrA(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc)));
} }
//Get the startup document and make a buffer for it so it can be accessed like a file //Get the startup document and make a buffer for it so it can be accessed like a file

View File

@ -510,7 +510,7 @@ protected:
static const int _markersArray[][NB_FOLDER_STATE]; static const int _markersArray[][NB_FOLDER_STATE];
static LRESULT CALLBACK scintillaStatic_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { 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) if (Message == WM_MOUSEWHEEL || Message == WM_MOUSEHWHEEL)
{ {
@ -518,7 +518,7 @@ protected:
POINTS pts = MAKEPOINTS(lParam); POINTS pts = MAKEPOINTS(lParam);
POINTSTOPOINT(pt, pts); POINTSTOPOINT(pt, pts);
HWND hwndOnMouse = WindowFromPoint(pt); HWND hwndOnMouse = WindowFromPoint(pt);
ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLong(hwndOnMouse, GWL_USERDATA)); ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLongPtr(hwndOnMouse, GWL_USERDATA));
if (pScintillaOnMouse != pScint) if (pScintillaOnMouse != pScint)
return ::SendMessage(hwndOnMouse, Message, wParam, lParam); return ::SendMessage(hwndOnMouse, Message, wParam, lParam);
} }

View File

@ -1154,17 +1154,17 @@ void UserDefineDialog::changeStyle()
_status = !_status; _status = !_status;
::SetDlgItemText(_hSelf, IDC_DOCK_BUTTON, (_status == DOCK)?"Undock":"Dock"); ::SetDlgItemText(_hSelf, IDC_DOCK_BUTTON, (_status == DOCK)?"Undock":"Dock");
long style = ::GetWindowLong(_hSelf, GWL_STYLE); long style = ::GetWindowLongPtr(_hSelf, GWL_STYLE);
if (!style) if (!style)
::MessageBox(NULL,"echou GetWindowLong", "", MB_OK); ::MessageBox(NULL,"echou GetWindowLongPtr", "", MB_OK);
style = (_status == DOCK)? style = (_status == DOCK)?
((style & ~WS_POPUP) & ~DS_MODALFRAME & ~WS_CAPTION) | WS_CHILD : ((style & ~WS_POPUP) & ~DS_MODALFRAME & ~WS_CAPTION) | WS_CHILD :
(style & ~WS_CHILD) | WS_POPUP | DS_MODALFRAME | WS_CAPTION; (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) if (!result)
::MessageBox(NULL,"echou SetWindowLong", "", MB_OK); ::MessageBox(NULL,"echou SetWindowLongPtr", "", MB_OK);
if (_status == DOCK) if (_status == DOCK)
getActualPosSize(); getActualPosSize();

View File

@ -119,7 +119,7 @@ static COLORREF getParentDlgBkColor(HWND hWnd)
void URLCtrl::create(HWND itemHandle, char * link, COLORREF linkColor) void URLCtrl::create(HWND itemHandle, char * link, COLORREF linkColor)
{ {
// turn on notify style // 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) // set the URL text (not the display text)
if (link) if (link)
@ -132,16 +132,16 @@ void URLCtrl::create(HWND itemHandle, char * link, COLORREF linkColor)
_visitedColor = RGB(128,0,128); _visitedColor = RGB(128,0,128);
// subclass the static control // 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 // 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) void URLCtrl::create(HWND itemHandle, int cmd, HWND msgDest)
{ {
// turn on notify style // 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; _cmdID = cmd;
_msgDest = msgDest; _msgDest = msgDest;
@ -150,10 +150,10 @@ void URLCtrl::create(HWND itemHandle, int cmd, HWND msgDest)
_linkColor = RGB(0,0,255); _linkColor = RGB(0,0,255);
// subclass the static control // 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 // 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) 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 // colours, and with an underline text style
case WM_PAINT: case WM_PAINT:
{ {
DWORD dwStyle = ::GetWindowLong(hwnd, GWL_STYLE); DWORD dwStyle = ::GetWindowLongPtr(hwnd, GWL_STYLE);
DWORD dwDTStyle = DT_SINGLELINE; DWORD dwDTStyle = DT_SINGLELINE;
//Test if centered horizontally or vertically //Test if centered horizontally or vertically

View File

@ -35,7 +35,7 @@ protected :
bool _clicking; bool _clicking;
static LRESULT CALLBACK URLCtrlProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam){ 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); LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
}; };

View File

@ -43,8 +43,8 @@ void ColourPicker::init(HINSTANCE hInst, HWND parent)
} }
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
_buttonDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc))); _buttonDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc)));
} }

View File

@ -52,7 +52,7 @@ private :
bool _isEnabled; bool _isEnabled;
static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { 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); LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam);
void drawForeground(HDC hDC); void drawForeground(HDC hDC);

View File

@ -62,14 +62,14 @@ BOOL CALLBACK ColourPopup::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
{ {
ColourPopup *pColourPopup = (ColourPopup *)(lParam); ColourPopup *pColourPopup = (ColourPopup *)(lParam);
pColourPopup->_hSelf = hwnd; pColourPopup->_hSelf = hwnd;
::SetWindowLong(hwnd, GWL_USERDATA, (long)lParam); ::SetWindowLongPtr(hwnd, GWL_USERDATA, (long)lParam);
pColourPopup->run_dlgProc(message, wParam, lParam); pColourPopup->run_dlgProc(message, wParam, lParam);
return TRUE; return TRUE;
} }
default : default :
{ {
ColourPopup *pColourPopup = reinterpret_cast<ColourPopup *>(::GetWindowLong(hwnd, GWL_USERDATA)); ColourPopup *pColourPopup = reinterpret_cast<ColourPopup *>(::GetWindowLongPtr(hwnd, GWL_USERDATA));
if (!pColourPopup) if (!pColourPopup)
return FALSE; return FALSE;
return pColourPopup->run_dlgProc(message, wParam, lParam); return pColourPopup->run_dlgProc(message, wParam, lParam);

View File

@ -47,15 +47,15 @@ public :
return oldColour; return oldColour;
}; };
void hookOn(HWND staticHandle) { void hookOn(HWND staticHandle) {
::SetWindowLong(staticHandle, GWL_USERDATA, (LONG)this); ::SetWindowLongPtr(staticHandle, GWL_USERDATA, (LONG)this);
_oldProc = (WNDPROC)::SetWindowLong(staticHandle, GWL_WNDPROC, (LONG)staticProc); _oldProc = (WNDPROC)::SetWindowLongPtr(staticHandle, GWL_WNDPROC, (LONG)staticProc);
}; };
private : private :
COLORREF _colour; COLORREF _colour;
WNDPROC _oldProc; WNDPROC _oldProc;
static BOOL CALLBACK staticProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ static BOOL CALLBACK staticProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast<ColourStaticTextHooker *>(::GetWindowLong(hwnd, GWL_USERDATA)); ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast<ColourStaticTextHooker *>(::GetWindowLongPtr(hwnd, GWL_USERDATA));
return pColourStaticTextHooker->colourStaticProc(hwnd, message, wParam, lParam); return pColourStaticTextHooker->colourStaticProc(hwnd, message, wParam, lParam);
}; };
BOOL CALLBACK colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);

View File

@ -98,14 +98,14 @@ void DockingCont::doDialog(bool willBeShown, bool isFloating)
if (_isFloating) if (_isFloating)
{ {
::SetWindowLong(_hSelf, GWL_STYLE, POPUP_STYLES); ::SetWindowLongPtr(_hSelf, GWL_STYLE, POPUP_STYLES);
::SetWindowLong(_hSelf, GWL_EXSTYLE, POPUP_EXSTYLES); ::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, POPUP_EXSTYLES);
::ShowWindow(_hCaption, SW_HIDE); ::ShowWindow(_hCaption, SW_HIDE);
} }
else else
{ {
::SetWindowLong(_hSelf, GWL_STYLE, CHILD_STYLES); ::SetWindowLongPtr(_hSelf, GWL_STYLE, CHILD_STYLES);
::SetWindowLong(_hSelf, GWL_EXSTYLE, CHILD_EXSTYLES); ::SetWindowLongPtr(_hSelf, GWL_EXSTYLE, CHILD_EXSTYLES);
::ShowWindow(_hCaption, SW_SHOW); ::ShowWindow(_hCaption, SW_SHOW);
} }
@ -124,8 +124,8 @@ tTbData* DockingCont::createToolbar(tTbData data, Window **ppWin)
*pTbData = data; *pTbData = data;
/* force window style of client window */ /* force window style of client window */
::SetWindowLong(pTbData->hClient, GWL_STYLE, CHILD_STYLES); ::SetWindowLongPtr(pTbData->hClient, GWL_STYLE, CHILD_STYLES);
::SetWindowLong(pTbData->hClient, GWL_EXSTYLE, CHILD_EXSTYLES); ::SetWindowLongPtr(pTbData->hClient, GWL_EXSTYLE, CHILD_EXSTYLES);
/* restore position if plugin is in floating state */ /* restore position if plugin is in floating state */
if ((_isFloating) && (::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0) == 0)) 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); _hCaption = ::GetDlgItem(_hSelf, IDC_BTN_CAPTION);
/* intial subclassing of caption */ /* intial subclassing of caption */
::SetWindowLong(_hCaption, GWL_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtr(_hCaption, GWL_USERDATA, reinterpret_cast<LONG>(this));
_hDefaultCaptionProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hCaption, GWL_WNDPROC, reinterpret_cast<LONG>(wndCaptionProc))); _hDefaultCaptionProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hCaption, GWL_WNDPROC, reinterpret_cast<LONG>(wndCaptionProc)));
/* intial subclassing of tab */ /* intial subclassing of tab */
::SetWindowLong(_hContTab, GWL_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtr(_hContTab, GWL_USERDATA, reinterpret_cast<LONG>(this));
_hDefaultTabProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hContTab, GWL_WNDPROC, reinterpret_cast<LONG>(wndTabProc))); _hDefaultTabProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hContTab, GWL_WNDPROC, reinterpret_cast<LONG>(wndTabProc)));
/* set min tab width */ /* set min tab width */
::SendMessage(_hContTab, TCM_SETMINTABWIDTH, 0, (LPARAM)MIN_TABWIDTH); ::SendMessage(_hContTab, TCM_SETMINTABWIDTH, 0, (LPARAM)MIN_TABWIDTH);

View File

@ -147,13 +147,13 @@ protected :
/* Subclassing caption */ /* Subclassing caption */
LRESULT runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); LRESULT runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK wndCaptionProc(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 */ /* Subclassing tab */
LRESULT runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); LRESULT runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK wndTabProc(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); virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -34,7 +34,7 @@ LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam);
/* Callback function that handles messages (to test focus) */ /* Callback function that handles messages (to test focus) */
LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam) { LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam) {
if (nCode == HC_ACTION && hWndServer) { if (nCode == HC_ACTION && hWndServer) {
DockingManager *pDockingManager = (DockingManager *)::GetWindowLong(hWndServer, GWL_USERDATA); DockingManager *pDockingManager = (DockingManager *)::GetWindowLongPtr(hWndServer, GWL_USERDATA);
if (pDockingManager) { if (pDockingManager) {
vector<DockingCont*> & vcontainer = pDockingManager->getContainerInfo(); vector<DockingCont*> & vcontainer = pDockingManager->getContainerInfo();
CWPSTRUCT * pCwp = (CWPSTRUCT*)lParam; CWPSTRUCT * pCwp = (CWPSTRUCT*)lParam;
@ -162,11 +162,11 @@ LRESULT CALLBACK DockingManager::staticWinProc(HWND hwnd, UINT message, WPARAM w
case WM_NCCREATE : case WM_NCCREATE :
pDockingManager = (DockingManager *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pDockingManager = (DockingManager *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pDockingManager->_hSelf = hwnd; pDockingManager->_hSelf = hwnd;
::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDockingManager)); ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDockingManager));
return TRUE; return TRUE;
default : default :
pDockingManager = (DockingManager *)::GetWindowLong(hwnd, GWL_USERDATA); pDockingManager = (DockingManager *)::GetWindowLongPtr(hwnd, GWL_USERDATA);
if (!pDockingManager) if (!pDockingManager)
return ::DefWindowProc(hwnd, message, wParam, lParam); return ::DefWindowProc(hwnd, message, wParam, lParam);
return pDockingManager->runProc(hwnd, message, wParam, lParam); return pDockingManager->runProc(hwnd, message, wParam, lParam);

View File

@ -183,7 +183,7 @@ private :
nmhdr.hwndFrom = _hParent; nmhdr.hwndFrom = _hParent;
nmhdr.idFrom = ::GetDlgCtrlID(_hParent); nmhdr.idFrom = ::GetDlgCtrlID(_hParent);
::SendMessage(hWnd, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr); ::SendMessage(hWnd, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr);
return ::GetWindowLong(hWnd, DWL_MSGRESULT); return ::GetWindowLongPtr(hWnd, DWL_MSGRESULT);
}; };
private: private:

View File

@ -121,11 +121,11 @@ LRESULT CALLBACK DockingSplitter::staticWinProc(HWND hwnd, UINT message, WPARAM
case WM_NCCREATE : case WM_NCCREATE :
pDockingSplitter = (DockingSplitter *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pDockingSplitter = (DockingSplitter *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pDockingSplitter->_hSelf = hwnd; pDockingSplitter->_hSelf = hwnd;
::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDockingSplitter)); ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDockingSplitter));
return TRUE; return TRUE;
default : default :
pDockingSplitter = (DockingSplitter *)::GetWindowLong(hwnd, GWL_USERDATA); pDockingSplitter = (DockingSplitter *)::GetWindowLongPtr(hwnd, GWL_USERDATA);
if (!pDockingSplitter) if (!pDockingSplitter)
return ::DefWindowProc(hwnd, message, wParam, lParam); return ::DefWindowProc(hwnd, message, wParam, lParam);
return pDockingSplitter->runProc(hwnd, message, wParam, lParam); return pDockingSplitter->runProc(hwnd, message, wParam, lParam);

View File

@ -169,11 +169,11 @@ LRESULT CALLBACK Gripper::staticWinProc(HWND hwnd, UINT message, WPARAM wParam,
case WM_NCCREATE : case WM_NCCREATE :
pDlgMoving = (Gripper *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pDlgMoving = (Gripper *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pDlgMoving->_hSelf = hwnd; pDlgMoving->_hSelf = hwnd;
::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDlgMoving)); ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pDlgMoving));
return TRUE; return TRUE;
default : default :
pDlgMoving = (Gripper *)::GetWindowLong(hwnd, GWL_USERDATA); pDlgMoving = (Gripper *)::GetWindowLongPtr(hwnd, GWL_USERDATA);
if (!pDlgMoving) if (!pDlgMoving)
return ::DefWindowProc(hwnd, message, wParam, lParam); return ::DefWindowProc(hwnd, message, wParam, lParam);
return pDlgMoving->runProc(message, wParam, lParam); return pDlgMoving->runProc(message, wParam, lParam);

View File

@ -81,7 +81,7 @@ private :
static bool _isRegistered; static bool _isRegistered;
/* /*
static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { 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); LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam);
*/ */

View File

@ -281,7 +281,7 @@ UINT_PTR CALLBACK FileDialog::OFNHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
NppParameters *pNppParam = NppParameters::getInstance(); NppParameters *pNppParam = NppParameters::getInstance();
int index = pNppParam->getFileSaveDlgFilterIndex(); int index = pNppParam->getFileSaveDlgFilterIndex();
::SetWindowLong(hWnd, GWL_USERDATA, (long)staticThis); ::SetWindowLongPtr(hWnd, GWL_USERDATA, (long)staticThis);
hFileDlg = ::GetParent(hWnd); hFileDlg = ::GetParent(hWnd);
goToCenter(hFileDlg); 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 !!! // 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) if ((long)oldProc > 0)
::SetWindowLong(hFileDlg, GWL_WNDPROC, (LONG)fileDlgProc); ::SetWindowLongPtr(hFileDlg, GWL_WNDPROC, (LONG)fileDlgProc);
return FALSE; return FALSE;
} }
default : default :
{ {
FileDialog *pFileDialog = reinterpret_cast<FileDialog *>(::GetWindowLong(hWnd, GWL_USERDATA)); FileDialog *pFileDialog = reinterpret_cast<FileDialog *>(::GetWindowLongPtr(hWnd, GWL_USERDATA));
if (!pFileDialog) if (!pFileDialog)
{ {
return FALSE; return FALSE;

View File

@ -128,7 +128,7 @@ public:
static int _dialogFileBoxId; static int _dialogFileBoxId;
protected : 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); BOOL APIENTRY run(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
private: private:

View File

@ -238,12 +238,12 @@ LRESULT CALLBACK Splitter::staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
{ {
Splitter * pSplitter = (Splitter *)((LPCREATESTRUCT)lParam)->lpCreateParams; Splitter * pSplitter = (Splitter *)((LPCREATESTRUCT)lParam)->lpCreateParams;
pSplitter->_hSelf = hWnd; pSplitter->_hSelf = hWnd;
::SetWindowLong(hWnd, GWL_USERDATA, (long)pSplitter); ::SetWindowLongPtr(hWnd, GWL_USERDATA, (long)pSplitter);
return TRUE; return TRUE;
} }
default: default:
{ {
Splitter * pSplitter = (Splitter *)::GetWindowLong(hWnd, GWL_USERDATA); Splitter * pSplitter = (Splitter *)::GetWindowLongPtr(hWnd, GWL_USERDATA);
if (!pSplitter) if (!pSplitter)
return ::DefWindowProc(hWnd, uMsg, wParam, lParam); return ::DefWindowProc(hWnd, uMsg, wParam, lParam);

View File

@ -114,11 +114,11 @@ LRESULT CALLBACK SplitterContainer::staticWinProc(HWND hwnd, UINT message, WPARA
case WM_NCCREATE : case WM_NCCREATE :
pSplitterContainer = (SplitterContainer *)(((LPCREATESTRUCT)lParam)->lpCreateParams); pSplitterContainer = (SplitterContainer *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
pSplitterContainer->_hSelf = hwnd; pSplitterContainer->_hSelf = hwnd;
::SetWindowLong(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pSplitterContainer)); ::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(pSplitterContainer));
return TRUE; return TRUE;
default : default :
pSplitterContainer = (SplitterContainer *)::GetWindowLong(hwnd, GWL_USERDATA); pSplitterContainer = (SplitterContainer *)::GetWindowLongPtr(hwnd, GWL_USERDATA);
if (!pSplitterContainer) if (!pSplitterContainer)
return ::DefWindowProc(hwnd, message, wParam, lParam); return ::DefWindowProc(hwnd, message, wParam, lParam);
return pSplitterContainer->runProc(message, wParam, lParam); return pSplitterContainer->runProc(message, wParam, lParam);

View File

@ -115,7 +115,7 @@ BOOL CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPAR
{ {
StaticDialog *pStaticDlg = (StaticDialog *)(lParam); StaticDialog *pStaticDlg = (StaticDialog *)(lParam);
pStaticDlg->_hSelf = hwnd; pStaticDlg->_hSelf = hwnd;
::SetWindowLong(hwnd, GWL_USERDATA, (long)lParam); ::SetWindowLongPtr(hwnd, GWL_USERDATA, (long)lParam);
::GetWindowRect(hwnd, &(pStaticDlg->_rc)); ::GetWindowRect(hwnd, &(pStaticDlg->_rc));
pStaticDlg->run_dlgProc(message, wParam, lParam); pStaticDlg->run_dlgProc(message, wParam, lParam);
@ -124,7 +124,7 @@ BOOL CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPAR
default : default :
{ {
StaticDialog *pStaticDlg = reinterpret_cast<StaticDialog *>(::GetWindowLong(hwnd, GWL_USERDATA)); StaticDialog *pStaticDlg = reinterpret_cast<StaticDialog *>(::GetWindowLongPtr(hwnd, GWL_USERDATA));
if (!pStaticDlg) if (!pStaticDlg)
return FALSE; return FALSE;
return pStaticDlg->run_dlgProc(message, wParam, lParam); return pStaticDlg->run_dlgProc(message, wParam, lParam);

View File

@ -210,8 +210,8 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad
} }
_nbCtrl++; _nbCtrl++;
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
_tabBarDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(TabBarPlus_Proc))); _tabBarDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(TabBarPlus_Proc)));
} }
LOGFONT LogFont; LOGFONT LogFont;
@ -244,7 +244,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
{ {
DWORD style; DWORD style;
//::SendMessage(upDownWnd, UDM_SETBUDDY, NULL, 0); //::SendMessage(upDownWnd, UDM_SETBUDDY, NULL, 0);
style = ::GetWindowLong(hwnd, GWL_STYLE); style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
if (wParam > 0) if (wParam > 0)
style |= lParam; style |= lParam;
@ -254,7 +254,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
_isVertical = ((style & TCS_VERTICAL) != 0); _isVertical = ((style & TCS_VERTICAL) != 0);
_isMultiLine = ((style & TCS_MULTILINE) != 0); _isMultiLine = ((style & TCS_MULTILINE) != 0);
::SetWindowLong(hwnd, GWL_STYLE, style); ::SetWindowLongPtr(hwnd, GWL_STYLE, style);
::InvalidateRect(hwnd, NULL, TRUE); ::InvalidateRect(hwnd, NULL, TRUE);
return TRUE; return TRUE;

View File

@ -225,13 +225,13 @@ public :
{ {
if (_hwndArray[i]) if (_hwndArray[i])
{ {
DWORD style = ::GetWindowLong(_hwndArray[i], GWL_STYLE); DWORD style = ::GetWindowLongPtr(_hwndArray[i], GWL_STYLE);
if (isOwnerDrawTab()) if (isOwnerDrawTab())
style |= TCS_OWNERDRAWFIXED; style |= TCS_OWNERDRAWFIXED;
else else
style &= ~TCS_OWNERDRAWFIXED; style &= ~TCS_OWNERDRAWFIXED;
::SetWindowLong(_hwndArray[i], GWL_STYLE, style); ::SetWindowLongPtr(_hwndArray[i], GWL_STYLE, style);
::InvalidateRect(_hwndArray[i], NULL, TRUE); ::InvalidateRect(_hwndArray[i], NULL, TRUE);
const int base = 6; const int base = 6;
@ -337,7 +337,7 @@ protected:
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK TabBarPlus_Proc(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); void exchangeItemData(POINT point);

View File

@ -57,8 +57,8 @@ void TaskList::init(HINSTANCE hInst, HWND parent, HIMAGELIST hImaLst, int nbItem
throw int(69); throw int(69);
} }
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticProc))); _defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticProc)));
DWORD exStyle = ListView_GetExtendedListViewStyle(_hSelf); DWORD exStyle = ListView_GetExtendedListViewStyle(_hSelf);
exStyle |= LVS_EX_FULLROWSELECT | LVS_EX_BORDERSELECT ; exStyle |= LVS_EX_FULLROWSELECT | LVS_EX_BORDERSELECT ;

View File

@ -77,7 +77,7 @@ protected:
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK staticProc(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; HFONT _hFont;

View File

@ -39,8 +39,8 @@ void ToolTip::init(HINSTANCE hInst, HWND hParent)
throw int(6969); throw int(6969);
} }
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc))); _defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc)));
} }
} }

View File

@ -54,7 +54,7 @@ protected:
static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { 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); LRESULT runProc(UINT Message, WPARAM wParam, LPARAM lParam);
void SendHitMessage(void); void SendHitMessage(void);

View File

@ -14,11 +14,11 @@
// Theo - Style Helpers // Theo - Style Helpers
inline static DWORD GetStyle(HWND hWnd) { inline static DWORD GetStyle(HWND hWnd) {
return (DWORD)GetWindowLong(hWnd, GWL_STYLE); return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE);
} }
inline static DWORD GetExStyle(HWND hWnd) { 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"); const UINT WM_WINMGR = RegisterWindowMessage("WM_WINMGR");

View File

@ -18,27 +18,27 @@ static const char *readonlyString = " [Read Only]";
const UINT WDN_NOTIFY = RegisterWindowMessage("WDN_NOTIFY"); const UINT WDN_NOTIFY = RegisterWindowMessage("WDN_NOTIFY");
inline static DWORD GetStyle(HWND hWnd) { inline static DWORD GetStyle(HWND hWnd) {
return (DWORD)GetWindowLong(hWnd, GWL_STYLE); return (DWORD)GetWindowLongPtr(hWnd, GWL_STYLE);
} }
inline static DWORD GetExStyle(HWND hWnd) { 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) { 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; DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd;
if(dwStyle == dwNewStyle) if(dwStyle == dwNewStyle)
return FALSE; return FALSE;
::SetWindowLong(hWnd, GWL_STYLE, dwNewStyle); ::SetWindowLongPtr(hWnd, GWL_STYLE, dwNewStyle);
return TRUE; return TRUE;
} }
inline static BOOL ModifyStyleEx(HWND hWnd, DWORD dwRemove, DWORD dwAdd) { 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; DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd;
if(dwStyle == dwNewStyle) if(dwStyle == dwNewStyle)
return FALSE; return FALSE;
::SetWindowLong(hWnd, GWL_EXSTYLE, dwNewStyle); ::SetWindowLongPtr(hWnd, GWL_EXSTYLE, dwNewStyle);
return TRUE; return TRUE;
} }