diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 8b386b510..54d143929 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -22,7 +22,17 @@ // initialize the static variable -HINSTANCE ScintillaEditView::_hLib = ::LoadLibrary(TEXT("SciLexer.DLL")); + +// get full ScinLexer.dll path to avoid hijack +TCHAR * getSciLexerFullPathName(TCHAR * moduleFileName, size_t len){ + ::GetModuleFileName(NULL, moduleFileName, len); + ::PathRemoveFileSpec(moduleFileName); + ::PathAppend(moduleFileName, TEXT("SciLexer.dll")); + return moduleFileName; +}; + +TCHAR moduleFileName[1024]; +HINSTANCE ScintillaEditView::_hLib = ::LoadLibrary(getSciLexerFullPathName(moduleFileName, 1024)); int ScintillaEditView::_refCount = 0; UserDefineDialog ScintillaEditView::_userDefineDlg;