[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:
parent
04f43d8563
commit
85db072c3e
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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<LONG>(this));
|
||||
::SetWindowLongPtrW(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_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
|
||||
{
|
||||
::SetWindowLongA(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
::SetWindowLongPtrA(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -43,8 +43,8 @@ void ColourPicker::init(HINSTANCE hInst, HWND parent)
|
||||
}
|
||||
|
||||
|
||||
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_buttonDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc)));
|
||||
::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_buttonDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc)));
|
||||
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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<ColourPopup *>(::GetWindowLong(hwnd, GWL_USERDATA));
|
||||
ColourPopup *pColourPopup = reinterpret_cast<ColourPopup *>(::GetWindowLongPtr(hwnd, GWL_USERDATA));
|
||||
if (!pColourPopup)
|
||||
return FALSE;
|
||||
return pColourPopup->run_dlgProc(message, wParam, lParam);
|
||||
|
@ -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<ColourStaticTextHooker *>(::GetWindowLong(hwnd, GWL_USERDATA));
|
||||
ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast<ColourStaticTextHooker *>(::GetWindowLongPtr(hwnd, GWL_USERDATA));
|
||||
return pColourStaticTextHooker->colourStaticProc(hwnd, message, wParam, lParam);
|
||||
};
|
||||
BOOL CALLBACK colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
|
@ -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<LONG>(this));
|
||||
_hDefaultCaptionProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hCaption, GWL_WNDPROC, reinterpret_cast<LONG>(wndCaptionProc)));
|
||||
::SetWindowLongPtr(_hCaption, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_hDefaultCaptionProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hCaption, GWL_WNDPROC, reinterpret_cast<LONG>(wndCaptionProc)));
|
||||
|
||||
/* intial subclassing of tab */
|
||||
::SetWindowLong(_hContTab, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_hDefaultTabProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hContTab, GWL_WNDPROC, reinterpret_cast<LONG>(wndTabProc)));
|
||||
::SetWindowLongPtr(_hContTab, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_hDefaultTabProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hContTab, GWL_WNDPROC, reinterpret_cast<LONG>(wndTabProc)));
|
||||
|
||||
/* set min tab width */
|
||||
::SendMessage(_hContTab, TCM_SETMINTABWIDTH, 0, (LPARAM)MIN_TABWIDTH);
|
||||
|
@ -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);
|
||||
|
@ -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<DockingCont*> & 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<LONG>(pDockingManager));
|
||||
::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(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);
|
||||
|
@ -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:
|
||||
|
@ -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<LONG>(pDockingSplitter));
|
||||
::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(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);
|
||||
|
@ -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<LONG>(pDlgMoving));
|
||||
::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(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);
|
||||
|
@ -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);
|
||||
*/
|
||||
|
@ -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<FileDialog *>(::GetWindowLong(hWnd, GWL_USERDATA));
|
||||
FileDialog *pFileDialog = reinterpret_cast<FileDialog *>(::GetWindowLongPtr(hWnd, GWL_USERDATA));
|
||||
if (!pFileDialog)
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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<LONG>(pSplitterContainer));
|
||||
::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG>(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);
|
||||
|
@ -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<StaticDialog *>(::GetWindowLong(hwnd, GWL_USERDATA));
|
||||
StaticDialog *pStaticDlg = reinterpret_cast<StaticDialog *>(::GetWindowLongPtr(hwnd, GWL_USERDATA));
|
||||
if (!pStaticDlg)
|
||||
return FALSE;
|
||||
return pStaticDlg->run_dlgProc(message, wParam, lParam);
|
||||
|
@ -210,8 +210,8 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad
|
||||
}
|
||||
_nbCtrl++;
|
||||
|
||||
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_tabBarDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(TabBarPlus_Proc)));
|
||||
::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_tabBarDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -57,8 +57,8 @@ void TaskList::init(HINSTANCE hInst, HWND parent, HIMAGELIST hImaLst, int nbItem
|
||||
throw int(69);
|
||||
}
|
||||
|
||||
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticProc)));
|
||||
::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticProc)));
|
||||
|
||||
DWORD exStyle = ListView_GetExtendedListViewStyle(_hSelf);
|
||||
exStyle |= LVS_EX_FULLROWSELECT | LVS_EX_BORDERSELECT ;
|
||||
|
@ -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;
|
||||
|
@ -39,8 +39,8 @@ void ToolTip::init(HINSTANCE hInst, HWND hParent)
|
||||
throw int(6969);
|
||||
}
|
||||
|
||||
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc)));
|
||||
::SetWindowLongPtr(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
|
||||
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(staticWinProc)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user