Skip to content

Commit 09f92bd

Browse files
committed
25.12.20 Some fix
1 parent c017e1b commit 09f92bd

13 files changed

Lines changed: 92 additions & 38 deletions

File tree

Debug/lib/te32.dll

1.5 KB
Binary file not shown.

Debug/lib/te64.dll

8.5 KB
Binary file not shown.

Debug/script/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,9 @@ Init = async function () {
503503
ui_.Show = 1;
504504
Resize();
505505
AddEvent("BrowserCreatedEx", "setTimeout(async function () { SetWindowAlpha(await GetTopWindow(), 255); }, 99);");
506-
WebBrowser.DropMode = 1;
506+
setTimeout(function () {
507+
WebBrowser.DropMode = 1;
508+
}, 999);
507509
ClearEvent("Layout");
508510
ClearEvent("Load");
509511
g_.ShowError = true;

Debug/script/options.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@
116116
<button onclick="AddValue('Conf_TrailSize', -1, 0, 16)">-</button>
117117
<button onclick="AddValue('Conf_TrailSize', 1, 0, 16)">+</button>
118118
<br><br>
119-
<label><input type="checkbox" id="!Conf_NoInfotip">Tooltips</label><br><br>
120-
<label>Drag-and-Drop</label><br>
121-
<label><input type="checkbox" id="!Conf_NoDragIcon">Icon</label>
119+
<label><input type="checkbox" id="Conf_NoInfotip">Tooltips</label><br><br>
120+
<label>Drag-and-Drop</label><input type="hidden" name="Conf_NoDragIcon"><br>
121+
<label><input type="checkbox" id="Conf_NoDragIcon:!1" onclick="SetCheckbox(this)">Icon</label><br>
122+
<label><input type="checkbox" id="Conf_NoDragIcon:!8" onclick="SetCheckbox(this)">Icon<span> (</span>Browser<span>)</span></label><br>
122123
</div>
123124
<!--panel_end-->
124125

Debug/script/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ g_.arError = api.CreateObject("Array");
6969

7070
AboutTE = function (n) {
7171
if (n == 0) {
72-
return te.Version < 20251016 ? te.Version : 20251113;
72+
return te.Version < 20251220 ? te.Version : 20251220;
7373
}
7474
if (n == 1) {
7575
const v = AboutTE(0);

Debug/script/sync1.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2861,6 +2861,10 @@ g_.event.begindrag = function (Ctrl) {
28612861
return !isFinite(RunEvent3("BeginDrag", Ctrl));
28622862
}
28632863

2864+
g_.event.dragimage = function (Ctrl, dataObj, di) {
2865+
return RunEvent4("DragImage", Ctrl, dataObj, di);
2866+
}
2867+
28642868
g_.event.beforegetdata = function (Ctrl, Items, nMode) {
28652869
return RunEvent2("BeforeGetData", Ctrl, Items, nMode);
28662870
}
@@ -3796,7 +3800,7 @@ InitCode = function () {
37963800
te.Data.Conf_WheelSelect = GetNum(te.Data.Conf_WheelSelect, 1);
37973801
te.SizeFormat = (te.Data.Conf_SizeFormat || "").replace(/^0x/i, "");
37983802
te.HiddenFilter = ExtractFilter(te.Data.Conf_HiddenFilter);
3799-
te.DragIcon = !GetNum(te.Data.Conf_NoDragIcon);
3803+
te.DragIcon = ~GetNum(te.Data.Conf_NoDragIcon);
38003804
const ar = ['AutoArrange', 'DateTimeFormat', 'Layout', 'LibraryFilter', 'NetworkTimeout', 'ShowInternet', 'ViewOrder'];
38013805
for (let i = ar.length; i--;) {
38023806
te[ar[i]] = te.Data['Conf_' + ar[i]];

TE/Resource.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#else
1616
//Version(DLL)
1717
#define VER_Y 25
18-
#define VER_M 10
19-
#define VER_D 16
18+
#define VER_M 12
19+
#define VER_D 20
2020
#endif
2121

2222
//Icon

TE/TE.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ BOOL g_bUpper11 = FALSE;
194194
BOOL g_bScriptError = FALSE;
195195
extern BOOL g_bDarkMode;
196196
extern std::unordered_map<HWND, HWND> g_umDlgProc;
197-
BOOL g_bDragIcon = TRUE;
198197
COLORREF g_clrBackground = GetSysColor(COLOR_WINDOW);
199198
SHORT g_nDelta = 0;
200199
#ifdef _2000XP
@@ -244,7 +243,6 @@ TEmethod methodTE[] = {
244243
{ 1139, "HiddenFilter" },
245244
// { 1140, "Background" },//Deprecated
246245
// { 1150, "ThumbnailProvider" },//Deprecated
247-
{ 1160, "DragIcon" },
248246
{ 1180, "ExplorerBrowserFilter" },
249247
{ 1190, "TreeHiddenFilter" },
250248
{ TE_METHOD + 1133, "FolderItems" },
@@ -279,6 +277,7 @@ TEmethod methodTE[] = {
279277
{ TE_OFFSET + TE_LibraryFilter, "LibraryFilter" },
280278
{ TE_OFFSET + TE_AutoArrange, "AutoArrange" },
281279
{ TE_OFFSET + TE_ShowInternet, "ShowInternet" },
280+
{ TE_OFFSET + TE_DragIcon, "DragIcon" },
282281

283282
{ START_OnFunc + TE_Labels, "Labels" },
284283
{ START_OnFunc + TE_ColumnsReplace, "ColumnsReplace" },
@@ -337,6 +336,7 @@ TEmethod methodTE[] = {
337336
{ START_OnFunc + TE_OnContentsChanged, "OnContentsChanged" },
338337
{ START_OnFunc + TE_OnFilterView, "OnFilterView" },
339338
{ START_OnFunc + TE_OnShowError, "OnShowError" },
339+
{ START_OnFunc + TE_OnDragImage, "OnDragImage" },
340340
#ifdef _USE_SYNC
341341
{ START_OnFunc + TE_FN, "fn" },
342342
#endif
@@ -8853,7 +8853,7 @@ STDMETHODIMP CteShellBrowser::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid
88538853
case DISPID_BEGINDRAG://XP+
88548854
DoFunc1(TE_OnBeginDrag, this, pVarResult);
88558855
if (pVarResult->vt != VT_BOOL || pVarResult->boolVal) {
8856-
BOOL bHandled = m_bRegenerateItems || ILIsEqual(m_pidl, g_pidls[CSIDL_RESULTSFOLDER]);
8856+
BOOL bHandled = m_bRegenerateItems || ILIsEqual(m_pidl, g_pidls[CSIDL_RESULTSFOLDER]) || !(g_param[TE_DragIcon] & 0x80000000);
88578857
if (bHandled || g_param[TE_ViewOrder]) {
88588858
FolderItems *pid;
88598859
if SUCCEEDED(SelectedItems(&pid)) {
@@ -11459,13 +11459,6 @@ STDMETHODIMP CTE::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlag
1145911459
teSetPtr(pVarResult, teThumbnailProvider);
1146011460
return S_OK;*/
1146111461

11462-
case 1160://DragIcon
11463-
if (nArg >= 0) {
11464-
g_bDragIcon = GetBoolFromVariant(&pDispParams->rgvarg[nArg]);
11465-
}
11466-
teSetBool(pVarResult, g_bDragIcon);
11467-
return S_OK;
11468-
1146911462
case 1180://ExplorerBrowserFilter
1147011463
teSetGetString(nArg, pDispParams, pVarResult, &g_bsExplorerBrowserFilter);
1147111464
return S_OK;
@@ -12366,7 +12359,7 @@ STDMETHODIMP CteWebBrowser::DragEnter(IDataObject *pDataObj, DWORD grfKeyState,
1236612359
hr = S_OK;
1236712360
}
1236812361
if (g_pDropTargetHelper) {
12369-
if (g_bDragIcon) {
12362+
if (g_param[TE_DragIcon] & 8) {
1237012363
if (g_nBlink == 1) {
1237112364
g_pDropTargetHelper->DragEnter(m_hwndBrowser, pDataObj, (LPPOINT)&pt, *pdwEffect);
1237212365
}
@@ -12393,7 +12386,7 @@ STDMETHODIMP CteWebBrowser::DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEff
1239312386
m_dwEffect = DROPEFFECT_NONE;
1239412387
}
1239512388
if (g_pDropTargetHelper) {
12396-
if (g_bDragIcon) {
12389+
if (g_param[TE_DragIcon] & 8) {
1239712390
if (g_nBlink == 1) {
1239812391
g_pDropTargetHelper->DragOver((LPPOINT)&pt, *pdwEffect);
1239912392
}

TE/TE.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
<ProjectGuid>{6FB32DEE-7AB5-4BFE-B84C-287CA38A0AC9}</ProjectGuid>
3939
<RootNamespace>TE</RootNamespace>
4040
<Keyword>Win32Proj</Keyword>
41-
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
41+
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
4242
</PropertyGroup>
4343
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
4444
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
4545
<ConfigurationType>DynamicLibrary</ConfigurationType>
4646
<CharacterSet>Unicode</CharacterSet>
47-
<PlatformToolset>v140_xp</PlatformToolset>
47+
<PlatformToolset>v141_xp</PlatformToolset>
4848
</PropertyGroup>
4949
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseExe|Win32'" Label="Configuration">
5050
<ConfigurationType>Application</ConfigurationType>
@@ -53,7 +53,7 @@
5353
</PropertyGroup>
5454
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
5555
<ConfigurationType>Application</ConfigurationType>
56-
<PlatformToolset>v141</PlatformToolset>
56+
<PlatformToolset>v141_xp</PlatformToolset>
5757
<CharacterSet>Unicode</CharacterSet>
5858
</PropertyGroup>
5959
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugExe|Win32'" Label="Configuration">

TE/common.cpp

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "common.h"
55

6+
extern class CTE;
7+
extern CTE* g_pTE;
68
extern HWND g_hwndMain;
79
extern int g_nException;
810
extern int g_nBlink;
@@ -34,6 +36,7 @@ extern IDispatch *g_pJS;
3436
extern DWORD g_dwCookieJS;
3537
extern IDispatch *g_pOnFunc[Count_OnFunc];
3638
extern GUID g_ClsIdFI;
39+
extern GUID g_clsidWBM;
3740

3841
#ifdef _DEBUG
3942
extern LPWSTR g_strException;
@@ -2287,9 +2290,9 @@ VOID GetPointFormVariant(POINT *ppt, VARIANT *pv)
22872290
if (GetDispatch(pv, &pdisp)) {
22882291
VARIANT v;
22892292
VariantInit(&v);
2290-
teGetProperty(pdisp, L"x", &v);
2293+
teGetPropertyI(pdisp, L"x", &v);
22912294
ppt->x = GetIntFromVariantClear(&v);
2292-
teGetProperty(pdisp, L"y", &v);
2295+
teGetPropertyI(pdisp, L"y", &v);
22932296
ppt->y = GetIntFromVariantClear(&v);
22942297
pdisp->Release();
22952298
return;
@@ -2346,7 +2349,50 @@ HRESULT teDoDragDrop(HWND hwnd, IDataObject *pDataObj, DWORD *pdwEffect, BOOL bD
23462349
g_nDropState = bDropState ? 2 : 1;
23472350
IDragSourceHelper *pDragSourceHelper;
23482351
if SUCCEEDED(g_pDropTargetHelper->QueryInterface(IID_PPV_ARGS(&pDragSourceHelper))) {
2349-
pDragSourceHelper->InitializeFromWindow(hwnd, NULL, pDataObj);
2352+
if (g_param[TE_DragIcon] & 0x80000000) {
2353+
pDragSourceHelper->InitializeFromWindow(hwnd, NULL, pDataObj);
2354+
} else {
2355+
SHDRAGIMAGE di = { 0 };
2356+
if (g_pOnFunc[TE_OnDragImage]) {
2357+
VARIANTARG* pv = GetNewVARIANT(3);
2358+
teSetObject(&pv[2], g_pTE);
2359+
CteFolderItems *pDragItems = new CteFolderItems(pDataObj, NULL);
2360+
teSetObject(&pv[1], pDragItems);
2361+
IDispatch *pdi = NULL;
2362+
GetNewObject(&pdi);
2363+
teSetObject(&pv[0], pdi);
2364+
VARIANT v;
2365+
VariantInit(&v);
2366+
Invoke4(g_pOnFunc[TE_OnDragImage], &v, 3, pv);
2367+
VariantClear(&v);
2368+
teGetProperty(pdi, L"DragImage", &v);
2369+
IUnknown* punk;
2370+
if (FindUnknown(&v, &punk)) {
2371+
CteWICBitmap* pWBM;
2372+
if SUCCEEDED(punk->QueryInterface(g_clsidWBM, (PVOID*)&pWBM)) {
2373+
di.hbmpDragImage = pWBM->GetHBITMAP(-1);
2374+
SafeRelease(&pWBM);
2375+
}
2376+
IWICBitmap* pWICBitmap;
2377+
if SUCCEEDED(punk->QueryInterface(IID_PPV_ARGS(&pWICBitmap))) {
2378+
pWICBitmap->GetSize((UINT*)&di.sizeDragImage.cx, (UINT*)&di.sizeDragImage.cy);
2379+
SafeRelease(&pWICBitmap);
2380+
}
2381+
}
2382+
VariantClear(&v);
2383+
2384+
teGetProperty(pdi, L"ptOffset", &v);
2385+
GetPointFormVariant(&di.ptOffset, &v);
2386+
VariantClear(&v);
2387+
2388+
teGetProperty(pdi, L"crColorKey", &v);
2389+
di.crColorKey = GetIntFromVariantClear(&v);
2390+
}
2391+
pDragSourceHelper->InitializeFromBitmap(&di, pDataObj);
2392+
if (di.hbmpDragImage) {
2393+
::DeleteObject(di.hbmpDragImage);
2394+
}
2395+
}
23502396
pDragSourceHelper->Release();
23512397
}
23522398
g_pDraggingItems = pDataObj;

0 commit comments

Comments
 (0)