diff --git a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp index fe6108cdc..97d3b8f55 100644 --- a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp +++ b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp @@ -513,15 +513,15 @@ void FileBrowser::openSelectFile() HTREEITEM selectedNode = _treeView.getSelection(); if (!selectedNode) return; - generic_string fullPath = getNodePath(selectedNode); + _selectedNodeFullPath = getNodePath(selectedNode); // test the path - if it's a file, open it, otherwise just fold or unfold it - if (!::PathFileExists(fullPath.c_str())) + if (!::PathFileExists(_selectedNodeFullPath.c_str())) return; - if (::PathIsDirectory(fullPath.c_str())) + if (::PathIsDirectory(_selectedNodeFullPath.c_str())) return; - ::SendMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast(fullPath.c_str())); + ::PostMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast(_selectedNodeFullPath.c_str())); } diff --git a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h index 1dc23b0ba..ebc21c6f8 100644 --- a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h +++ b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h @@ -176,6 +176,8 @@ protected: HMENU _hFileMenu = NULL; std::vector _folderUpdaters; + generic_string _selectedNodeFullPath; // this member is used only for PostMessage call + std::vector sortingDataArray; void initPopupMenus(); diff --git a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp index b4d9941da..ea7906b1b 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp +++ b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp @@ -579,7 +579,7 @@ void ProjectPanel::openSelectFile() tvItem.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; if (::PathFileExists(fn->c_str())) { - ::SendMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast(fn->c_str())); + ::PostMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast(fn->c_str())); tvItem.iImage = INDEX_LEAF; tvItem.iSelectedImage = INDEX_LEAF; }