Skip to content

Commit

Permalink
24.3.26 Some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tablacus committed Mar 26, 2024
1 parent 90be69f commit f976a2a
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 24 deletions.
Binary file modified Debug/lib/te32.dll
Binary file not shown.
Binary file modified Debug/lib/te64.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions Debug/script/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ g_.Notify = {};

AboutTE = function (n) {
if (n == 0) {
return te.Version < 20240227 ? te.Version : 20240227;
return te.Version < 20240326 ? te.Version : 20240326;
}
if (n == 1) {
const v = AboutTE(0);
Expand Down Expand Up @@ -1163,7 +1163,7 @@ GetThumbnail = function (image, m, f) {
}

GetTempPath = function (n) {
let temp = String(fso.GetSpecialFolder(2).Path);
let temp = String(fso.GetSpecialFolder(2).Path || "C:\\temp");
if (temp.indexOf("~") >= 0) {
const pid = api.ILCreateFromPath(temp);
pid.IsFolder;
Expand Down
2 changes: 2 additions & 0 deletions Debug/script/sync1.js
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,8 @@ te.OnNavigateComplete = function (Ctrl) {
} else {
FocusFV();
}
Ctrl.Data.hwndBefore = void 0;

if (g_.focused) {
g_.focused.Focus();
if (--g_.fTCs <= 0) {
Expand Down
4 changes: 2 additions & 2 deletions TE/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#else
//Version(DLL)
#define VER_Y 24
#define VER_M 2
#define VER_D 27
#define VER_M 3
#define VER_D 26
#endif

//Icon
Expand Down
2 changes: 1 addition & 1 deletion TE/TE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4812,7 +4812,7 @@ function _c(s) {\
// Main message loop:
while (g_bMessageLoop) {
try {
if (!GetMessage(&msg, NULL, 0, 0)) {
if (GetMessage(&msg, NULL, 0, 0) <= 0) {
break;
}
if (MessageProc(&msg) == S_OK) {
Expand Down
18 changes: 6 additions & 12 deletions TE/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,7 @@ HWND teFindChildByClassA(HWND hwnd, LPCSTR lpClassA)
return NULL;
}

VOID teGetDisplayNameOf(VARIANT *pv, int uFlags, VARIANT *pVarResult)
VOID teGetDisplayNameOf(VARIANT *pv, SHGDNF uFlags, VARIANT *pVarResult)
{
try {
IUnknown *punk;
Expand All @@ -2668,22 +2668,14 @@ VOID teGetDisplayNameOf(VARIANT *pv, int uFlags, VARIANT *pVarResult)
}
} else if (FindUnknown(pv, &punk)) {
BSTR bs;
if (teGetStrFromFolderItem(&bs, punk)) {
if (teGetStrFromFolderItem(&bs, punk, uFlags)) {
if (uFlags & SHGDN_INFOLDER) {
BSTR bsName = NULL;
if SUCCEEDED(tePathGetFileName(&bsName, bs)) {
teSetBSTR(pVarResult, &bsName, -1);
return;
}
}
if (uFlags & SHGDN_FORADDRESSBAR) {
BSTR bsLocal;
if (teLocalizePath(bs, &bsLocal)) {
teSetSZ(pVarResult, bsLocal);
::SysFreeString(bsLocal);
return;
}
}
if (!(uFlags & SHGDN_INFOLDER)) {
teSetSZ(pVarResult, bs);
return;
Expand Down Expand Up @@ -2745,6 +2737,7 @@ HRESULT tePathGetFileName(BSTR *pbs, LPWSTR pszPath)
return E_FAIL;
}

/*
BOOL teLocalizePath(LPWSTR pszPath, BSTR *pbsPath)
{
*pbsPath = NULL;
Expand Down Expand Up @@ -2778,6 +2771,7 @@ BOOL teLocalizePath(LPWSTR pszPath, BSTR *pbsPath)
}
return *pbsPath != NULL;
}
*/

int teGetMenuString(BSTR *pbs, HMENU hMenu, UINT uIDItem, BOOL fByPosition)
{
Expand Down Expand Up @@ -3683,12 +3677,12 @@ HRESULT DoFunc(int nFunc, PVOID pObj, HRESULT hr)
return hr;
}

BOOL teGetStrFromFolderItem(BSTR *pbs, IUnknown *punk)
BOOL teGetStrFromFolderItem(BSTR *pbs, IUnknown *punk, SHGDNF uFlags)
{
*pbs = NULL;
CteFolderItem *pid;
if (punk && SUCCEEDED(punk->QueryInterface(g_ClsIdFI, (LPVOID *)&pid))) {
*pbs = pid->GetStrPath();
*pbs = pid->GetStrPath(uFlags);
pid->Release();
}
return *pbs != NULL;
Expand Down
4 changes: 2 additions & 2 deletions TE/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ VOID teStrFormatSize(DWORD dwFormat, LONGLONG qdw, LPWSTR pszBuf, UINT cchBuf);
LPWSTR teGetCommandLine();
HWND FindTreeWindow(HWND hwnd);
HWND teFindChildByClassA(HWND hwnd, LPCSTR lpClassA);
VOID teGetDisplayNameOf(VARIANT *pv, int uFlags, VARIANT *pVarResult);
VOID teGetDisplayNameOf(VARIANT *pv, SHGDNF uFlags, VARIANT *pVarResult);
void GetVarPathFromIDList(VARIANT *pVarResult, LPITEMIDLIST pidl, int uFlags);
HRESULT tePathGetFileName(BSTR *pbs, LPWSTR pszPath);
BOOL teLocalizePath(LPWSTR pszPath, BSTR *pbsPath);
Expand Down Expand Up @@ -921,7 +921,7 @@ VOID GetFolderItemFromVariant(FolderItem **ppid, VARIANT *pv);
BOOL teILGetParent(FolderItem *pid, FolderItem **ppid);
HRESULT DoFunc1(int nFunc, PVOID pObj, VARIANT *pVarResult);
HRESULT DoFunc(int nFunc, PVOID pObj, HRESULT hr);
BOOL teGetStrFromFolderItem(BSTR *pbs, IUnknown *punk);
BOOL teGetStrFromFolderItem(BSTR *pbs, IUnknown *punk, SHGDNF uFlags);
BOOL GetFolderItemFromIDList(FolderItem **ppid, LPITEMIDLIST pidl);
BOOL teILIsEqual(IUnknown *punk1, IUnknown *punk2);
VOID teGetPath(BSTR *pbs, IUnknown *punk);
Expand Down
13 changes: 9 additions & 4 deletions TE/objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,17 @@ VOID CteFolderItem::Clear()
m_dispExtendedProperty = -1;
}

BSTR CteFolderItem::GetStrPath()
BSTR CteFolderItem::GetStrPath(SHGDNF uFlags)
{
if (m_v.vt == VT_BSTR) {
if (m_pidl == NULL || (m_pidlAlt && !ILIsEqual(m_pidl, m_pidlAlt)) || teIsSearchFolder(m_v.bstrVal)) {
if ((m_pidlAlt && !ILIsEqual(m_pidl, m_pidlAlt)) || teIsSearchFolder(m_v.bstrVal)) {
return m_v.bstrVal;
}
if (m_pidl == NULL) {
if (!(uFlags & SHGDN_FORADDRESSBAR) || teIsFileSystem(m_v.bstrVal)) {
return m_v.bstrVal;
}
}
}
return NULL;
}
Expand Down Expand Up @@ -723,7 +728,7 @@ STDMETHODIMP CteFolderItem::get_Parent(IDispatch **ppid)

STDMETHODIMP CteFolderItem::get_Name(BSTR *pbs)
{
if SUCCEEDED(tePathGetFileName(pbs, GetStrPath())) {
if SUCCEEDED(tePathGetFileName(pbs, GetStrPath(SHGDN_INFOLDER))) {
return S_OK;
}
if SUCCEEDED(teGetDisplayNameFromIDList(pbs, GetPidl(), SHGDN_INFOLDER)) {
Expand Down Expand Up @@ -771,7 +776,7 @@ STDMETHODIMP CteFolderItem::put_Name(BSTR bs)

STDMETHODIMP CteFolderItem::get_Path(BSTR *pbs)
{
BSTR bs = GetStrPath();
BSTR bs = GetStrPath(SHGDN_FORADDRESSBAR | SHGDN_FORPARSING);
if (bs) {
*pbs = ::SysAllocString(bs);
return S_OK;
Expand Down
2 changes: 1 addition & 1 deletion TE/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CteFolderItem : public FolderItem, public IPersistFolder2, public IParentA
LPITEMIDLIST GetAlt();
BOOL GetFolderItem();
VOID Clear();
BSTR GetStrPath();
BSTR GetStrPath(SHGDNF uFlags);
VOID MakeUnavailable();

VARIANT m_v;
Expand Down

0 comments on commit f976a2a

Please sign in to comment.