Lost in translation

while (true)
{
conversion<C++>(C-Style cast );
}
This commit is contained in:
Don HO 2016-08-06 01:29:54 +02:00
parent e76c929137
commit 2e82a99649
24 changed files with 157 additions and 184 deletions

View File

@ -2824,7 +2824,7 @@ void Notepad_plus::setTitle()
if (_isAdministrator) if (_isAdministrator)
result += TEXT(" [Administrator]"); result += TEXT(" [Administrator]");
::SendMessage(_pPublicInterface->getHSelf(), WM_SETTEXT, 0, (LPARAM)result.c_str()); ::SendMessage(_pPublicInterface->getHSelf(), WM_SETTEXT, 0, reinterpret_cast<LPARAM>(result.c_str()));
} }
void Notepad_plus::activateNextDoc(bool direction) void Notepad_plus::activateNextDoc(bool direction)

View File

@ -725,14 +725,11 @@ generic_string ThemeSwitcher::getThemeFromXmlFileName(const TCHAR *xmlFullPath)
if (!xmlFullPath || !xmlFullPath[0]) if (!xmlFullPath || !xmlFullPath[0])
return generic_string(); return generic_string();
generic_string fn(::PathFindFileName(xmlFullPath)); generic_string fn(::PathFindFileName(xmlFullPath));
PathRemoveExtension((TCHAR *)fn.c_str()); PathRemoveExtension(const_cast<TCHAR *>(fn.c_str()));
return fn; return fn;
} }
#pragma warning(disable : 4996)
winVer getWindowsVersion() winVer getWindowsVersion()
{ {
OSVERSIONINFOEX osvi; OSVERSIONINFOEX osvi;

View File

@ -539,7 +539,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
{ {
char userMatchedChar[2] = { '\0', '\0' }; char userMatchedChar[2] = { '\0', '\0' };
userMatchedChar[0] = matchedPairs[i].second; userMatchedChar[0] = matchedPairs[i].second;
_pEditView->execute(SCI_INSERTTEXT, caretPos, (LPARAM)userMatchedChar); _pEditView->execute(SCI_INSERTTEXT, caretPos, reinterpret_cast<LPARAM>(userMatchedChar));
return; return;
} }
} }
@ -559,7 +559,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
{ {
matchedChars = ")"; matchedChars = ")";
_insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1)); _insertedMatchedChars.add(MatchedCharInserted(static_cast<char>(character), caretPos - 1));
} }
} }
break; break;
@ -570,7 +570,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
if (isCharNextBlank || isInSandwich) if (isCharNextBlank || isInSandwich)
{ {
matchedChars = "]"; matchedChars = "]";
_insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1)); _insertedMatchedChars.add(MatchedCharInserted(static_cast<char>(character), caretPos - 1));
} }
} }
break; break;
@ -581,7 +581,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
if (isCharNextBlank || isInSandwich) if (isCharNextBlank || isInSandwich)
{ {
matchedChars = "}"; matchedChars = "}";
_insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1)); _insertedMatchedChars.add(MatchedCharInserted(static_cast<char>(character), caretPos - 1));
} }
} }
break; break;
@ -591,7 +591,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
{ {
if (!_insertedMatchedChars.isEmpty()) if (!_insertedMatchedChars.isEmpty())
{ {
int pos = _insertedMatchedChars.search('"', char(character), caretPos); int pos = _insertedMatchedChars.search('"', static_cast<char>(character), caretPos);
if (pos != -1) if (pos != -1)
{ {
_pEditView->execute(SCI_DELETERANGE, pos, 1); _pEditView->execute(SCI_DELETERANGE, pos, 1);
@ -606,7 +606,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
(charPrev == '{' && isCharNextBlank) || (isCharPrevBlank && charNext == '}')) (charPrev == '{' && isCharNextBlank) || (isCharPrevBlank && charNext == '}'))
{ {
matchedChars = "\""; matchedChars = "\"";
_insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1)); _insertedMatchedChars.add(MatchedCharInserted(static_cast<char>(character), caretPos - 1));
} }
} }
break; break;
@ -615,7 +615,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
{ {
if (!_insertedMatchedChars.isEmpty()) if (!_insertedMatchedChars.isEmpty())
{ {
int pos = _insertedMatchedChars.search('\'', char(character), caretPos); int pos = _insertedMatchedChars.search('\'', static_cast<char>(character), caretPos);
if (pos != -1) if (pos != -1)
{ {
_pEditView->execute(SCI_DELETERANGE, pos, 1); _pEditView->execute(SCI_DELETERANGE, pos, 1);
@ -630,7 +630,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
(charPrev == '{' && isCharNextBlank) || (isCharPrevBlank && charNext == '}')) (charPrev == '{' && isCharNextBlank) || (isCharPrevBlank && charNext == '}'))
{ {
matchedChars = "'"; matchedChars = "'";
_insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1)); _insertedMatchedChars.add(MatchedCharInserted(static_cast<char>(character), caretPos - 1));
} }
} }
break; break;
@ -671,7 +671,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
startChar = '{'; startChar = '{';
} }
int pos = _insertedMatchedChars.search(startChar, char(character), caretPos); int pos = _insertedMatchedChars.search(startChar, static_cast<char>(character), caretPos);
if (pos != -1) if (pos != -1)
{ {
_pEditView->execute(SCI_DELETERANGE, pos, 1); _pEditView->execute(SCI_DELETERANGE, pos, 1);
@ -683,11 +683,11 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
default: default:
if (!_insertedMatchedChars.isEmpty()) if (!_insertedMatchedChars.isEmpty())
_insertedMatchedChars.removeInvalidElements(MatchedCharInserted(char(character), caretPos - 1)); _insertedMatchedChars.removeInvalidElements(MatchedCharInserted(static_cast<char>(character), caretPos - 1));
} }
if (matchedChars) if (matchedChars)
_pEditView->execute(SCI_INSERTTEXT, caretPos, (LPARAM)matchedChars); _pEditView->execute(SCI_INSERTTEXT, caretPos, reinterpret_cast<LPARAM>(matchedChars));
} }

View File

@ -1408,7 +1408,7 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
TCHAR * name = NppParameters::getInstance()->getELCFromIndex(id)._name; TCHAR * name = NppParameters::getInstance()->getELCFromIndex(id)._name;
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
const char *pName = wmc->wchar2char(name, CP_ACP); const char *pName = wmc->wchar2char(name, CP_ACP);
_pscratchTilla->execute(SCI_SETLEXERLANGUAGE, 0, (LPARAM)pName); _pscratchTilla->execute(SCI_SETLEXERLANGUAGE, 0, reinterpret_cast<LPARAM>(pName));
} }
if (encoding != -1) if (encoding != -1)
@ -1462,14 +1462,14 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
if (encoding == SC_CP_UTF8) if (encoding == SC_CP_UTF8)
{ {
// Pass through UTF-8 (this does not check validity of characters, thus inserting a multi-byte character in two halfs is working) // Pass through UTF-8 (this does not check validity of characters, thus inserting a multi-byte character in two halfs is working)
_pscratchTilla->execute(SCI_APPENDTEXT, lenFile, (LPARAM)data); _pscratchTilla->execute(SCI_APPENDTEXT, lenFile, reinterpret_cast<LPARAM>(data));
} }
else else
{ {
WcharMbcsConvertor* wmc = WcharMbcsConvertor::getInstance(); WcharMbcsConvertor* wmc = WcharMbcsConvertor::getInstance();
int newDataLen = 0; int newDataLen = 0;
const char *newData = wmc->encode(encoding, SC_CP_UTF8, data, static_cast<int32_t>(lenFile), &newDataLen, &incompleteMultibyteChar); const char *newData = wmc->encode(encoding, SC_CP_UTF8, data, static_cast<int32_t>(lenFile), &newDataLen, &incompleteMultibyteChar);
_pscratchTilla->execute(SCI_APPENDTEXT, newDataLen, (LPARAM)newData); _pscratchTilla->execute(SCI_APPENDTEXT, newDataLen, reinterpret_cast<LPARAM>(newData));
} }
if (format == EolType::unknown) if (format == EolType::unknown)
@ -1478,7 +1478,7 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
else else
{ {
lenConvert = unicodeConvertor->convert(data, lenFile); lenConvert = unicodeConvertor->convert(data, lenFile);
_pscratchTilla->execute(SCI_APPENDTEXT, lenConvert, (LPARAM)(unicodeConvertor->getNewBuf())); _pscratchTilla->execute(SCI_APPENDTEXT, lenConvert, reinterpret_cast<LPARAM>(unicodeConvertor->getNewBuf()));
if (format == EolType::unknown) if (format == EolType::unknown)
format = getEOLFormatForm(unicodeConvertor->getNewBuf(), unicodeConvertor->getNewSize(), EolType::unknown); format = getEOLFormatForm(unicodeConvertor->getNewBuf(), unicodeConvertor->getNewSize(), EolType::unknown);
} }

View File

@ -45,20 +45,20 @@ void addText2Combo(const TCHAR * txt2add, HWND hCombo)
if (!hCombo) return; if (!hCombo) return;
if (!lstrcmp(txt2add, TEXT(""))) return; if (!lstrcmp(txt2add, TEXT(""))) return;
auto i = ::SendMessage(hCombo, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)txt2add); auto i = ::SendMessage(hCombo, CB_FINDSTRINGEXACT, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(txt2add));
if (i != CB_ERR) // found if (i != CB_ERR) // found
{ {
::SendMessage(hCombo, CB_DELETESTRING, i, 0); ::SendMessage(hCombo, CB_DELETESTRING, i, 0);
} }
i = ::SendMessage(hCombo, CB_INSERTSTRING, 0, (LPARAM)txt2add); i = ::SendMessage(hCombo, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(txt2add));
::SendMessage(hCombo, CB_SETCURSEL, i, 0); ::SendMessage(hCombo, CB_SETCURSEL, i, 0);
}; };
generic_string getTextFromCombo(HWND hCombo) generic_string getTextFromCombo(HWND hCombo)
{ {
TCHAR str[FINDREPLACE_MAXLENGTH]; TCHAR str[FINDREPLACE_MAXLENGTH];
::SendMessage(hCombo, WM_GETTEXT, FINDREPLACE_MAXLENGTH - 1, (LPARAM)str); ::SendMessage(hCombo, WM_GETTEXT, FINDREPLACE_MAXLENGTH - 1, reinterpret_cast<LPARAM>(str));
return generic_string(str); return generic_string(str);
}; };
@ -464,7 +464,7 @@ void Finder::gotoFoundLine()
const FoundInfo fInfo = *(_pMainFoundInfos->begin() + lno); const FoundInfo fInfo = *(_pMainFoundInfos->begin() + lno);
// Switch to another document // Switch to another document
::SendMessage(::GetParent(_hParent), WM_DOOPEN, 0, (LPARAM)fInfo._fullPath.c_str()); ::SendMessage(::GetParent(_hParent), WM_DOOPEN, 0, reinterpret_cast<LPARAM>(fInfo._fullPath.c_str()));
Searching::displaySectionCentered(fInfo._start, fInfo._end, *_ppEditView); Searching::displaySectionCentered(fInfo._start, fInfo._end, *_ppEditView);
// Then we colourise the double clicked line // Then we colourise the double clicked line
@ -1984,7 +1984,7 @@ void FindReplaceDlg::findAllIn(InWhat op)
_pFinder->_scintView.display(); _pFinder->_scintView.display();
_pFinder->display(); _pFinder->display();
::SendMessage(_hParent, NPPM_DMMHIDE, 0, (LPARAM)_pFinder->getHSelf()); ::SendMessage(_hParent, NPPM_DMMHIDE, 0, reinterpret_cast<LPARAM>(_pFinder->getHSelf()));
::UpdateWindow(_hParent); ::UpdateWindow(_hParent);
justCreated = true; justCreated = true;
} }
@ -1995,7 +1995,7 @@ void FindReplaceDlg::findAllIn(InWhat op)
// Send the address of _MarkingsStruct to the lexer // Send the address of _MarkingsStruct to the lexer
char ptrword[sizeof(void*)*2+1]; char ptrword[sizeof(void*)*2+1];
sprintf(ptrword, "%p", &_pFinder->_markingsStruct); sprintf(ptrword, "%p", &_pFinder->_markingsStruct);
_pFinder->_scintView.execute(SCI_SETPROPERTY, (WPARAM)"@MarkingsStruct", (LPARAM)ptrword); _pFinder->_scintView.execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("@MarkingsStruct"), reinterpret_cast<LPARAM>(ptrword));
} }
::SendMessage(_pFinder->getHSelf(), WM_SIZE, 0, 0); ::SendMessage(_pFinder->getHSelf(), WM_SIZE, 0, 0);
@ -2023,12 +2023,12 @@ void FindReplaceDlg::findAllIn(InWhat op)
else else
{ {
// Show finder // Show finder
::SendMessage(_hParent, NPPM_DMMSHOW, 0, (LPARAM)_pFinder->getHSelf()); ::SendMessage(_hParent, NPPM_DMMSHOW, 0, reinterpret_cast<LPARAM>(_pFinder->getHSelf()));
getFocus(); // no hits getFocus(); // no hits
} }
} }
else // error - search folder doesn't exist else // error - search folder doesn't exist
::SendMessage(_hSelf, WM_NEXTDLGCTL, (WPARAM)::GetDlgItem(_hSelf, IDD_FINDINFILES_DIR_COMBO), TRUE); ::SendMessage(_hSelf, WM_NEXTDLGCTL, reinterpret_cast<WPARAM>(::GetDlgItem(_hSelf, IDD_FINDINFILES_DIR_COMBO)), TRUE);
} }
Finder * FindReplaceDlg::createFinder() Finder * FindReplaceDlg::createFinder()
@ -2039,7 +2039,7 @@ Finder * FindReplaceDlg::createFinder()
tTbData data = { 0 }; tTbData data = { 0 };
pFinder->create(&data, false); pFinder->create(&data, false);
::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, (WPARAM)pFinder->getHSelf()); ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<WPARAM>(pFinder->getHSelf()));
// define the default docking behaviour // define the default docking behaviour
data.uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB | DWS_ADDINFO; data.uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB | DWS_ADDINFO;
data.hIconTab = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_FIND_RESULT_ICON), IMAGE_ICON, 0, 0, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); data.hIconTab = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_FIND_RESULT_ICON), IMAGE_ICON, 0, 0, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT);
@ -2050,12 +2050,12 @@ Finder * FindReplaceDlg::createFinder()
// the dlgDlg should be the index of funcItem where the current function pointer is // the dlgDlg should be the index of funcItem where the current function pointer is
// in this case is DOCKABLE_DEMO_INDEX // in this case is DOCKABLE_DEMO_INDEX
data.dlgID = 0; data.dlgID = 0;
::SendMessage(_hParent, NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data); ::SendMessage(_hParent, NPPM_DMMREGASDCKDLG, 0, reinterpret_cast<LPARAM>(&data));
pFinder->_scintView.init(_hInst, pFinder->getHSelf()); pFinder->_scintView.init(_hInst, pFinder->getHSelf());
// Subclass the ScintillaEditView for the Finder (Scintilla doesn't notify all key presses) // Subclass the ScintillaEditView for the Finder (Scintilla doesn't notify all key presses)
originalFinderProc = SetWindowLongPtr(pFinder->_scintView.getHSelf(), GWLP_WNDPROC, (LONG_PTR)finderProc); originalFinderProc = SetWindowLongPtr(pFinder->_scintView.getHSelf(), GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(finderProc));
pFinder->setFinderReadOnly(true); pFinder->setFinderReadOnly(true);
pFinder->_scintView.execute(SCI_SETCODEPAGE, SC_CP_UTF8); pFinder->_scintView.execute(SCI_SETCODEPAGE, SC_CP_UTF8);
@ -2075,47 +2075,24 @@ Finder * FindReplaceDlg::createFinder()
pFinder->_scintView.display(); pFinder->_scintView.display();
pFinder->display(); pFinder->display();
//::SendMessage(_hParent, NPPM_DMMHIDE, 0, (LPARAM)pFinder->getHSelf());
::UpdateWindow(_hParent); ::UpdateWindow(_hParent);
//justCreated = true;
pFinder->setFinderStyle(); pFinder->setFinderStyle();
// Send the address of _MarkingsStruct to the lexer // Send the address of _MarkingsStruct to the lexer
char ptrword[sizeof(void*) * 2 + 1]; char ptrword[sizeof(void*) * 2 + 1];
sprintf(ptrword, "%p", &pFinder->_markingsStruct); sprintf(ptrword, "%p", &pFinder->_markingsStruct);
pFinder->_scintView.execute(SCI_SETPROPERTY, (WPARAM)"@MarkingsStruct", (LPARAM)ptrword); pFinder->_scintView.execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("@MarkingsStruct"), reinterpret_cast<LPARAM>(ptrword));
_findersOfFinder.push_back(pFinder); _findersOfFinder.push_back(pFinder);
::SendMessage(pFinder->getHSelf(), WM_SIZE, 0, 0); ::SendMessage(pFinder->getHSelf(), WM_SIZE, 0, 0);
// Show finder // Show finder
::SendMessage(_hParent, NPPM_DMMSHOW, 0, (LPARAM)pFinder->getHSelf()); ::SendMessage(_hParent, NPPM_DMMSHOW, 0, reinterpret_cast<LPARAM>(pFinder->getHSelf()));
pFinder->_scintView.getFocus(); pFinder->_scintView.getFocus();
return pFinder; return pFinder;
/*
{
if (_findAllResult == 1)
wsprintf(_findAllResultStr, TEXT("1 hit"));
else
wsprintf(_findAllResultStr, TEXT("%d hits"), _findAllResult);
if (_findAllResult)
{
focusOnFinder();
}
else
{
// Show finder
::SendMessage(_hParent, NPPM_DMMSHOW, 0, (LPARAM)pFinder->getHSelf());
getFocus(); // no hits
}
}
else // error - search folder doesn't exist
::SendMessage(_hSelf, WM_NEXTDLGCTL, (WPARAM)::GetDlgItem(_hSelf, IDD_FINDINFILES_DIR_COMBO), TRUE);
*/
} }
bool FindReplaceDlg::removeFinder(Finder *finder2remove) bool FindReplaceDlg::removeFinder(Finder *finder2remove)
@ -2137,7 +2114,7 @@ void FindReplaceDlg::setSearchText(TCHAR * txt2find) {
if (txt2find && txt2find[0]) if (txt2find && txt2find[0])
{ {
// We got a valid search string // We got a valid search string
::SendMessage(hCombo, CB_SETCURSEL, (WPARAM)-1, 0); // remove selection - to allow using down arrow to get to last searched word ::SendMessage(hCombo, CB_SETCURSEL, static_cast<WPARAM>(-1), 0); // remove selection - to allow using down arrow to get to last searched word
::SetDlgItemText(_hSelf, IDFINDWHAT, txt2find); ::SetDlgItemText(_hSelf, IDFINDWHAT, txt2find);
} }
::SendMessage(hCombo, CB_SETEDITSEL, 0, MAKELPARAM(0, -1)); // select all text - fast edit ::SendMessage(hCombo, CB_SETEDITSEL, 0, MAKELPARAM(0, -1)); // select all text - fast edit
@ -2254,11 +2231,11 @@ void FindReplaceDlg::saveInMacro(size_t cmd, int cmdType)
booleans |= _options._doMarkLine?IDF_MARKLINE_CHECK:0; booleans |= _options._doMarkLine?IDF_MARKLINE_CHECK:0;
} }
if (cmdType & FR_OP_REPLACE) if (cmdType & FR_OP_REPLACE)
::SendMessage(_hParent, WM_FRSAVE_STR, IDREPLACEWITH, (LPARAM)_options._str4Replace.c_str()); ::SendMessage(_hParent, WM_FRSAVE_STR, IDREPLACEWITH, reinterpret_cast<LPARAM>(_options._str4Replace.c_str()));
if (cmdType & FR_OP_FIF) if (cmdType & FR_OP_FIF)
{ {
::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_DIR_COMBO, (LPARAM)_options._directory.c_str()); ::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_DIR_COMBO, reinterpret_cast<LPARAM>(_options._directory.c_str()));
::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_FILTERS_COMBO, (LPARAM)_options._filters.c_str()); ::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_FILTERS_COMBO, reinterpret_cast<LPARAM>(_options._filters.c_str()));
booleans |= _options._isRecursive?IDF_FINDINFILES_RECURSIVE_CHECK:0; booleans |= _options._isRecursive?IDF_FINDINFILES_RECURSIVE_CHECK:0;
booleans |= _options._isInHiddenDir?IDF_FINDINFILES_INHIDDENDIR_CHECK:0; booleans |= _options._isInHiddenDir?IDF_FINDINFILES_INHIDDENDIR_CHECK:0;
} }
@ -2776,7 +2753,7 @@ void Finder::openAll()
for (size_t i = 0; i < sz; ++i) for (size_t i = 0; i < sz; ++i)
{ {
::SendMessage(::GetParent(_hParent), WM_DOOPEN, 0, (LPARAM)_pMainFoundInfos->at(i)._fullPath.c_str()); ::SendMessage(::GetParent(_hParent), WM_DOOPEN, 0, reinterpret_cast<LPARAM>(_pMainFoundInfos->at(i)._fullPath.c_str()));
} }
} }

View File

@ -1579,7 +1579,7 @@ INT_PTR CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPAR
// for the font size combo // for the font size combo
HWND hFontSizeCombo = ::GetDlgItem(hwnd, IDC_STYLER_COMBO_FONT_SIZE); HWND hFontSizeCombo = ::GetDlgItem(hwnd, IDC_STYLER_COMBO_FONT_SIZE);
for(int j = 0 ; j < int(sizeof(fontSizeStrs))/(3*sizeof(TCHAR)) ; ++j) for(int j = 0 ; j < int(sizeof(fontSizeStrs))/(3*sizeof(TCHAR)) ; ++j)
::SendMessage(hFontSizeCombo, CB_ADDSTRING, 0, (LPARAM)fontSizeStrs[j]); ::SendMessage(hFontSizeCombo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(fontSizeStrs[j]));
TCHAR size[10]; TCHAR size[10];
if (style._fontSize == -1) if (style._fontSize == -1)
@ -1587,7 +1587,7 @@ INT_PTR CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPAR
else else
wsprintf(size, TEXT("%d"),style._fontSize); wsprintf(size, TEXT("%d"),style._fontSize);
auto i = ::SendMessage(hFontSizeCombo, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)size); auto i = ::SendMessage(hFontSizeCombo, CB_FINDSTRINGEXACT, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(size));
if (i != CB_ERR) if (i != CB_ERR)
::SendMessage(hFontSizeCombo, CB_SETCURSEL, i, 0); ::SendMessage(hFontSizeCombo, CB_SETCURSEL, i, 0);
@ -1596,11 +1596,11 @@ INT_PTR CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPAR
const std::vector<generic_string> & fontlist = pNppParam->getFontList(); const std::vector<generic_string> & fontlist = pNppParam->getFontList();
for (size_t j = 0, len = fontlist.size() ; j < len ; ++j) for (size_t j = 0, len = fontlist.size() ; j < len ; ++j)
{ {
auto k = ::SendMessage(hFontNameCombo, CB_ADDSTRING, 0, (LPARAM)fontlist[j].c_str()); auto k = ::SendMessage(hFontNameCombo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(fontlist[j].c_str()));
::SendMessage(hFontNameCombo, CB_SETITEMDATA, k, (LPARAM)fontlist[j].c_str()); ::SendMessage(hFontNameCombo, CB_SETITEMDATA, k, reinterpret_cast<LPARAM>(fontlist[j].c_str()));
} }
i = ::SendMessage(hFontNameCombo, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)style._fontName); i = ::SendMessage(hFontNameCombo, CB_FINDSTRINGEXACT, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(style._fontName));
if (i == CB_ERR) if (i == CB_ERR)
i = 0; i = 0;
::SendMessage(hFontNameCombo, CB_SETCURSEL, i, 0); ::SendMessage(hFontNameCombo, CB_SETCURSEL, i, 0);

View File

@ -87,7 +87,7 @@ INT_PTR CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
if (isTextMode) if (isTextMode)
{ {
::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_EDIT, WM_GETTEXT, stringSize, (LPARAM)str); ::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_EDIT, WM_GETTEXT, stringSize, reinterpret_cast<LPARAM>(str));
display(false); display(false);

View File

@ -51,11 +51,11 @@ INT_PTR CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
LPCTSTR bitness = pNppParam ->isx64() ? TEXT("(64-bit)") : TEXT("(32-bit)"); LPCTSTR bitness = pNppParam ->isx64() ? TEXT("(64-bit)") : TEXT("(32-bit)");
::SetDlgItemText(_hSelf, IDC_VERSION_BIT, bitness); ::SetDlgItemText(_hSelf, IDC_VERSION_BIT, bitness);
::SendMessage(compileDateHandle, WM_SETTEXT, 0, (LPARAM)buildTime.c_str()); ::SendMessage(compileDateHandle, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(buildTime.c_str()));
::EnableWindow(compileDateHandle, FALSE); ::EnableWindow(compileDateHandle, FALSE);
HWND licenceEditHandle = ::GetDlgItem(_hSelf, IDC_LICENCE_EDIT); HWND licenceEditHandle = ::GetDlgItem(_hSelf, IDC_LICENCE_EDIT);
::SendMessage(licenceEditHandle, WM_SETTEXT, 0, (LPARAM)LICENCE_TXT); ::SendMessage(licenceEditHandle, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(LICENCE_TXT));
_emailLink.init(_hInst, _hSelf); _emailLink.init(_hInst, _hSelf);
//_emailLink.create(::GetDlgItem(_hSelf, IDC_AUTHOR_NAME), TEXT("mailto:don.h@free.fr")); //_emailLink.create(::GetDlgItem(_hSelf, IDC_AUTHOR_NAME), TEXT("mailto:don.h@free.fr"));

View File

@ -132,8 +132,8 @@ void AnsiCharPanel::insertChar(unsigned char char2insert) const
MultiByteToWideChar(codepage, 0, charStr, -1, wCharStr, sizeof(wCharStr)); MultiByteToWideChar(codepage, 0, charStr, -1, wCharStr, sizeof(wCharStr));
WideCharToMultiByte(CP_UTF8, 0, wCharStr, -1, multiByteStr, sizeof(multiByteStr), NULL, NULL); WideCharToMultiByte(CP_UTF8, 0, wCharStr, -1, multiByteStr, sizeof(multiByteStr), NULL, NULL);
} }
(*_ppEditView)->execute(SCI_REPLACESEL, 0, (LPARAM)""); (*_ppEditView)->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
size_t len = (char2insert < 128)?1:strlen(multiByteStr); size_t len = (char2insert < 128) ? 1 : strlen(multiByteStr);
(*_ppEditView)->execute(SCI_ADDTEXT, len, (LPARAM)multiByteStr); (*_ppEditView)->execute(SCI_ADDTEXT, len, reinterpret_cast<LPARAM>(multiByteStr));
(*_ppEditView)->getFocus(); (*_ppEditView)->getFocus();
} }

View File

@ -173,7 +173,7 @@ void ClipboardHistoryPanel::addToClipboadHistory(ClipboardData cbd)
StringArray sa(cbd, MAX_DISPLAY_LENGTH); StringArray sa(cbd, MAX_DISPLAY_LENGTH);
TCHAR *displayStr = (TCHAR *)sa.getPointer(); TCHAR *displayStr = (TCHAR *)sa.getPointer();
::SendDlgItemMessage(_hSelf, IDC_LIST_CLIPBOARD, LB_INSERTSTRING, 0, (LPARAM)displayStr); ::SendDlgItemMessage(_hSelf, IDC_LIST_CLIPBOARD, LB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(displayStr));
} }
@ -254,8 +254,8 @@ INT_PTR CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam,
char *c = new char[nbChar+1]; char *c = new char[nbChar+1];
WideCharToMultiByte(codepage, 0, (wchar_t *)ba.getPointer(), static_cast<int32_t>(ba.getLength()), c, nbChar + 1, NULL, NULL); WideCharToMultiByte(codepage, 0, (wchar_t *)ba.getPointer(), static_cast<int32_t>(ba.getLength()), c, nbChar + 1, NULL, NULL);
(*_ppEditView)->execute(SCI_REPLACESEL, 0, (LPARAM)""); (*_ppEditView)->execute(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(""));
(*_ppEditView)->execute(SCI_ADDTEXT, strlen(c), (LPARAM)c); (*_ppEditView)->execute(SCI_ADDTEXT, strlen(c), reinterpret_cast<LPARAM>(c));
(*_ppEditView)->getFocus(); (*_ppEditView)->getFocus();
delete [] c; delete [] c;
} }
@ -277,13 +277,13 @@ INT_PTR CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam,
case WM_CTLCOLORLISTBOX: case WM_CTLCOLORLISTBOX:
{ {
if (_lbBgColor != -1) if (_lbBgColor != -1)
return (LRESULT)::CreateSolidBrush((COLORREF)_lbBgColor); return reinterpret_cast<LRESULT>(::CreateSolidBrush(_lbBgColor));
break; break;
} }
case WM_DRAWITEM: case WM_DRAWITEM:
{ {
drawItem((DRAWITEMSTRUCT *)lParam); drawItem(reinterpret_cast<DRAWITEMSTRUCT *>(lParam));
break; break;
} }
default : default :

View File

@ -138,7 +138,7 @@ LRESULT ColourPicker::runProc(UINT Message, WPARAM wParam, LPARAM lParam)
{ {
_isEnabled = !_isEnabled; _isEnabled = !_isEnabled;
redraw(); redraw();
::SendMessage(_hParent, WM_COMMAND, MAKELONG(0, CPN_COLOURPICKED), (LPARAM)_hSelf); ::SendMessage(_hParent, WM_COMMAND, MAKELONG(0, CPN_COLOURPICKED), reinterpret_cast<LPARAM>(_hSelf));
break; break;
} }
@ -164,7 +164,7 @@ LRESULT ColourPicker::runProc(UINT Message, WPARAM wParam, LPARAM lParam)
redraw(); redraw();
_pColourPopup->display(false); _pColourPopup->display(false);
::SendMessage(_hParent, WM_COMMAND, MAKELONG(0, CPN_COLOURPICKED), (LPARAM)_hSelf); ::SendMessage(_hParent, WM_COMMAND, MAKELONG(0, CPN_COLOURPICKED), reinterpret_cast<LPARAM>(_hSelf));
return TRUE; return TRUE;
} }

View File

@ -109,7 +109,7 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
for(size_t i = 0 ; i < themeSwitcher.size() ; ++i) for(size_t i = 0 ; i < themeSwitcher.size() ; ++i)
{ {
pair<generic_string, generic_string> & themeInfo = themeSwitcher.getElementFromIndex(i); pair<generic_string, generic_string> & themeInfo = themeSwitcher.getElementFromIndex(i);
int j = static_cast<int32_t>(::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, (LPARAM)themeInfo.first.c_str())); int j = static_cast<int32_t>(::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(themeInfo.first.c_str())));
if (! themeInfo.second.compare( nppParamInst->getNppGUI()._themeName ) ) if (! themeInfo.second.compare( nppParamInst->getNppGUI()._themeName ) )
{ {
_currentThemeIndex = j; _currentThemeIndex = j;
@ -127,13 +127,13 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
::SendMessage(_hSwitch2ThemeCombo, CB_SETCURSEL, _currentThemeIndex, 0); ::SendMessage(_hSwitch2ThemeCombo, CB_SETCURSEL, _currentThemeIndex, 0);
for(int i = 0 ; i < sizeof(fontSizeStrs)/(3*sizeof(TCHAR)) ; ++i) for(int i = 0 ; i < sizeof(fontSizeStrs)/(3*sizeof(TCHAR)) ; ++i)
::SendMessage(_hFontSizeCombo, CB_ADDSTRING, 0, (LPARAM)fontSizeStrs[i]); ::SendMessage(_hFontSizeCombo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(fontSizeStrs[i]));
const std::vector<generic_string> & fontlist = (NppParameters::getInstance())->getFontList(); const std::vector<generic_string> & fontlist = (NppParameters::getInstance())->getFontList();
for (size_t i = 0, len = fontlist.size() ; i < len ; ++i) for (size_t i = 0, len = fontlist.size() ; i < len ; ++i)
{ {
auto j = ::SendMessage(_hFontNameCombo, CB_ADDSTRING, 0, (LPARAM)fontlist[i].c_str()); auto j = ::SendMessage(_hFontNameCombo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(fontlist[i].c_str()));
::SendMessage(_hFontNameCombo, CB_SETITEMDATA, j, (LPARAM)fontlist[i].c_str()); ::SendMessage(_hFontNameCombo, CB_SETITEMDATA, j, reinterpret_cast<LPARAM>(fontlist[i].c_str()));
} }
_pFgColour = new ColourPicker; _pFgColour = new ColourPicker;

View File

@ -115,7 +115,7 @@ public :
NppParameters *nppParamInst = NppParameters::getInstance(); NppParameters *nppParamInst = NppParameters::getInstance();
ThemeSwitcher & themeSwitcher = nppParamInst->getThemeSwitcher(); ThemeSwitcher & themeSwitcher = nppParamInst->getThemeSwitcher();
std::pair<generic_string, generic_string> & themeInfo = themeSwitcher.getElementFromIndex(themeSwitcher.size() - 1); std::pair<generic_string, generic_string> & themeInfo = themeSwitcher.getElementFromIndex(themeSwitcher.size() - 1);
::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, (LPARAM)themeInfo.first.c_str()); ::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(themeInfo.first.c_str()));
}; };

View File

@ -240,7 +240,7 @@ tTbData* DockingCont::getDataOfActiveTb()
TCITEM tcItem = {0}; TCITEM tcItem = {0};
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
::SendMessage(_hContTab, TCM_GETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
pTbData = (tTbData*)tcItem.lParam; pTbData = (tTbData*)tcItem.lParam;
} }
@ -257,7 +257,7 @@ vector<tTbData*> DockingCont::getDataOfVisTb()
for(int iItem = 0; iItem < iItemCnt; ++iItem) for(int iItem = 0; iItem < iItemCnt; ++iItem)
{ {
::SendMessage(_hContTab, TCM_GETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
vTbData.push_back((tTbData*)tcItem.lParam); vTbData.push_back((tTbData*)tcItem.lParam);
} }
return vTbData; return vTbData;
@ -272,7 +272,7 @@ bool DockingCont::isTbVis(tTbData* data)
for(int iItem = 0; iItem < iItemCnt; ++iItem) for(int iItem = 0; iItem < iItemCnt; ++iItem)
{ {
::SendMessage(_hContTab, TCM_GETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
if (!tcItem.lParam) if (!tcItem.lParam)
return false; return false;
if (((tTbData*)tcItem.lParam) == data) if (((tTbData*)tcItem.lParam) == data)
@ -747,12 +747,12 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
// get text of toolbar // get text of toolbar
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
::SendMessage(hwnd, TCM_GETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(hwnd, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
if (!tcItem.lParam) if (!tcItem.lParam)
return FALSE; return FALSE;
toolTip.init(_hInst, hwnd); toolTip.init(_hInst, hwnd);
toolTip.Show(rc, ((tTbData*)tcItem.lParam)->pszName, info.pt.x, info.pt.y + 20); toolTip.Show(rc, (reinterpret_cast<tTbData*>(tcItem.lParam))->pszName, info.pt.x, info.pt.y + 20);
} }
} }
@ -774,14 +774,14 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
// get selected sub item // get selected sub item
info.pt.x = LOWORD(lParam); info.pt.x = LOWORD(lParam);
info.pt.y = HIWORD(lParam); info.pt.y = HIWORD(lParam);
iItem = static_cast<int32_t>(::SendMessage(hwnd, TCM_HITTEST, 0, (LPARAM)&info)); iItem = static_cast<int32_t>(::SendMessage(hwnd, TCM_HITTEST, 0, reinterpret_cast<LPARAM>(&info)));
// recalc mouse position // recalc mouse position
::ClientToScreen(hwnd, &info.pt); ::ClientToScreen(hwnd, &info.pt);
// get text of toolbar // get text of toolbar
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
::SendMessage(hwnd, TCM_GETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(hwnd, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
if (!tcItem.lParam) if (!tcItem.lParam)
return FALSE; return FALSE;
@ -809,7 +809,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
// get selected sub item // get selected sub item
info.pt.x = LOWORD(lParam); info.pt.x = LOWORD(lParam);
info.pt.y = HIWORD(lParam); info.pt.y = HIWORD(lParam);
iItem = static_cast<int32_t>(::SendMessage(hwnd, TCM_HITTEST, 0, (LPARAM)&info)); iItem = static_cast<int32_t>(::SendMessage(hwnd, TCM_HITTEST, 0, reinterpret_cast<LPARAM>(&info)));
SelectTab(iItem); SelectTab(iItem);
} }
@ -832,12 +832,12 @@ void DockingCont::drawTabItem(DRAWITEMSTRUCT *pDrawItemStruct)
// get current selected item // get current selected item
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
::SendMessage(_hContTab, TCM_GETITEM, nTab, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_GETITEM, nTab, reinterpret_cast<LPARAM>(&tcItem));
if (!tcItem.lParam) if (!tcItem.lParam)
return; return;
const TCHAR *text = ((tTbData*)tcItem.lParam)->pszName; const TCHAR *text = reinterpret_cast<tTbData*>(tcItem.lParam)->pszName;
int length = lstrlen(((tTbData*)tcItem.lParam)->pszName); int length = lstrlen(reinterpret_cast<tTbData*>(tcItem.lParam)->pszName);
// get drawing context // get drawing context
@ -1247,7 +1247,7 @@ void DockingCont::viewToolbar(tTbData *pTbData)
UINT iItem = getActiveTb(); UINT iItem = getActiveTb();
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
::SendMessage(_hContTab, TCM_GETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
if (!tcItem.lParam) if (!tcItem.lParam)
return; return;
@ -1263,13 +1263,13 @@ void DockingCont::viewToolbar(tTbData *pTbData)
if (iTabPos == -1) if (iTabPos == -1)
{ {
// set only params and text even if icon available // set only params and text even if icon available
::SendMessage(_hContTab, TCM_INSERTITEM, iItemCnt, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_INSERTITEM, iItemCnt, reinterpret_cast<LPARAM>(&tcItem));
SelectTab(iItemCnt); SelectTab(iItemCnt);
} }
// if exists select it and update data // if exists select it and update data
else else
{ {
::SendMessage(_hContTab, TCM_SETITEM, iTabPos, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_SETITEM, iTabPos, reinterpret_cast<LPARAM>(&tcItem));
SelectTab(iTabPos); SelectTab(iTabPos);
} }
@ -1385,7 +1385,7 @@ void DockingCont::SelectTab(int iTab)
szText += pszMaxTxt; szText += pszMaxTxt;
} }
tcItem.pszText = (TCHAR *)szText.c_str(); tcItem.pszText = (TCHAR *)szText.c_str();
::SendMessage(_hContTab, TCM_SETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_SETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
} }
// selects the pressed tab and store previous tab // selects the pressed tab and store previous tab
@ -1412,7 +1412,7 @@ bool DockingCont::updateCaption()
// get data of new active dialog // get data of new active dialog
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
::SendMessage(_hContTab, TCM_GETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
if (!tcItem.lParam) return false; if (!tcItem.lParam) return false;
@ -1447,7 +1447,7 @@ void DockingCont::focusClient()
{ {
// get data of new active dialog // get data of new active dialog
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
::SendMessage(_hContTab, TCM_GETITEM, iItem, (LPARAM)&tcItem); ::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
// set focus // set focus
if (!tcItem.lParam) if (!tcItem.lParam)

View File

@ -229,12 +229,12 @@ LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
// activate/deactivate titlebar of toolbars // activate/deactivate titlebar of toolbars
for (size_t iCont = DOCKCONT_MAX, len = _vContainer.size(); iCont < len; ++iCont) for (size_t iCont = DOCKCONT_MAX, len = _vContainer.size(); iCont < len; ++iCont)
{ {
::SendMessage(_vContainer[iCont]->getHSelf(), WM_NCACTIVATE, wParam, (LPARAM)-1); ::SendMessage(_vContainer[iCont]->getHSelf(), WM_NCACTIVATE, wParam, static_cast<LPARAM>(-1));
} }
if (static_cast<int>(lParam) != -1) if (static_cast<int>(lParam) != -1)
{ {
::SendMessage(_hParent, WM_NCACTIVATE, wParam, (LPARAM)-1); ::SendMessage(_hParent, WM_NCACTIVATE, wParam, static_cast<LPARAM>(-1));
} }
break; break;
} }
@ -376,7 +376,7 @@ LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
} }
case DMM_GETIMAGELIST: case DMM_GETIMAGELIST:
{ {
return (LPARAM)_hImageList; return reinterpret_cast<LPARAM>(_hImageList);
} }
case DMM_GETICONPOS: case DMM_GETICONPOS:
{ {
@ -714,7 +714,7 @@ LRESULT DockingManager::SendNotify(HWND hWnd, UINT message)
nmhdr.code = message; nmhdr.code = message;
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, reinterpret_cast<LPARAM>(&nmhdr));
return ::GetWindowLongPtr(hWnd, DWLP_MSGRESULT); return ::GetWindowLongPtr(hWnd, DWLP_MSGRESULT);
} }

View File

@ -35,7 +35,7 @@ void DocumentMap::reloadMap()
if (_pScintillaEditView && _ppEditView) if (_pScintillaEditView && _ppEditView)
{ {
Document currentDoc = (*_ppEditView)->execute(SCI_GETDOCPOINTER); Document currentDoc = (*_ppEditView)->execute(SCI_GETDOCPOINTER);
_pScintillaEditView->execute(SCI_SETDOCPOINTER, 0, (LPARAM)currentDoc); _pScintillaEditView->execute(SCI_SETDOCPOINTER, 0, static_cast<LPARAM>(currentDoc));
// //
// sync with the current document // sync with the current document
@ -271,9 +271,9 @@ INT_PTR CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
{ {
case WM_INITDIALOG : case WM_INITDIALOG :
{ {
HWND hwndScintilla = (HWND)::SendMessage(_hParent, NPPM_CREATESCINTILLAHANDLE, 0, (LPARAM)_hSelf); HWND hwndScintilla = reinterpret_cast<HWND>(::SendMessage(_hParent, NPPM_CREATESCINTILLAHANDLE, 0, reinterpret_cast<LPARAM>(_hSelf)));
_pScintillaEditView = (ScintillaEditView *)::SendMessage(_hParent, NPPM_INTERNAL_GETSCINTEDTVIEW, 0, (LPARAM)hwndScintilla); _pScintillaEditView = reinterpret_cast<ScintillaEditView *>(::SendMessage(_hParent, NPPM_INTERNAL_GETSCINTEDTVIEW, 0, reinterpret_cast<LPARAM>(hwndScintilla)));
_pScintillaEditView->execute(SCI_SETZOOM, (WPARAM)-10, 0); _pScintillaEditView->execute(SCI_SETZOOM, static_cast<WPARAM>(-10), 0);
_pScintillaEditView->execute(SCI_SETVSCROLLBAR, FALSE, 0); _pScintillaEditView->execute(SCI_SETVSCROLLBAR, FALSE, 0);
_pScintillaEditView->execute(SCI_SETHSCROLLBAR, FALSE, 0); _pScintillaEditView->execute(SCI_SETHSCROLLBAR, FALSE, 0);

View File

@ -400,7 +400,7 @@ void FileBrowser::openSelectFile()
if (::PathIsDirectory(fullPath.c_str())) if (::PathIsDirectory(fullPath.c_str()))
return; return;
::SendMessage(_hParent, NPPM_DOOPEN, 0, (LPARAM)(fullPath.c_str())); ::SendMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast<LPARAM>(fullPath.c_str()));
} }
@ -439,7 +439,7 @@ void FileBrowser::notified(LPNMHDR notification)
{ {
// Get the old label // Get the old label
tvItem.hItem = _treeView.getSelection(); tvItem.hItem = _treeView.getSelection();
::SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0,(LPARAM)&tvItem); ::SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, reinterpret_cast<LPARAM>(&tvItem));
size_t len = lstrlen(tvItem.pszText); size_t len = lstrlen(tvItem.pszText);
// Find the position of old label in File path // Find the position of old label in File path
@ -712,7 +712,7 @@ void FileBrowser::popupMenuCmd(int cmdID)
{ {
if (not selectedNode) return; if (not selectedNode) return;
generic_string path = getNodePath(selectedNode); generic_string path = getNodePath(selectedNode);
::SendMessage(_hParent, NPPM_LAUNCHFINDINFILESDLG, (WPARAM)path.c_str(), 0); ::SendMessage(_hParent, NPPM_LAUNCHFINDINFILESDLG, reinterpret_cast<WPARAM>(path.c_str()), 0);
} }
break; break;
@ -1009,7 +1009,7 @@ HTREEITEM FileBrowser::getRootFromFullPath(const generic_string & rootPath) cons
tvItem.mask = TVIF_PARAM; tvItem.mask = TVIF_PARAM;
tvItem.cchTextMax = MAX_PATH; tvItem.cchTextMax = MAX_PATH;
tvItem.hItem = hItemNode; tvItem.hItem = hItemNode;
SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, (LPARAM)&tvItem); SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, reinterpret_cast<LPARAM>(&tvItem));
if (tvItem.lParam != 0 && rootPath == *((generic_string *)tvItem.lParam)) if (tvItem.lParam != 0 && rootPath == *((generic_string *)tvItem.lParam))
node = hItemNode; node = hItemNode;
@ -1031,7 +1031,7 @@ HTREEITEM FileBrowser::findChildNodeFromName(HTREEITEM parent, generic_string la
tvItem.pszText = textBuffer; tvItem.pszText = textBuffer;
tvItem.cchTextMax = MAX_PATH; tvItem.cchTextMax = MAX_PATH;
tvItem.hItem = hItemNode; tvItem.hItem = hItemNode;
SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, (LPARAM)&tvItem); SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, reinterpret_cast<LPARAM>(&tvItem));
if (label == tvItem.pszText) if (label == tvItem.pszText)
{ {
@ -1054,7 +1054,7 @@ vector<generic_string> FileBrowser::getRoots() const
tvItem.mask = TVIF_PARAM; tvItem.mask = TVIF_PARAM;
tvItem.cchTextMax = MAX_PATH; tvItem.cchTextMax = MAX_PATH;
tvItem.hItem = hItemNode; tvItem.hItem = hItemNode;
SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, (LPARAM)&tvItem); SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, reinterpret_cast<LPARAM>(&tvItem));
roots.push_back(*((generic_string *)tvItem.lParam)); roots.push_back(*((generic_string *)tvItem.lParam));
} }
@ -1497,14 +1497,14 @@ DWORD WINAPI FolderUpdater::watching(void *params)
case FILE_ACTION_ADDED: case FILE_ACTION_ADDED:
file2Change.push_back(wstrFilename.GetString()); file2Change.push_back(wstrFilename.GetString());
//thisFolderUpdater->updateTree(dwAction, file2Change); //thisFolderUpdater->updateTree(dwAction, file2Change);
::SendMessage((thisFolderUpdater->_pFileBrowser)->getHSelf(), FB_ADDFILE, (WPARAM)nullptr, (LPARAM)&file2Change); ::SendMessage((thisFolderUpdater->_pFileBrowser)->getHSelf(), FB_ADDFILE, reinterpret_cast<WPARAM>(nullptr), reinterpret_cast<LPARAM>(&file2Change));
oldName = TEXT(""); oldName = TEXT("");
break; break;
case FILE_ACTION_REMOVED: case FILE_ACTION_REMOVED:
file2Change.push_back(wstrFilename.GetString()); file2Change.push_back(wstrFilename.GetString());
//thisFolderUpdater->updateTree(dwAction, file2Change); //thisFolderUpdater->updateTree(dwAction, file2Change);
::SendMessage((thisFolderUpdater->_pFileBrowser)->getHSelf(), FB_RMFILE, (WPARAM)nullptr, (LPARAM)&file2Change); ::SendMessage((thisFolderUpdater->_pFileBrowser)->getHSelf(), FB_RMFILE, reinterpret_cast<WPARAM>(nullptr), reinterpret_cast<LPARAM>(&file2Change));
oldName = TEXT(""); oldName = TEXT("");
break; break;
@ -1522,7 +1522,7 @@ DWORD WINAPI FolderUpdater::watching(void *params)
file2Change.push_back(oldName); file2Change.push_back(oldName);
file2Change.push_back(wstrFilename.GetString()); file2Change.push_back(wstrFilename.GetString());
//thisFolderUpdater->updateTree(dwAction, file2Change); //thisFolderUpdater->updateTree(dwAction, file2Change);
::SendMessage((thisFolderUpdater->_pFileBrowser)->getHSelf(), FB_RNFILE, (WPARAM)nullptr, (LPARAM)&file2Change); ::SendMessage((thisFolderUpdater->_pFileBrowser)->getHSelf(), FB_RNFILE, reinterpret_cast<WPARAM>(nullptr), reinterpret_cast<LPARAM>(&file2Change));
} }
oldName = TEXT(""); oldName = TEXT("");
break; break;

View File

@ -199,7 +199,7 @@ void FunctionListPanel::sortOrUnsort()
else else
{ {
TCHAR text2search[MAX_PATH] ; TCHAR text2search[MAX_PATH] ;
::SendMessage(_hSearchEdit, WM_GETTEXT, MAX_PATH, (LPARAM)text2search); ::SendMessage(_hSearchEdit, WM_GETTEXT, MAX_PATH, reinterpret_cast<LPARAM>(text2search));
if (text2search[0] == '\0') // main view if (text2search[0] == '\0') // main view
{ {
@ -288,13 +288,13 @@ void FunctionListPanel::reload()
TreeParams *previousParams = getFromStateArray(fullFilePath); TreeParams *previousParams = getFromStateArray(fullFilePath);
if (!previousParams) if (!previousParams)
{ {
::SendMessage(_hSearchEdit, WM_SETTEXT, 0, (LPARAM)TEXT("")); ::SendMessage(_hSearchEdit, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(TEXT("")));
setSort(false); setSort(false);
_treeView.expand(root); _treeView.expand(root);
} }
else else
{ {
::SendMessage(_hSearchEdit, WM_SETTEXT, 0, (LPARAM)(previousParams->_searchParameters)._text2Find.c_str()); ::SendMessage(_hSearchEdit, WM_SETTEXT, 0, reinterpret_cast<LPARAM>((previousParams->_searchParameters)._text2Find.c_str()));
_treeView.restoreFoldingStateFrom(previousParams->_treeState, root); _treeView.restoreFoldingStateFrom(previousParams->_treeState, root);
@ -469,7 +469,7 @@ BOOL FunctionListPanel::setTreeViewImageList(int root_id, int node_id, int leaf_
void FunctionListPanel::searchFuncAndSwitchView() void FunctionListPanel::searchFuncAndSwitchView()
{ {
TCHAR text2search[MAX_PATH] ; TCHAR text2search[MAX_PATH] ;
::SendMessage(_hSearchEdit, WM_GETTEXT, MAX_PATH, (LPARAM)text2search); ::SendMessage(_hSearchEdit, WM_GETTEXT, MAX_PATH, reinterpret_cast<LPARAM>(text2search));
bool doSort = shouldSort(); bool doSort = shouldSort();
if (text2search[0] == '\0') if (text2search[0] == '\0')
@ -574,16 +574,15 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
_hToolbarMenu = CreateWindowEx(0,TOOLBARCLASSNAME,NULL, style, _hToolbarMenu = CreateWindowEx(0,TOOLBARCLASSNAME,NULL, style,
0,0,0,0,_hSelf,(HMENU)0, _hInst, NULL); 0,0,0,0,_hSelf,(HMENU)0, _hInst, NULL);
//::GetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC); oldFunclstToolbarProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(funclstToolbarProc)));
oldFunclstToolbarProc = (WNDPROC)::SetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC, (LONG_PTR)funclstToolbarProc);
TBBUTTON tbButtons[3]; TBBUTTON tbButtons[3];
// Add the bmap image into toolbar's imagelist // Add the bmap image into toolbar's imagelist
TBADDBITMAP addbmp = {_hInst, 0}; TBADDBITMAP addbmp = {_hInst, 0};
addbmp.nID = IDI_FUNCLIST_SORTBUTTON; addbmp.nID = IDI_FUNCLIST_SORTBUTTON;
::SendMessage(_hToolbarMenu, TB_ADDBITMAP, 1, (LPARAM)&addbmp); ::SendMessage(_hToolbarMenu, TB_ADDBITMAP, 1, reinterpret_cast<LPARAM>(&addbmp));
addbmp.nID = IDI_FUNCLIST_RELOADBUTTON; addbmp.nID = IDI_FUNCLIST_RELOADBUTTON;
::SendMessage(_hToolbarMenu, TB_ADDBITMAP, 1, (LPARAM)&addbmp); ::SendMessage(_hToolbarMenu, TB_ADDBITMAP, 1, reinterpret_cast<LPARAM>(&addbmp));
// Place holder of search text field // Place holder of search text field
tbButtons[0].idCommand = 0; tbButtons[0].idCommand = 0;
@ -606,7 +605,7 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
::SendMessage(_hToolbarMenu, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); ::SendMessage(_hToolbarMenu, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
::SendMessage(_hToolbarMenu, TB_SETBUTTONSIZE, (WPARAM)0, (LPARAM)MAKELONG(16, 16)); ::SendMessage(_hToolbarMenu, TB_SETBUTTONSIZE, (WPARAM)0, (LPARAM)MAKELONG(16, 16));
::SendMessage(_hToolbarMenu, TB_ADDBUTTONS, (WPARAM)sizeof(tbButtons) / sizeof(TBBUTTON), (LPARAM)&tbButtons); ::SendMessage(_hToolbarMenu, TB_ADDBUTTONS, (WPARAM)sizeof(tbButtons) / sizeof(TBBUTTON), reinterpret_cast<LPARAM>(&tbButtons));
::SendMessage(_hToolbarMenu, TB_AUTOSIZE, 0, 0); ::SendMessage(_hToolbarMenu, TB_AUTOSIZE, 0, 0);
ShowWindow(_hToolbarMenu, SW_SHOW); ShowWindow(_hToolbarMenu, SW_SHOW);

View File

@ -1690,7 +1690,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
int j = static_cast<int32_t>(SendMessage(BGHS[SelfIndex].hlist1, LB_GETCOUNT, 0, 0)); int j = static_cast<int32_t>(SendMessage(BGHS[SelfIndex].hlist1, LB_GETCOUNT, 0, 0));
if(j>0) if(j>0)
{ {
SendMessage(BGHS[SelfIndex].hlist1,LB_GETTEXT,j-1,(LPARAM)buffer); SendMessage(BGHS[SelfIndex].hlist1, LB_GETTEXT, j - 1, reinterpret_cast<LPARAM>(buffer));
buffer[5]=0x00; buffer[5]=0x00;
j=generic_atoi(buffer); j=generic_atoi(buffer);
if(j>SendMessage(hWnd,BGM_GETROWS,0,0)) if(j>SendMessage(hWnd,BGM_GETROWS,0,0))

View File

@ -332,9 +332,9 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
const bool isConflict = findKeyConflicts(&conflictInfo, *reinterpret_cast<KeyCombo*>(wParam), _babygrid.getSelectedRow() - 1); const bool isConflict = findKeyConflicts(&conflictInfo, *reinterpret_cast<KeyCombo*>(wParam), _babygrid.getSelectedRow() - 1);
*reinterpret_cast<bool*>(lParam) = isConflict; *reinterpret_cast<bool*>(lParam) = isConflict;
if (isConflict) if (isConflict)
::SendDlgItemMessage(_hSelf, IDC_BABYGRID_INFO, WM_SETTEXT, 0, (LPARAM)conflictInfo.c_str()); ::SendDlgItemMessage(_hSelf, IDC_BABYGRID_INFO, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(conflictInfo.c_str()));
else else
::SendDlgItemMessage(_hSelf, IDC_BABYGRID_INFO, WM_SETTEXT, 0, (LPARAM)_assignInfo.c_str()); ::SendDlgItemMessage(_hSelf, IDC_BABYGRID_INFO, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(_assignInfo.c_str()));
return TRUE; return TRUE;
} }
@ -724,9 +724,9 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
} }
if (conflictInfo.empty()) if (conflictInfo.empty())
::SendDlgItemMessage(_hSelf, IDC_BABYGRID_INFO, WM_SETTEXT, 0, (LPARAM)_defaultInfo.c_str()); ::SendDlgItemMessage(_hSelf, IDC_BABYGRID_INFO, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(_defaultInfo.c_str()));
else else
::SendDlgItemMessage(_hSelf, IDC_BABYGRID_INFO, WM_SETTEXT, 0, (LPARAM)conflictInfo.c_str()); ::SendDlgItemMessage(_hSelf, IDC_BABYGRID_INFO, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(conflictInfo.c_str()));
return TRUE; return TRUE;
} }

View File

@ -233,7 +233,7 @@ void PreferenceDlg::makeCategoryList()
{ {
for (size_t i = 0, len = _wVector.size(); i < len; ++i) for (size_t i = 0, len = _wVector.size(); i < len; ++i)
{ {
::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_ADDSTRING, 0, (LPARAM)_wVector[i]._name.c_str()); ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_wVector[i]._name.c_str()));
} }
setListSelection(0); setListSelection(0);
} }
@ -242,8 +242,8 @@ void PreferenceDlg::setListSelection(size_t currentSel) const
{ {
// Stupid LB API doesn't allow LB_SETSEL to be used on single select listbox, so we do it in a hard way // Stupid LB API doesn't allow LB_SETSEL to be used on single select listbox, so we do it in a hard way
TCHAR selStr[256]; TCHAR selStr[256];
::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXT, currentSel, (LPARAM)selStr); ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXT, currentSel, reinterpret_cast<LPARAM>(selStr));
::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_SELECTSTRING, currentSel, (LPARAM)selStr); ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_SELECTSTRING, currentSel, reinterpret_cast<LPARAM>(selStr));
} }
bool PreferenceDlg::renameDialogTitle(const TCHAR *internalName, const TCHAR *newName) bool PreferenceDlg::renameDialogTitle(const TCHAR *internalName, const TCHAR *newName)
@ -267,14 +267,14 @@ bool PreferenceDlg::renameDialogTitle(const TCHAR *internalName, const TCHAR *ne
if (txtLen >= lenMax) if (txtLen >= lenMax)
return false; return false;
::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXT, i, (LPARAM)oldName); ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXT, i, reinterpret_cast<LPARAM>(oldName));
// Same name, no need to change, but operation is considered success // Same name, no need to change, but operation is considered success
if (lstrcmp(newName, oldName) == 0) if (lstrcmp(newName, oldName) == 0)
return true; return true;
::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_DELETESTRING, i, 0); ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_DELETESTRING, i, 0);
::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_INSERTSTRING, i, (LPARAM)newName); ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_INSERTSTRING, i, reinterpret_cast<LPARAM>(newName));
return true; return true;
} }
@ -361,7 +361,7 @@ INT_PTR CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
for (size_t i = 0, len = localizationSwitcher.size(); i < len ; ++i) for (size_t i = 0, len = localizationSwitcher.size(); i < len ; ++i)
{ {
pair<wstring, wstring> localizationInfo = localizationSwitcher.getElementFromIndex(i); pair<wstring, wstring> localizationInfo = localizationSwitcher.getElementFromIndex(i);
::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_ADDSTRING, 0, (LPARAM)localizationInfo.first.c_str()); ::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(localizationInfo.first.c_str()));
} }
wstring lang = TEXT("English"); // Set default language as Englishs wstring lang = TEXT("English"); // Set default language as Englishs
if (pNppParam->getNativeLangA()) // if nativeLangA is not NULL, then we can be sure the default language (English) is not used if (pNppParam->getNativeLangA()) // if nativeLangA is not NULL, then we can be sure the default language (English) is not used
@ -371,11 +371,11 @@ INT_PTR CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
fnW.assign(fn.begin(), fn.end()); fnW.assign(fn.begin(), fn.end());
lang = localizationSwitcher.getLangFromXmlFileName(fnW.c_str()); lang = localizationSwitcher.getLangFromXmlFileName(fnW.c_str());
} }
auto index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)lang.c_str()); auto index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_FINDSTRINGEXACT, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(lang.c_str()));
if (index != CB_ERR) if (index != CB_ERR)
::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_SETCURSEL, index, 0); ::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_SETCURSEL, index, 0);
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture(); ETDTProc enableDlgTheme = reinterpret_cast<ETDTProc>(pNppParam->getEnableThemeDlgTexture());
if (enableDlgTheme) if (enableDlgTheme)
enableDlgTheme(_hSelf, ETDT_ENABLETAB); enableDlgTheme(_hSelf, ETDT_ENABLETAB);
@ -882,8 +882,8 @@ INT_PTR CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
::SendDlgItemMessage(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE, BM_SETCHECK, dontUnderline, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE, BM_SETCHECK, dontUnderline, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE), dontUnderlineState); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE), dontUnderlineState);
::SendDlgItemMessage(_hSelf, IDC_EDIT_SESSIONFILEEXT, WM_SETTEXT, 0, (LPARAM)nppGUI._definedSessionExt.c_str()); ::SendDlgItemMessage(_hSelf, IDC_EDIT_SESSIONFILEEXT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(nppGUI._definedSessionExt.c_str()));
::SendDlgItemMessage(_hSelf, IDC_EDIT_WORKSPACEFILEEXT, WM_SETTEXT, 0, (LPARAM)nppGUI._definedWorkspaceExt.c_str()); ::SendDlgItemMessage(_hSelf, IDC_EDIT_WORKSPACEFILEEXT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(nppGUI._definedWorkspaceExt.c_str()));
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLEDOCSWITCHER, BM_SETCHECK, nppGUI._doTaskList, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLEDOCSWITCHER, BM_SETCHECK, nppGUI._doTaskList, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_MAINTAININDENT, BM_SETCHECK, nppGUI._maitainIndent, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_MAINTAININDENT, BM_SETCHECK, nppGUI._maitainIndent, 0);
@ -1173,7 +1173,7 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
{ {
cmdID += IDM_FORMAT_ENCODE; cmdID += IDM_FORMAT_ENCODE;
getNameStrFromCmd(cmdID, str); getNameStrFromCmd(cmdID, str);
int index = static_cast<int32_t>(::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_ADDSTRING, 0, (LPARAM)str.c_str())); int index = static_cast<int32_t>(::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(str.c_str())));
if (ndds._codepage == encodings[i]) if (ndds._codepage == encodings[i])
selIndex = index; selIndex = index;
::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_SETITEMDATA, index, (LPARAM)encodings[i]); ::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_SETITEMDATA, index, (LPARAM)encodings[i]);
@ -1198,16 +1198,16 @@ INT_PTR CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
for (int i = L_TEXT ; i < pNppParam->L_END ; ++i) for (int i = L_TEXT ; i < pNppParam->L_END ; ++i)
{ {
str.clear(); str.clear();
if ((LangType)i != L_USER) if (static_cast<LangType>(i) != L_USER)
{ {
int cmdID = pNppParam->langTypeToCommandID((LangType)i); int cmdID = pNppParam->langTypeToCommandID(static_cast<LangType>(i));
if ((cmdID != -1)) if ((cmdID != -1))
{ {
getNameStrFromCmd(cmdID, str); getNameStrFromCmd(cmdID, str);
if (str.length() > 0) if (str.length() > 0)
{ {
_langList.push_back(LangID_Name((LangType)i, str)); _langList.push_back(LangID_Name(static_cast<LangType>(i), str));
::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_ADDSTRING, 0, (LPARAM)str.c_str()); ::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(str.c_str()));
if (ndds._lang == i) if (ndds._lang == i)
index = _langList.size() - 1; index = _langList.size() - 1;
} }
@ -1545,7 +1545,7 @@ INT_PTR CALLBACK RecentFilesHistoryDlg::run_dlgProc(UINT Message, WPARAM wParam,
INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
{ {
NppParameters *pNppParam = NppParameters::getInstance(); NppParameters *pNppParam = NppParameters::getInstance();
NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI(); NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
switch (Message) switch (Message)
{ {
@ -1554,22 +1554,22 @@ INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lP
int nbLang = pNppParam->getNbLang(); int nbLang = pNppParam->getNbLang();
for (int i = 0 ; i < nbLang ; ++i) for (int i = 0 ; i < nbLang ; ++i)
{ {
::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, (LPARAM)pNppParam->getLangFromIndex(i)->_langName.c_str()); ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(pNppParam->getLangFromIndex(i)->_langName.c_str()));
} }
for (int i = L_TEXT ; i < pNppParam->L_END ; ++i) for (int i = L_TEXT ; i < pNppParam->L_END ; ++i)
{ {
generic_string str; generic_string str;
if ((LangType)i != L_USER) if (static_cast<LangType>(i) != L_USER)
{ {
int cmdID = pNppParam->langTypeToCommandID((LangType)i); int cmdID = pNppParam->langTypeToCommandID(static_cast<LangType>(i));
if ((cmdID != -1)) if ((cmdID != -1))
{ {
getNameStrFromCmd(cmdID, str); getNameStrFromCmd(cmdID, str);
if (str.length() > 0) if (str.length() > 0)
{ {
_langList.push_back(LangMenuItem((LangType)i, cmdID, str)); _langList.push_back(LangMenuItem(static_cast<LangType>(i), cmdID, str));
::SendDlgItemMessage(_hSelf, IDC_LIST_ENABLEDLANG, LB_ADDSTRING, 0, (LPARAM)str.c_str()); ::SendDlgItemMessage(_hSelf, IDC_LIST_ENABLEDLANG, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(str.c_str()));
} }
} }
} }
@ -1577,14 +1577,14 @@ INT_PTR CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lP
for (size_t i = 0, len = nppGUI._excludedLangList.size(); i < len ; ++i) for (size_t i = 0, len = nppGUI._excludedLangList.size(); i < len ; ++i)
{ {
::SendDlgItemMessage(_hSelf, IDC_LIST_DISABLEDLANG, LB_ADDSTRING, 0, (LPARAM)nppGUI._excludedLangList[i]._langName.c_str()); ::SendDlgItemMessage(_hSelf, IDC_LIST_DISABLEDLANG, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(nppGUI._excludedLangList[i]._langName.c_str()));
} }
::SendDlgItemMessage(_hSelf, IDC_CHECK_LANGMENUCOMPACT, BM_SETCHECK, nppGUI._isLangMenuCompact?BST_CHECKED:BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_LANGMENUCOMPACT, BM_SETCHECK, nppGUI._isLangMenuCompact?BST_CHECKED:BST_UNCHECKED, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_BUTTON_REMOVE), FALSE); ::EnableWindow(::GetDlgItem(_hSelf, IDC_BUTTON_REMOVE), FALSE);
::EnableWindow(::GetDlgItem(_hSelf, IDC_BUTTON_RESTORE), FALSE); ::EnableWindow(::GetDlgItem(_hSelf, IDC_BUTTON_RESTORE), FALSE);
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture(); ETDTProc enableDlgTheme = reinterpret_cast<ETDTProc>(pNppParam->getEnableThemeDlgTexture());
if (enableDlgTheme) if (enableDlgTheme)
enableDlgTheme(_hSelf, ETDT_ENABLETAB); enableDlgTheme(_hSelf, ETDT_ENABLETAB);
@ -1748,10 +1748,10 @@ INT_PTR CALLBACK TabSettings::run_dlgProc(UINT Message, WPARAM wParam, LPARAM/*
::SendDlgItemMessage(_hSelf, IDC_CHECK_REPLACEBYSPACE, BM_SETCHECK, nppGUI._tabReplacedBySpace, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_REPLACEBYSPACE, BM_SETCHECK, nppGUI._tabReplacedBySpace, 0);
int nbLang = pNppParam->getNbLang(); int nbLang = pNppParam->getNbLang();
::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, (LPARAM)TEXT("[Default]")); ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(TEXT("[Default]")));
for (int i = 0 ; i < nbLang ; ++i) for (int i = 0 ; i < nbLang ; ++i)
{ {
::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, (LPARAM)pNppParam->getLangFromIndex(i)->_langName.c_str()); ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(pNppParam->getLangFromIndex(i)->_langName.c_str()));
} }
const int index2Begin = 0; const int index2Begin = 0;
::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_SETCURSEL, 0, index2Begin); ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_SETCURSEL, 0, index2Begin);
@ -1760,7 +1760,7 @@ INT_PTR CALLBACK TabSettings::run_dlgProc(UINT Message, WPARAM wParam, LPARAM/*
::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), FALSE); ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), FALSE);
::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), SW_HIDE); ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), SW_HIDE);
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture(); ETDTProc enableDlgTheme = reinterpret_cast<ETDTProc>(pNppParam->getEnableThemeDlgTexture());
if (enableDlgTheme) if (enableDlgTheme)
enableDlgTheme(_hSelf, ETDT_ENABLETAB); enableDlgTheme(_hSelf, ETDT_ENABLETAB);
@ -1994,32 +1994,32 @@ INT_PTR CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
for(size_t i = 6 ; i < 15 ; ++i) for(size_t i = 6 ; i < 15 ; ++i)
{ {
wsprintf(intStr, TEXT("%d"), i); wsprintf(intStr, TEXT("%d"), i);
::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTSIZE, CB_ADDSTRING, 0, (LPARAM)intStr); ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTSIZE, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(intStr));
::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTSIZE, CB_ADDSTRING, 0, (LPARAM)intStr); ::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTSIZE, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(intStr));
} }
const std::vector<generic_string> & fontlist = pNppParam->getFontList(); const std::vector<generic_string> & fontlist = pNppParam->getFontList();
for (size_t i = 0, len = fontlist.size() ; i < len ; ++i) for (size_t i = 0, len = fontlist.size() ; i < len ; ++i)
{ {
auto j = ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_ADDSTRING, 0, (LPARAM)fontlist[i].c_str()); auto j = ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(fontlist[i].c_str()));
::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_ADDSTRING, 0, (LPARAM)fontlist[i].c_str()); ::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(fontlist[i].c_str()));
::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_SETITEMDATA, j, (LPARAM)fontlist[i].c_str()); ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_SETITEMDATA, j, reinterpret_cast<LPARAM>(fontlist[i].c_str()));
::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_SETITEMDATA, j, (LPARAM)fontlist[i].c_str()); ::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_SETITEMDATA, j, reinterpret_cast<LPARAM>(fontlist[i].c_str()));
} }
auto index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)nppGUI._printSettings._headerFontName.c_str()); auto index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_FINDSTRINGEXACT, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(nppGUI._printSettings._headerFontName.c_str()));
if (index == CB_ERR) if (index == CB_ERR)
index = 0; index = 0;
::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_SETCURSEL, index, 0); ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_SETCURSEL, index, 0);
index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)nppGUI._printSettings._footerFontName.c_str()); index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_FINDSTRINGEXACT, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(nppGUI._printSettings._footerFontName.c_str()));
if (index == CB_ERR) if (index == CB_ERR)
index = 0; index = 0;
::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_SETCURSEL, index, 0); ::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_SETCURSEL, index, 0);
wsprintf(intStr, TEXT("%d"), nppGUI._printSettings._headerFontSize); wsprintf(intStr, TEXT("%d"), nppGUI._printSettings._headerFontSize);
::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTSIZE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM)intStr); ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTSIZE, CB_SELECTSTRING, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(intStr));
wsprintf(intStr, TEXT("%d"), nppGUI._printSettings._footerFontSize); wsprintf(intStr, TEXT("%d"), nppGUI._printSettings._footerFontSize);
::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTSIZE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM)intStr); ::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTSIZE, CB_SELECTSTRING, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(intStr));
::SendDlgItemMessage(_hSelf, IDC_CHECK_HBOLD, BM_SETCHECK, nppGUI._printSettings._headerFontStyle & (FONTSTYLE_BOLD ? TRUE : FALSE), 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_HBOLD, BM_SETCHECK, nppGUI._printSettings._headerFontStyle & (FONTSTYLE_BOLD ? TRUE : FALSE), 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_HITALIC, BM_SETCHECK, nppGUI._printSettings._headerFontStyle & (FONTSTYLE_ITALIC ? TRUE : FALSE), 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_HITALIC, BM_SETCHECK, nppGUI._printSettings._headerFontStyle & (FONTSTYLE_ITALIC ? TRUE : FALSE), 0);
@ -2036,8 +2036,8 @@ INT_PTR CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
for (size_t i = 0, len = varList.size() ; i < len ; ++i) for (size_t i = 0, len = varList.size() ; i < len ; ++i)
{ {
auto j = ::SendDlgItemMessage(_hSelf, IDC_COMBO_VARLIST, CB_ADDSTRING, 0, (LPARAM)varList[i]._varDesc.c_str()); auto j = ::SendDlgItemMessage(_hSelf, IDC_COMBO_VARLIST, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(varList[i]._varDesc.c_str()));
::SendDlgItemMessage(_hSelf, IDC_COMBO_VARLIST, CB_SETITEMDATA, j, (LPARAM)varList[i]._var.c_str()); ::SendDlgItemMessage(_hSelf, IDC_COMBO_VARLIST, CB_SETITEMDATA, j, reinterpret_cast<LPARAM>(varList[i]._var.c_str()));
} }
::SendDlgItemMessage(_hSelf, IDC_COMBO_VARLIST, CB_SETCURSEL, 0, 0); ::SendDlgItemMessage(_hSelf, IDC_COMBO_VARLIST, CB_SETCURSEL, 0, 0);
@ -2134,7 +2134,7 @@ INT_PTR CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
default : return TRUE; default : return TRUE;
} }
::GetDlgItemText(_hSelf, _focusedEditCtrl, str, stringSize); ::GetDlgItemText(_hSelf, _focusedEditCtrl, str, stringSize);
::SendDlgItemMessage(_hSelf, IDC_VIEWPANEL_STATIC, WM_SETTEXT, 0, (LPARAM)str); ::SendDlgItemMessage(_hSelf, IDC_VIEWPANEL_STATIC, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(str));
::GetDlgItemText(_hSelf, groupStatic, str, stringSize); ::GetDlgItemText(_hSelf, groupStatic, str, stringSize);
generic_string title = str; generic_string title = str;
title += TEXT(" "); title += TEXT(" ");
@ -2142,7 +2142,7 @@ INT_PTR CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPAR
title += str; title += str;
title += TEXT(" : "); title += TEXT(" : ");
::SendDlgItemMessage(_hSelf, IDC_WHICHPART_STATIC, WM_SETTEXT, 0, (LPARAM)title.c_str()); ::SendDlgItemMessage(_hSelf, IDC_WHICHPART_STATIC, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(title.c_str()));
return TRUE; return TRUE;
} }
else if (HIWORD(wParam) == CBN_SELCHANGE) else if (HIWORD(wParam) == CBN_SELCHANGE)
@ -2288,7 +2288,7 @@ INT_PTR CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
if (nppGUI._useDir) if (nppGUI._useDir)
::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_CHECK, BM_SETCHECK, BST_CHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_CHECK, BM_SETCHECK, BST_CHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_EDIT, WM_SETTEXT, 0, (LPARAM)nppGUI._backupDir.c_str()); ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_EDIT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>((nppGUI._backupDir.c_str())));
updateBackupGUI(); updateBackupGUI();
return TRUE; return TRUE;
@ -2302,7 +2302,7 @@ INT_PTR CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
case IDC_BACKUPDIR_EDIT: case IDC_BACKUPDIR_EDIT:
{ {
TCHAR inputDir[MAX_PATH]; TCHAR inputDir[MAX_PATH];
::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_EDIT, WM_GETTEXT, MAX_PATH, (LPARAM)inputDir); ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_EDIT, WM_GETTEXT, MAX_PATH, reinterpret_cast<LPARAM>(inputDir));
nppGUI._backupDir = inputDir; nppGUI._backupDir = inputDir;
return TRUE; return TRUE;
} }
@ -2932,7 +2932,7 @@ INT_PTR CALLBACK SettingsOnCloudDlg::run_dlgProc(UINT Message, WPARAM wParam, LP
::SendDlgItemMessage(_hSelf, IDC_NOCLOUD_RADIO, BM_SETCHECK, !withCloud ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_NOCLOUD_RADIO, BM_SETCHECK, !withCloud ? BST_CHECKED : BST_UNCHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_WITHCLOUD_RADIO, BM_SETCHECK, withCloud ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_WITHCLOUD_RADIO, BM_SETCHECK, withCloud ? BST_CHECKED : BST_UNCHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_CLOUDPATH_EDIT, WM_SETTEXT, 0, (LPARAM)nppGUI._cloudPath.c_str()); ::SendDlgItemMessage(_hSelf, IDC_CLOUDPATH_EDIT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(nppGUI._cloudPath.c_str()));
::EnableWindow(::GetDlgItem(_hSelf, IDC_CLOUDPATH_EDIT), withCloud); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CLOUDPATH_EDIT), withCloud);
::EnableWindow(::GetDlgItem(_hSelf, IDD_CLOUDPATH_BROWSE_BUTTON), withCloud); ::EnableWindow(::GetDlgItem(_hSelf, IDD_CLOUDPATH_BROWSE_BUTTON), withCloud);
} }
@ -2950,7 +2950,7 @@ INT_PTR CALLBACK SettingsOnCloudDlg::run_dlgProc(UINT Message, WPARAM wParam, LP
generic_string message = nppParams->isCloudPathChanged() ? TEXT("Please restart Notepad++ to take effect.") : TEXT(""); generic_string message = nppParams->isCloudPathChanged() ? TEXT("Please restart Notepad++ to take effect.") : TEXT("");
::SetDlgItemText(_hSelf, IDC_SETTINGSONCLOUD_WARNING_STATIC, message.c_str()); ::SetDlgItemText(_hSelf, IDC_SETTINGSONCLOUD_WARNING_STATIC, message.c_str());
::SendDlgItemMessage(_hSelf, IDC_CLOUDPATH_EDIT, WM_SETTEXT, 0, (LPARAM)nppGUI._cloudPath.c_str()); ::SendDlgItemMessage(_hSelf, IDC_CLOUDPATH_EDIT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(nppGUI._cloudPath.c_str()));
::EnableWindow(::GetDlgItem(_hSelf, IDC_CLOUDPATH_EDIT), false); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CLOUDPATH_EDIT), false);
::EnableWindow(::GetDlgItem(_hSelf, IDD_CLOUDPATH_BROWSE_BUTTON), false); ::EnableWindow(::GetDlgItem(_hSelf, IDD_CLOUDPATH_BROWSE_BUTTON), false);
} }

View File

@ -135,7 +135,7 @@ void StatusBar::adjustParts(int clientWidth)
} }
// Tell the status bar to create the window parts. // Tell the status bar to create the window parts.
::SendMessage(_hSelf, SB_SETPARTS, (WPARAM)_partWidthArray.size(), (LPARAM)_lpParts); ::SendMessage(_hSelf, SB_SETPARTS, _partWidthArray.size(), reinterpret_cast<LPARAM>(_lpParts));
} }
@ -148,7 +148,7 @@ bool StatusBar::setText(const TCHAR* str, int whichPart)
else else
_lastSetText.clear(); _lastSetText.clear();
return (TRUE == ::SendMessage(_hSelf, SB_SETTEXT, whichPart, (LPARAM)_lastSetText.c_str())); return (TRUE == ::SendMessage(_hSelf, SB_SETTEXT, whichPart, reinterpret_cast<LPARAM>(_lastSetText.c_str())));
} }
assert(false and "invalid status bar index"); assert(false and "invalid status bar index");
return false; return false;
@ -162,5 +162,5 @@ bool StatusBar::setOwnerDrawText(const TCHAR* str)
else else
_lastSetText.clear(); _lastSetText.clear();
return (::SendMessage(_hSelf, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)_lastSetText.c_str()) == TRUE); return (::SendMessage(_hSelf, SB_SETTEXT, SBT_OWNERDRAW, reinterpret_cast<LPARAM>(_lastSetText.c_str())) == TRUE);
} }

View File

@ -146,7 +146,7 @@ void VerticalFileSwitcherListView::initList()
ListView_InsertItem(_hSelf, &item); ListView_InsertItem(_hSelf, &item);
if (isExtColumn) if (isExtColumn)
{ {
ListView_SetItemText(_hSelf, i, 1, (LPTSTR)::PathFindExtension(fileNameStatus._fn.c_str())); ListView_SetItemText(_hSelf, i, 1, ::PathFindExtension(fileNameStatus._fn.c_str()));
} }
} }
ListView_SetItemState(_hSelf, taskListInfo._currentIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); ListView_SetItemState(_hSelf, taskListInfo._currentIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);

View File

@ -812,7 +812,7 @@ void ScintillaKeyMap::showCurrentSettings() {
} }
void ScintillaKeyMap::updateListItem(int index) { void ScintillaKeyMap::updateListItem(int index) {
::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_INSERTSTRING, index, (LPARAM)toString(index).c_str()); ::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_INSERTSTRING, index, reinterpret_cast<LPARAM>(toString(index).c_str()));
::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_DELETESTRING, index+1, 0); ::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_DELETESTRING, index+1, 0);
} }
@ -828,12 +828,12 @@ INT_PTR CALLBACK ScintillaKeyMap::run_dlgProc(UINT Message, WPARAM wParam, LPARA
for (size_t i = 0 ; i < nrKeys ; ++i) for (size_t i = 0 ; i < nrKeys ; ++i)
{ {
::SendDlgItemMessage(_hSelf, IDC_KEY_COMBO, CB_ADDSTRING, 0, (LPARAM)namedKeyArray[i].name); ::SendDlgItemMessage(_hSelf, IDC_KEY_COMBO, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(namedKeyArray[i].name));
} }
for(size_t i = 0; i < _size; ++i) for(size_t i = 0; i < _size; ++i)
{ {
::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_ADDSTRING, 0, (LPARAM)toString(i).c_str()); ::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(toString(i).c_str()));
} }
::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_SETCURSEL, 0, 0); ::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_SETCURSEL, 0, 0);
@ -885,7 +885,7 @@ INT_PTR CALLBACK ScintillaKeyMap::run_dlgProc(UINT Message, WPARAM wParam, LPARA
{ {
if (res == static_cast<int32_t>(oldsize)) if (res == static_cast<int32_t>(oldsize))
{ {
::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)toString(res).c_str()); ::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_INSERTSTRING, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(toString(res).c_str()));
} }
else else
{ //update current generic_string, can happen if it was disabled { //update current generic_string, can happen if it was disabled