Compare commits
1 Commits
14a5bea926
...
pr/test149
Author | SHA1 | Date | |
---|---|---|---|
![]() |
03e25359b1 |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -23,7 +23,7 @@ A clear and concise description of what you expected to happen.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS Version: [e.g. Windows 10 1803]
|
||||
- QuickLook Version: [e.g. 4.0.2 from Microsoft Store or from MSI installer]
|
||||
- QuickLook Version: [e.g. 0.3.3 from Windows Store]
|
||||
|
||||
**Screenshots and Exception Log**
|
||||
If applicable, add screenshots and logs to help explain your problem. The log file is located in [one of several locations](https://github.com/QL-Win/QuickLook/wiki/Differences-Between-Distributions#user-data-location).
|
||||
|
4
.github/workflows/msbuild.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
||||
run: msbuild /m /p:BuildInParallel=true /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
|
||||
|
||||
# upload msi and zip artifacts so the publish job below can download and then update latest release via Linux
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: quicklook-build-files
|
||||
path: Build/QuickLook-*.*
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: quicklook-build-files
|
||||
|
||||
|
6
.gitignore
vendored
@@ -290,11 +290,7 @@ __pycache__/
|
||||
/QuickLook.Installer/C_QuickLookComponents.wxs
|
||||
/Build/*
|
||||
!/Build/Assets
|
||||
!/Build/AppxManifest.xml
|
||||
!/Build/AppxManifest.*
|
||||
!/Build/assetslayout.resfiles
|
||||
!/Build/priconfig.xml
|
||||
!/Build/micasetup.json
|
||||
!/Build/openssl-sign.cnf
|
||||
!/Build/sideload.crt
|
||||
!/Build/sideload.key
|
||||
!/Build/sideload.pfx
|
53
Build/AppxManifest.dev.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10">
|
||||
<Identity Name="21090PaddyXu.QuickLook" Version="0.0.0.0"
|
||||
Publisher='E=xupaddy@gmail.com, CN="Open Source Developer, Pengfei Xu", O=Open Source Developer, C=FI' />
|
||||
<Properties>
|
||||
<DisplayName>QuickLook</DisplayName>
|
||||
<PublisherDisplayName>Paddy Xu</PublisherDisplayName>
|
||||
<Description>Bring macOS “Quick Look” feature to Windows</Description>
|
||||
<Logo>Assets\storelogo.png</Logo>
|
||||
</Properties>
|
||||
<Resources>
|
||||
<Resource Language="en-us" />
|
||||
<Resource uap:Scale="100" />
|
||||
<Resource uap:Scale="125" />
|
||||
<Resource uap:Scale="150" />
|
||||
<Resource uap:Scale="200" />
|
||||
<Resource uap:Scale="400" />
|
||||
</Resources>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.15063.0" />
|
||||
</Dependencies>
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
</Capabilities>
|
||||
<Applications>
|
||||
<Application Id="Main" Executable="Package\QuickLook.exe" EntryPoint="Windows.FullTrustApplication">
|
||||
<Extensions>
|
||||
<desktop:Extension Category="windows.startupTask" Executable="Package\QuickLook.exe"
|
||||
EntryPoint="Windows.FullTrustApplication">
|
||||
<desktop:StartupTask TaskId="QuickLookTask" Enabled="true" DisplayName="QuickLook" />
|
||||
</desktop:Extension>
|
||||
</Extensions>
|
||||
<uap:VisualElements DisplayName="QuickLook"
|
||||
Description="Bring macOS “Quick Look” feature to Windows"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"
|
||||
Square310x310Logo="Assets\LargeTile.png"
|
||||
Square71x71Logo="Assets\SmallTile.png">
|
||||
<uap:ShowNameOnTiles>
|
||||
<uap:ShowOn Tile="square150x150Logo" />
|
||||
<uap:ShowOn Tile="wide310x150Logo" />
|
||||
<uap:ShowOn Tile="square310x310Logo" />
|
||||
</uap:ShowNameOnTiles>
|
||||
</uap:DefaultTile>
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
</Package>
|
@@ -3,15 +3,10 @@
|
||||
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10">
|
||||
<!-- Invalid package identity name: QL-Win.QuickLook (expected: 21090PaddyXu.QuickLook) -->
|
||||
<!-- Invalid package family name: QL-Win.QuickLook_wgqddy12gm212 (expected: 21090PaddyXu.QuickLook_egxr34yet59cg) -->
|
||||
<!-- Invalid package publisher name: CN=F4F538EC-55CB-41B8-9531-25CC140D0339 (expected: CN=CE36AF3D-FF94-43EB-9908-7EC8FD1D29FB) -->
|
||||
<Identity Name="21090PaddyXu.QuickLook" Version="0.0.0.0" Publisher="CN=CE36AF3D-FF94-43EB-9908-7EC8FD1D29FB" />
|
||||
<Properties>
|
||||
<DisplayName>QuickLook</DisplayName>
|
||||
<!-- We can not set the name to QL-Win, see the following error message -->
|
||||
<!-- Package acceptance validation error: The PublisherDisplayName element in the app manifest of QuickLook-4.0.1.0.appx is QL-Win, which doesn't match your publisher display name: emako. -->
|
||||
<PublisherDisplayName>emako</PublisherDisplayName>
|
||||
<PublisherDisplayName>Paddy Xu</PublisherDisplayName>
|
||||
<Description>Bring macOS “Quick Look” feature to Windows</Description>
|
||||
<Logo>Assets\storelogo.png</Logo>
|
||||
</Properties>
|
||||
@@ -24,7 +19,7 @@
|
||||
<Resource uap:Scale="400" />
|
||||
</Resources>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.26100.0" />
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.15063.0" />
|
||||
</Dependencies>
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
|
Before Width: | Height: | Size: 569 KiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 970 KiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 288 KiB |
Before Width: | Height: | Size: 383 KiB |
Before Width: | Height: | Size: 206 KiB |
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"Template": "${MicaDir}/template/default.7z",
|
||||
"Package": "./Package.7z",
|
||||
"Package": "./QuickLook.7z",
|
||||
"Output": "./${AppName}.exe",
|
||||
"AppName": "QuickLook",
|
||||
"KeyName": "QuickLook",
|
||||
"ExeName": "QuickLook.exe",
|
||||
"Publisher": "QL-Win",
|
||||
"Version": "${Package}./${ExeName}|3",
|
||||
"Version": "${Package}./${ExeName}|4",
|
||||
"TargetFramework": "net472",
|
||||
"Guid": "8B4A9CE5-67B5-4A94-81CB-3771F688FDEB",
|
||||
"Favicon": "./Assets/Square44x44Logo.altform-unplated_targetsize-256.png",
|
||||
@@ -28,15 +28,12 @@
|
||||
"AutoRunLaunchCommand": "/autostart",
|
||||
"IsUseFolderPickerPreferClassic": false,
|
||||
"IsUseInstallPathPreferX86": false,
|
||||
"IsUseInstallPathPreferAppDataLocalPrograms": true,
|
||||
"IsUseInstallPathPreferAppDataRoaming": false,
|
||||
"IsUseRegistryPreferX86": null,
|
||||
"IsAllowFullFolderSecurity": true,
|
||||
"IsAllowFirewall": true,
|
||||
"IsRefreshExplorer": true,
|
||||
"IsInstallCertificate": false,
|
||||
"IsEnableUninstallDelayUntilReboot": true,
|
||||
"IsUseTempPathFork": false,
|
||||
"IsEnvironmentVariable": false,
|
||||
"OverlayInstallRemoveExt": "exe,dll,pdb,config,winmd,txt,bat,ax,manifest,xshd",
|
||||
"UnpackingPassword": null,
|
||||
|
@@ -1,13 +0,0 @@
|
||||
[req]
|
||||
default_bits = 2048
|
||||
prompt = no
|
||||
default_md = sha256
|
||||
distinguished_name = dn
|
||||
x509_extensions = v3_req
|
||||
|
||||
[dn]
|
||||
CN = CE36AF3D-FF94-43EB-9908-7EC8FD1D29FB
|
||||
|
||||
[v3_req]
|
||||
keyUsage = critical, digitalSignature
|
||||
extendedKeyUsage = codeSigning
|
@@ -1,20 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDMjCCAhqgAwIBAgIUBIWdItfat0Fw6npbHI2W7HE/0KYwDQYJKoZIhvcNAQEL
|
||||
BQAwLzEtMCsGA1UEAwwkQ0UzNkFGM0QtRkY5NC00M0VCLTk5MDgtN0VDOEZEMUQy
|
||||
OUZCMB4XDTI1MDUxMzE3NDgzNVoXDTI4MDUxMjE3NDgzNVowLzEtMCsGA1UEAwwk
|
||||
Q0UzNkFGM0QtRkY5NC00M0VCLTk5MDgtN0VDOEZEMUQyOUZCMIIBIjANBgkqhkiG
|
||||
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnAtbhjH01YmWv1U98kMj3epdpuZLE04pGXOR
|
||||
xfdBb1zX8Q75hy5SmIaHrsow7fTXfHsUzuJEmanllMbJGUpi46fLsb8Ijd4uQgXO
|
||||
wSDfIXrm34Buzpk6EKwEWmRMyORmfPwy0A+XdTHydDhEXndy1eGPJ1ZZnldVI8Ho
|
||||
ZF2MW35QBZDjlWZh3RppWNMksvlngrOX4PFfJ+DtOQUvNswbpyqVATMFBk9kShGM
|
||||
XHuieibzDlzxGNKSn3tDvutLBW5hm7iLqEuAeM7dwSac4C+N5FKWnXJndkN3k8AN
|
||||
nD0MHlErN1dLoJQqvAaCarZr8RSPhdanVOylMGkt97NLYZrLTQIDAQABo0YwRDAO
|
||||
BgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwHQYDVR0OBBYEFJEL
|
||||
e4QaWs4H2djQ6nnnc/30sZ/nMA0GCSqGSIb3DQEBCwUAA4IBAQBYBXkl/vEsGUHI
|
||||
qogCfb/DxFlsm059sxHAIhaNjuoTlgwzgj6KSPbKsfnYVMHZFqkg4AaTuRs9iqTL
|
||||
TStM14OjG95gn+7fJ4zxqquEEytk9yb2xj9ZpLAvzZzUrw5qo1lmM7yPRso38l62
|
||||
9g1G1/MVP6pO03QWKzvSV+IlU3DIP3M2r74G8dexL5/Cut1LkOc/tn2ZYt3Ij95e
|
||||
RM2vqxzK2pw6IAVG3wdNGAyN9K8BATRuAXFV6RXkeEBHFNV3wpyq4W+H6hpsrMJM
|
||||
rMZUUqLa8BTUQAsZ1jmL+dRmj2rESeOaOO9jPks4J4c8+v8aJQBmZhvxRyjyMtdL
|
||||
pWHSCCgm
|
||||
-----END CERTIFICATE-----
|
@@ -1,28 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCcC1uGMfTViZa/
|
||||
VT3yQyPd6l2m5ksTTikZc5HF90FvXNfxDvmHLlKYhoeuyjDt9Nd8exTO4kSZqeWU
|
||||
xskZSmLjp8uxvwiN3i5CBc7BIN8heubfgG7OmToQrARaZEzI5GZ8/DLQD5d1MfJ0
|
||||
OERed3LV4Y8nVlmeV1UjwehkXYxbflAFkOOVZmHdGmlY0ySy+WeCs5fg8V8n4O05
|
||||
BS82zBunKpUBMwUGT2RKEYxce6J6JvMOXPEY0pKfe0O+60sFbmGbuIuoS4B4zt3B
|
||||
JpzgL43kUpadcmd2Q3eTwA2cPQweUSs3V0uglCq8BoJqtmvxFI+F1qdU7KUwaS33
|
||||
s0thmstNAgMBAAECggEABS51XWPhmt5E5K6Pw4XKNkS207jC68MFJ1oIkE0bsvcf
|
||||
boWORe2vrW6OKSt/627dYZNJXMNI/tyUNIKooSUwr8QzGysE6DJlUSjrNXYszT+i
|
||||
VJqUU1o614c2unT+fbnj01OhMPp2OjHXOK0OTCAQQ/IySYlFqYssgbxJxgdl2+XX
|
||||
rDiSk5PvZ0Z8PUuG7EvNbRAnUmIQDVTd81My0kPk4M0w8Rg2p0sIN5klIDxTzC98
|
||||
5iUvS+53xch4f8jJOr8s7J/56R+tnIoqfVkIDI3Q4CUhq3s0DAC7GP4vpoynGXn0
|
||||
pLzHvOttFbqgcHkS2zrVOXKwl4Zym4p+kMCub6BCmwKBgQDcGzCvrMon4fIJrymG
|
||||
lmGZMeN8acjD0MKDT8JPgHkwXTz61AbOC2EGoOpWNqrYGOCv6xSMPiub1un6Y5X2
|
||||
KIuAJm+bY+py0Ed+EzZjrFkQpGt6xQ3FY2aFvA5uS3esgcF+OtcUrXEEq0dK9bZ6
|
||||
HB9P90QuND72bvfx9wjLon0dvwKBgQC1fcRbLpqA2lSGglcRoioA/okMPyMk7jH3
|
||||
n3IHjnpjsBu1FPrWH8Tqtop4vrEVS1cxM7P7FXWwWPqUH/2XbCk1R3T9ZD+i1kHi
|
||||
qvSqp4L0dfTk6ibZpywGXRnpQzT5kKJTrSSx9L7Ni00HcvCI1+p4XNdJZm7jNDSy
|
||||
dGSPg1ox8wKBgB6TaF//ENYZfRX7TzlzCnvNglx2FX2eMmcrXULOBgfB7AasDYXx
|
||||
7riNAgCX94OtcQj/DwusV0J+yGIQE3TujPJwZHChoJ/ybvwEjzmpZ3X4YTXcydzx
|
||||
wfwx848+zJEaNVbjtZ0Zuul7IZw4JfEwluj04HPKrjRtleP2/THMkLThAoGBAJYh
|
||||
BwB2OJBGCo2J3ARWJHDWHP/oamXuM58mYekmTs+PqhvM0wG1HesaPMlM1KdMvz+Q
|
||||
CV21jrjlocJOBDPx4NSV24yQFKPaoH2j9OgF0SnvOTjzCFgbFSveb8SpN3UJ031s
|
||||
SGJ8lijpBjsXNSm9kdMm2V96QFfpo33LEjQ077NJAoGARnnvnenmfwlu/5Oq2Ojs
|
||||
WWzOxXTpiGXLnbUNUvQMvqXxGygCGoA18vVveLr6eKfojM8iKtGF91S9NsUkBEkd
|
||||
VKOFnc9OQ5dtoBkN6XZBUCmJCzQZS20A3jq9oionsJlIWOgb/X3L1cS2SZ3ocgKS
|
||||
lCCN2IGaKiGJCPJprpFW7fg=
|
||||
-----END PRIVATE KEY-----
|
112
CHANGELOG.md
@@ -1,112 +0,0 @@
|
||||
## 4.1.1
|
||||
|
||||
- Add built-in ThumbnailViewer plugin [#1662](https://github.com/QL-Win/QuickLook/issues/1662)
|
||||
- Add built-in HelixViewer for 3d models [#1662](https://github.com/QL-Win/QuickLook/issues/1662)
|
||||
- Add FBX model support using AssimpNet [#1479](https://github.com/QL-Win/QuickLook/issues/1479)
|
||||
- Add `SVGA` and `Lottie Files` animation preview support
|
||||
- Add MathJax inline math support to Markdown [#1640](https://github.com/QL-Win/QuickLook/issues/1640)
|
||||
- Add `SubRip Subtitle (.srt) files`, `Protobuf`, `NSIS`, `.gitmodules`, `.dotsettings`, `.gitignore`, `.gitattributes`, `Markdown`, `reStructuredText`, `simple QML syntax`, `.env`, `Configuration (.conf;.config;.cfg)` highlighting [#1002](https://github.com/QL-Win/QuickLook/issues/1002)
|
||||
- Add dark mode highlighting for `PowerShell`, `Registry`, `C`, `C++`, `Java`, `Rust`, `SQL`, `Ruby`, `R`, `PHP`, `Pascal`, `Objective-C`, `Lisp`, `Kotlin`, `Erlang`, `Dart`, `Swift`, `VisualSolution`, `CMake`
|
||||
- Add `MakefileDetector`, `CMakeListsDetector for CMakeLists.txt`, `DockerfileDetector`, `HostsDetector for hosts` for text viewer
|
||||
- Improve QuickLook initialization speed
|
||||
- Optimize JSONDetector with Span
|
||||
- Set RichTextBox background to transparent
|
||||
- Revert Add Sandbox detection from 4.1.0 which will call crash
|
||||
|
||||
## 4.1.0
|
||||
|
||||
- Add built-in AppViewer plugin for `.msi`, `.appx`, `.msix`, `.wgt`, `.wgtu`, `.apk`, `.ipa`, `.hap`, `.deb`, `.dmg`, `.appimage`, `.rpm`, `.aab`
|
||||
- Add built-in ELF viewer plugin for ELF-type files
|
||||
- Add reload feature by JSuttHoops but you should enable `AutoReload` option firstly
|
||||
- New option ProcessRenderMode
|
||||
- Use format detector feature for TextViewer, only `JSON` / `XML` available now
|
||||
- Add support more highlighting for `HLSL`, `XML`, `TXT`, `Properties`, `Lyric`, `Log`, `Python`, `JavaScript`, `Vue`, `CSS`, `Go`, `YAML`, `F#`, `INI`, `TypeScript`, `VB`, `SubStation Alpha` and `Lua`
|
||||
- No markdown resource extraction [#1661](https://github.com/QL-Win/QuickLook/issues/1661) [#1670](https://github.com/QL-Win/QuickLook/issues/1670)
|
||||
- Support X11 and more JPEG2000 image formats
|
||||
- Support JXR image but SDR only [#1680](https://github.com/QL-Win/QuickLook/issues/1680)
|
||||
- Enable window dragging in video viewer panel [#425](https://github.com/QL-Win/QuickLook/issues/425)
|
||||
- Add SVG support using WebView2 in ImageViewer
|
||||
- Support RTL for .txt file [#1612](https://github.com/QL-Win/QuickLook/issues/1612)
|
||||
- Add `Alt+Z` shortcut to toggle word wrap [#1487](https://github.com/QL-Win/QuickLook/issues/1487)
|
||||
- Improve startup speed [#1521](https://github.com/QL-Win/QuickLook/issues/1521)
|
||||
- Improve PDF magic detection
|
||||
- Improve GroupBox UI/UX
|
||||
- Attempt to fix the crash [#1648](https://github.com/QL-Win/QuickLook/issues/1648) `This is an experimental fix, the idea is to remove the tree to prevent the DUCE command`
|
||||
- Update font pangram for FontViewer
|
||||
- Update de translations by King3R
|
||||
- Manually resolve the assembly fails [#1618](https://github.com/QL-Win/QuickLook/issues/1618)
|
||||
- Merge OfficeViewer-Native plugin [#1662](https://github.com/QL-Win/QuickLook/issues/1662)
|
||||
- New option CheckPreviewHandler for OfficeViewer-Native
|
||||
- Add Sandbox detection
|
||||
- Revert the DataGrid style of CSV [#1664](https://github.com/QL-Win/QuickLook/issues/1664)
|
||||
- Remove the WoW64HookHelper from release [#1634](https://github.com/QL-Win/QuickLook/issues/1634)
|
||||
- Fix share button was not visible in win11
|
||||
- Fix generic theme resources [#1652](https://github.com/QL-Win/QuickLook/issues/1652)
|
||||
- Fix old version volume exception [#1653](https://github.com/QL-Win/QuickLook/issues/1653)
|
||||
- Fix CaptionTextButtonStyle not static anymore
|
||||
- Fix unsupported ColorContexts in Windows [#1671](https://github.com/QL-Win/QuickLook/issues/1671)
|
||||
- ~~Fix long path issue [#1643](https://github.com/QL-Win/QuickLook/issues/1643)~~
|
||||
|
||||
## 4.0.2
|
||||
|
||||
- Support .pcx image [#1638](https://github.com/QL-Win/QuickLook/issues/1638)
|
||||
- Improve PE parsing with extended buffer size
|
||||
- Fix flickering [#1628](https://github.com/QL-Win/QuickLook/issues/1628)
|
||||
- Fix DpiAwareness for PerMonitor [#1626](https://github.com/QL-Win/QuickLook/issues/1626)
|
||||
|
||||
- Hide PEViewer Title just like InfoPanel
|
||||
- Avoid audio cover null exception in xaml
|
||||
|
||||
## 4.0.1
|
||||
|
||||
- Support more Markdown file extensions [#1562](https://github.com/QL-Win/QuickLook/issues/1562), [#1601](https://github.com/QL-Win/QuickLook/issues/1601)
|
||||
- Support CLI options [#1620](https://github.com/QL-Win/QuickLook/issues/1620)
|
||||
- Update pt-BR translations in Translations.config
|
||||
- Delay initialization of MarkdownViewer
|
||||
- Make .exe installer use MSI path by default [#1596](https://github.com/QL-Win/QuickLook/issues/1596)
|
||||
- Fix style issues in the Search Panel [#1592](https://github.com/QL-Win/QuickLook/issues/1592)
|
||||
- Fix volume control not working [#1578](https://github.com/QL-Win/QuickLook/issues/1578)
|
||||
- Fix exception when checking for updates [#1577](https://github.com/QL-Win/QuickLook/issues/1577)
|
||||
|
||||
## 4.0.0
|
||||
|
||||
- Add built-in PE viewer plugin
|
||||
- Add built-in font viewer plugin
|
||||
- Update translations
|
||||
- Update dependent packages
|
||||
- Add support for Multi Commander
|
||||
- Add support for both Everything v1.4 and v1.5(a)
|
||||
- Add "Open Data Folder" and dark mode support to tray menu
|
||||
- Add "Restart QuickLook" option to tray menu [#1448](https://github.com/QL-Win/QuickLook/issues/1448)
|
||||
- Implement modern message box UI
|
||||
- Replace icons with Segoe Fluent Icons
|
||||
- Detect and auto-fix Windows blocking issues [#1495](https://github.com/QL-Win/QuickLook/issues/1495)
|
||||
- Adjust tray menu position
|
||||
- Use MicaSetup to create EXE installer
|
||||
- Fix plugin installer description length limit
|
||||
- Prevent crash when WMI fails [#1379](https://github.com/QL-Win/QuickLook/issues/1379)
|
||||
- Show toast when "Prevent Closing" cannot be cancelled [#1368](https://github.com/QL-Win/QuickLook/issues/1368)
|
||||
- Add support for multi-layer GIMP .xcf files [#1224](https://github.com/QL-Win/QuickLook/issues/1224) for ImageViewer
|
||||
- Fix .xcf file extension check [#1229](https://github.com/QL-Win/QuickLook/issues/1229) for ImageViewer
|
||||
- Fix HEIC preview rendering [#1470](https://github.com/QL-Win/QuickLook/issues/1470) for ImageViewer
|
||||
- Add support for .qoi, .icns, .dds, .svgz, .psb, .cur, and .ani formats for ImageViewer
|
||||
- Improve animated WebP support (x64 only) [#1024](https://github.com/QL-Win/QuickLook/issues/1024) [#1324](https://github.com/QL-Win/QuickLook/issues/1324) for ImageViewer
|
||||
- Improve GIF decoding performance [#993](https://github.com/QL-Win/QuickLook/issues/993) for ImageViewer
|
||||
- Add copy button to image viewer [#1399](https://github.com/QL-Win/QuickLook/issues/1399) for ImageViewer
|
||||
- Fix SVG rendering error [#1430](https://github.com/QL-Win/QuickLook/issues/1430) for ImageViewer
|
||||
- Add double-encoding detection [#471](https://github.com/QL-Win/QuickLook/issues/471) [#600](https://github.com/QL-Win/QuickLook/issues/600) for TextViewer
|
||||
- Improve dark mode rendering for TextViewer
|
||||
- Catch exceptions from XSHD loader for TextViewer
|
||||
- Add syntax highlighting for shell scripts [#668](https://github.com/QL-Win/QuickLook/issues/668) for TextViewer
|
||||
- Add dark mode support for C# syntax highlighting for TextViewer
|
||||
- Improve support for comic archive formats [#1276](https://github.com/QL-Win/QuickLook/issues/1276) for ArchiveViewer
|
||||
- Redesign file list with Fluent UI for ArchiveViewer
|
||||
- Change default background color to blue for CsvViewer
|
||||
- Fix issue with non-UTF8 CSV encoding for CsvViewer
|
||||
- Improve rendering and stability for MarkdownViewer
|
||||
- Add support for password-protected PDFs [#155](https://github.com/QL-Win/QuickLook/issues/155) for PDFViewer
|
||||
- Enable auto-resizing of the viewer window for PDFViewer
|
||||
- Fix audio cover parsing error for multiple embedded images for VideoViewer
|
||||
- Add lyric (.lrc) support for audio files [#1506](https://github.com/QL-Win/QuickLook/issues/1506) for VideoViewer
|
||||
- Add support for .mid audio format [#931](https://github.com/QL-Win/QuickLook/issues/931) for VideoViewer
|
||||
- Fix time label overflow in long videos for VideoViewer
|
7
QuickLook.Appx/.gitignore
vendored
@@ -1,7 +0,0 @@
|
||||
.vs/*
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
AppPackages/*
|
||||
BundleArtifacts/*
|
||||
*.user
|
||||
*.cache
|
Before Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 299 B |
Before Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 577 B |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 782 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 782 B |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 607 B |
Before Width: | Height: | Size: 951 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 28 KiB |
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
IgnorableNamespaces="uap rescap">
|
||||
|
||||
<Identity
|
||||
Name="CE36AF3D-FF94-43EB-9908-7EC8FD1D29FB"
|
||||
Publisher="CN=CE36AF3D-FF94-43EB-9908-7EC8FD1D29FB"
|
||||
Version="4.0.2.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>QuickLook</DisplayName>
|
||||
<PublisherDisplayName>ema</PublisherDisplayName>
|
||||
<Logo>Images\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="QuickLook"
|
||||
Description="Bring macOS “Quick Look” feature to Windows"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Images\Square150x150Logo.png"
|
||||
Square44x44Logo="Images\Square44x44Logo.png">
|
||||
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
|
||||
<uap:SplashScreen Image="Images\SplashScreen.png" />
|
||||
<uap:LockScreen BadgeLogo="Images\BadgeLogo.png" Notification="badgeAndTileText"/>
|
||||
<uap:InitialRotationPreference>
|
||||
<uap:Rotation Preference="landscape"/></uap:InitialRotationPreference>
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
</Capabilities>
|
||||
</Package>
|
@@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '15.0'">
|
||||
<VisualStudioVersion>15.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>0b2465a9-2dc4-41c6-9fd5-af357969b85c</ProjectGuid>
|
||||
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
||||
<NoWarn>$(NoWarn);NU1702</NoWarn>
|
||||
<PackageCertificateThumbprint>2C4426FFCBF7BB78EA1856105CCAAC44F7D91F04</PackageCertificateThumbprint>
|
||||
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
|
||||
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
||||
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
||||
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
||||
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
|
||||
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
|
||||
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
|
||||
<EntryPointProjectUniqueName>..\QuickLook\QuickLook.csproj</EntryPointProjectUniqueName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\Wide310x150Logo.scale-400.png" />
|
||||
<Content Include="Images\BadgeLogo.scale-100.png" />
|
||||
<Content Include="Images\BadgeLogo.scale-125.png" />
|
||||
<Content Include="Images\BadgeLogo.scale-150.png" />
|
||||
<Content Include="Images\BadgeLogo.scale-200.png" />
|
||||
<Content Include="Images\BadgeLogo.scale-400.png" />
|
||||
<Content Include="Images\LargeTile.scale-100.png" />
|
||||
<Content Include="Images\LargeTile.scale-125.png" />
|
||||
<Content Include="Images\LargeTile.scale-150.png" />
|
||||
<Content Include="Images\LargeTile.scale-200.png" />
|
||||
<Content Include="Images\LargeTile.scale-400.png" />
|
||||
<Content Include="Images\SmallTile.scale-100.png" />
|
||||
<Content Include="Images\SmallTile.scale-125.png" />
|
||||
<Content Include="Images\SmallTile.scale-150.png" />
|
||||
<Content Include="Images\SmallTile.scale-200.png" />
|
||||
<Content Include="Images\SmallTile.scale-400.png" />
|
||||
<Content Include="Images\SplashScreen.scale-100.png" />
|
||||
<Content Include="Images\SplashScreen.scale-125.png" />
|
||||
<Content Include="Images\SplashScreen.scale-150.png" />
|
||||
<Content Include="Images\SplashScreen.scale-200.png" />
|
||||
<Content Include="Images\SplashScreen.scale-400.png" />
|
||||
<Content Include="Images\Square150x150Logo.scale-100.png" />
|
||||
<Content Include="Images\Square150x150Logo.scale-125.png" />
|
||||
<Content Include="Images\Square150x150Logo.scale-150.png" />
|
||||
<Content Include="Images\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Images\Square150x150Logo.scale-400.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-16.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-24.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-256.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-32.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-48.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-16.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-256.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-32.png" />
|
||||
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-48.png" />
|
||||
<Content Include="Images\Square44x44Logo.scale-100.png" />
|
||||
<Content Include="Images\Square44x44Logo.scale-125.png" />
|
||||
<Content Include="Images\Square44x44Logo.scale-150.png" />
|
||||
<Content Include="Images\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Images\Square44x44Logo.scale-400.png" />
|
||||
<Content Include="Images\Square44x44Logo.targetsize-16.png" />
|
||||
<Content Include="Images\Square44x44Logo.targetsize-24.png" />
|
||||
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Images\Square44x44Logo.targetsize-256.png" />
|
||||
<Content Include="Images\Square44x44Logo.targetsize-32.png" />
|
||||
<Content Include="Images\Square44x44Logo.targetsize-48.png" />
|
||||
<Content Include="Images\StoreLogo.scale-100.png" />
|
||||
<Content Include="Images\StoreLogo.scale-125.png" />
|
||||
<Content Include="Images\StoreLogo.scale-150.png" />
|
||||
<Content Include="Images\StoreLogo.scale-200.png" />
|
||||
<Content Include="Images\StoreLogo.scale-400.png" />
|
||||
<Content Include="Images\Wide310x150Logo.scale-100.png" />
|
||||
<Content Include="Images\Wide310x150Logo.scale-125.png" />
|
||||
<Content Include="Images\Wide310x150Logo.scale-150.png" />
|
||||
<Content Include="Images\Wide310x150Logo.scale-200.png" />
|
||||
<None Include="sideload.pfx" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\QuickLook\QuickLook.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -34,111 +34,111 @@ PCHAR pXmlBuffer;
|
||||
|
||||
void DOpus::GetSelected(PWCHAR buffer)
|
||||
{
|
||||
/*
|
||||
* CPU Disasm
|
||||
* 6A44B588 |. 68 A839526A PUSH OFFSET 6A5239A8 ; /WindowName = "Directory Opus"
|
||||
* 6A44B58D |. 68 6459526A PUSH OFFSET 6A525964 ; |ClassName = "DOpus.ParentWindow"
|
||||
* 6A44B592 |. 894424 40 MOV DWORD PTR SS:[ESP+40],EAX ; |
|
||||
* 6A44B596 |. C74424 30 140 MOV DWORD PTR SS:[ESP+30],14 ; |
|
||||
* 6A44B59E |. FFD7 CALL EDI ; \USER32.FindWindowW
|
||||
* ...
|
||||
* 00BC2E9B |. 50 PUSH EAX ; /lParam = 12FE80C -> 15 ;
|
||||
* 00BC2E9C |. 57 PUSH EDI ; |wParam ; class = dopusrt.getinfo
|
||||
* 00BC2E9D |. 6A 4A PUSH 4A ; |Msg = WM_COPYDATA
|
||||
* 00BC2E9F |. FF75 FC PUSH DWORD PTR SS:[LOCAL.1] ; |hWnd => [LOCAL.1] ; class = DOpus.ParentWindow, text = Directory Opus
|
||||
* 00BC2EA2 |. FF15 0802C000 CALL DWORD PTR DS:[<&USER32.SendMessageW ; \USER32.SendMessageW
|
||||
*
|
||||
* CPU Stack
|
||||
* 012FE80C |00000015
|
||||
* 012FE810 |00000010
|
||||
* 012FE814 |013A26C0 ; UNICODE "listsel"
|
||||
*/
|
||||
/*
|
||||
* CPU Disasm
|
||||
* 6A44B588 |. 68 A839526A PUSH OFFSET 6A5239A8 ; /WindowName = "Directory Opus"
|
||||
* 6A44B58D |. 68 6459526A PUSH OFFSET 6A525964 ; |ClassName = "DOpus.ParentWindow"
|
||||
* 6A44B592 |. 894424 40 MOV DWORD PTR SS:[ESP+40],EAX ; |
|
||||
* 6A44B596 |. C74424 30 140 MOV DWORD PTR SS:[ESP+30],14 ; |
|
||||
* 6A44B59E |. FFD7 CALL EDI ; \USER32.FindWindowW
|
||||
* ...
|
||||
* 00BC2E9B |. 50 PUSH EAX ; /lParam = 12FE80C -> 15 ;
|
||||
* 00BC2E9C |. 57 PUSH EDI ; |wParam ; class = dopusrt.getinfo
|
||||
* 00BC2E9D |. 6A 4A PUSH 4A ; |Msg = WM_COPYDATA
|
||||
* 00BC2E9F |. FF75 FC PUSH DWORD PTR SS:[LOCAL.1] ; |hWnd => [LOCAL.1] ; class = DOpus.ParentWindow, text = Directory Opus
|
||||
* 00BC2EA2 |. FF15 0802C000 CALL DWORD PTR DS:[<&USER32.SendMessageW ; \USER32.SendMessageW
|
||||
*
|
||||
* CPU Stack
|
||||
* 012FE80C |00000015
|
||||
* 012FE810 |00000010
|
||||
* 012FE814 |013A26C0 ; UNICODE "listsel"
|
||||
*/
|
||||
|
||||
if (hMsgWnd == nullptr)
|
||||
PrepareMessageWindow();
|
||||
if (hMsgWnd == nullptr)
|
||||
return;
|
||||
if (hMsgWnd == nullptr)
|
||||
PrepareMessageWindow();
|
||||
if (hMsgWnd == nullptr)
|
||||
return;
|
||||
|
||||
PWCHAR data = DOPUS_IPC_LP_DATA;
|
||||
COPYDATASTRUCT cds;
|
||||
cds.dwData = DOPUS_IPC_LP_INFO;
|
||||
cds.cbData = static_cast<DWORD>(wcslen(data) + 1) * sizeof WCHAR;
|
||||
cds.lpData = data;
|
||||
PWCHAR data = DOPUS_IPC_LP_DATA;
|
||||
COPYDATASTRUCT cds;
|
||||
cds.dwData = DOPUS_IPC_LP_INFO;
|
||||
cds.cbData = static_cast<DWORD>(wcslen(data) + 1) * sizeof WCHAR;
|
||||
cds.lpData = data;
|
||||
|
||||
auto ret = SendMessage(FindWindow(DOPUS_CLASS, DOPUS_NAME), WM_COPYDATA, reinterpret_cast<WPARAM>(hMsgWnd),
|
||||
reinterpret_cast<LPARAM>(&cds));
|
||||
if (!ret)
|
||||
return;
|
||||
auto ret = SendMessage(FindWindow(DOPUS_CLASS, DOPUS_NAME), WM_COPYDATA, reinterpret_cast<WPARAM>(hMsgWnd),
|
||||
reinterpret_cast<LPARAM>(&cds));
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
WaitForSingleObject(hGetResultEvent, 2000);
|
||||
WaitForSingleObject(hGetResultEvent, 2000);
|
||||
|
||||
ParseXmlBuffer(buffer);
|
||||
ParseXmlBuffer(buffer);
|
||||
|
||||
delete[] pXmlBuffer;
|
||||
delete[] pXmlBuffer;
|
||||
}
|
||||
|
||||
void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
||||
{
|
||||
/*
|
||||
* <?xml version="1.0" encoding="UTF-8"?>
|
||||
* <results command="listsel" result="1">
|
||||
* <items display_path="C:\folder" lister="0x707f6" path="C:\folder" tab="0xb0844">
|
||||
* <item id="11" name="1.jpg" path="C:\folder\1.jpg" type="0" />
|
||||
* <item id="12" name="2.zip" path="C:\folder\2.zip" type="1" />
|
||||
* ...
|
||||
*/
|
||||
/*
|
||||
* <?xml version="1.0" encoding="UTF-8"?>
|
||||
* <results command="listsel" result="1">
|
||||
* <items display_path="C:\folder" lister="0x707f6" path="C:\folder" tab="0xb0844">
|
||||
* <item id="11" name="1.jpg" path="C:\folder\1.jpg" type="0" />
|
||||
* <item id="12" name="2.zip" path="C:\folder\2.zip" type="1" />
|
||||
* ...
|
||||
*/
|
||||
|
||||
using namespace rapidxml;
|
||||
using namespace rapidxml;
|
||||
|
||||
xml_document<> doc;
|
||||
doc.parse<0>(pXmlBuffer);
|
||||
xml_document<> doc;
|
||||
doc.parse<0>(pXmlBuffer);
|
||||
|
||||
auto results = doc.first_node("results");
|
||||
auto items = results->first_node("items");
|
||||
for (auto item = items->first_node("item"); item; item = item->next_sibling("item"))
|
||||
{
|
||||
auto path = item->first_attribute("path")->value();
|
||||
auto results = doc.first_node("results");
|
||||
auto items = results->first_node("items");
|
||||
for (auto item = items->first_node("item"); item; item = item->next_sibling("item"))
|
||||
{
|
||||
auto path = item->first_attribute("path")->value();
|
||||
|
||||
auto size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, -1, nullptr, 0);
|
||||
auto b = new WCHAR[size];
|
||||
MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, -1, b, size);
|
||||
auto size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, -1, nullptr, 0);
|
||||
auto b = new WCHAR[size];
|
||||
MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, -1, b, size);
|
||||
|
||||
wcscpy_s(buffer, wcslen(b) + 1, b); // DOpus supports Long Path
|
||||
wcscpy_s(buffer, wcslen(b) + 1, b); // DOpus supports Long Path
|
||||
|
||||
delete[] b;
|
||||
return; // we now cares only the first result
|
||||
}
|
||||
delete[] b;
|
||||
return; // we now cares only the first result
|
||||
}
|
||||
}
|
||||
|
||||
void DOpus::PrepareMessageWindow()
|
||||
{
|
||||
WNDCLASSEX wx = {sizeof wx};
|
||||
wx.cbSize = sizeof(WNDCLASSEX);
|
||||
wx.lpfnWndProc = msgWindowProc;
|
||||
wx.lpszClassName = MSGWINDOW_CLASS;
|
||||
WNDCLASSEX wx = {sizeof wx};
|
||||
wx.cbSize = sizeof(WNDCLASSEX);
|
||||
wx.lpfnWndProc = msgWindowProc;
|
||||
wx.lpszClassName = MSGWINDOW_CLASS;
|
||||
|
||||
if (RegisterClassEx(&wx))
|
||||
hMsgWnd = CreateWindowEx(0, MSGWINDOW_CLASS, L"", 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr, nullptr, nullptr);
|
||||
if (RegisterClassEx(&wx))
|
||||
hMsgWnd = CreateWindowEx(0, MSGWINDOW_CLASS, L"", 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr, nullptr, nullptr);
|
||||
|
||||
hGetResultEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||
hGetResultEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK DOpus::msgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_COPYDATA:
|
||||
{
|
||||
auto cds = reinterpret_cast<PCOPYDATASTRUCT>(lParam);
|
||||
auto buf = static_cast<PCHAR>(cds->lpData);
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_COPYDATA:
|
||||
{
|
||||
auto cds = reinterpret_cast<PCOPYDATASTRUCT>(lParam);
|
||||
auto buf = static_cast<PCHAR>(cds->lpData);
|
||||
|
||||
pXmlBuffer = new CHAR[cds->cbData + 1]{'\0'};
|
||||
memcpy(pXmlBuffer, buf, cds->cbData);
|
||||
pXmlBuffer = new CHAR[cds->cbData + 1]{'\0'};
|
||||
memcpy(pXmlBuffer, buf, cds->cbData);
|
||||
|
||||
SetEvent(hGetResultEvent);
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
SetEvent(hGetResultEvent);
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -19,9 +19,9 @@
|
||||
class DOpus
|
||||
{
|
||||
public:
|
||||
static void PrepareMessageWindow();
|
||||
static void GetSelected(PWCHAR buffer);
|
||||
static void PrepareMessageWindow();
|
||||
static void GetSelected(PWCHAR buffer);
|
||||
private:
|
||||
static void ParseXmlBuffer(PWCHAR buffer);
|
||||
static LRESULT CALLBACK msgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
static void ParseXmlBuffer(PWCHAR buffer);
|
||||
static LRESULT CALLBACK msgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -34,122 +34,122 @@ static WCHAR filePathBuffer[MAX_PATH] = {'\0'};
|
||||
|
||||
void DialogHook::GetSelected(PWCHAR buffer)
|
||||
{
|
||||
if (HelperMethods::IsUWP())
|
||||
return;
|
||||
if (HelperMethods::IsUWP())
|
||||
return;
|
||||
|
||||
auto hwndfg = GetForegroundWindow();
|
||||
DWORD pid = 0;
|
||||
auto tid = GetWindowThreadProcessId(hwndfg, &pid);
|
||||
auto hwndfg = GetForegroundWindow();
|
||||
DWORD pid = 0;
|
||||
auto tid = GetWindowThreadProcessId(hwndfg, &pid);
|
||||
|
||||
auto hProc = OpenProcess(PROCESS_QUERY_INFORMATION, false, pid);
|
||||
if (hProc == nullptr)
|
||||
return;
|
||||
auto hProc = OpenProcess(PROCESS_QUERY_INFORMATION, false, pid);
|
||||
if (hProc == nullptr)
|
||||
return;
|
||||
|
||||
if (WM_HOOK_NOTIFY == 0)
|
||||
WM_HOOK_NOTIFY = RegisterWindowMessage(L"WM_QUICKLOOK_HOOK_NOTIFY_MSG");
|
||||
if (WM_HOOK_NOTIFY == 0)
|
||||
WM_HOOK_NOTIFY = RegisterWindowMessage(L"WM_QUICKLOOK_HOOK_NOTIFY_MSG");
|
||||
|
||||
BOOL isTargetWoW64 = false;
|
||||
if (!IsWow64Process(hProc, &isTargetWoW64))
|
||||
return;
|
||||
BOOL isTargetWoW64 = false;
|
||||
if (!IsWow64Process(hProc, &isTargetWoW64))
|
||||
return;
|
||||
|
||||
CloseHandle(hProc);
|
||||
CloseHandle(hProc);
|
||||
|
||||
BOOL isSelfWoW64 = false;
|
||||
if (!IsWow64Process(GetCurrentProcess(), &isSelfWoW64))
|
||||
return;
|
||||
BOOL isSelfWoW64 = false;
|
||||
if (!IsWow64Process(GetCurrentProcess(), &isSelfWoW64))
|
||||
return;
|
||||
|
||||
// if QuickLook is 64bit and target is 32bit, obtain result from the helper
|
||||
if (isTargetWoW64 && !isSelfWoW64)
|
||||
{
|
||||
GetSelectedFromWoW64HookHelper(buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ghHook != nullptr)
|
||||
UnhookWindowsHookEx(ghHook);
|
||||
ghHook = SetWindowsHookEx(WH_CALLWNDPROC, static_cast<HOOKPROC>(MsgHookProc), ModuleFromAddress(MsgHookProc), tid);
|
||||
if (ghHook == nullptr)
|
||||
return;
|
||||
// if QuickLook is 64bit and target is 32bit, obtain result from the helper
|
||||
if (isTargetWoW64 && !isSelfWoW64)
|
||||
{
|
||||
GetSelectedFromWoW64HookHelper(buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ghHook != nullptr)
|
||||
UnhookWindowsHookEx(ghHook);
|
||||
ghHook = SetWindowsHookEx(WH_CALLWNDPROC, static_cast<HOOKPROC>(MsgHookProc), ModuleFromAddress(MsgHookProc), tid);
|
||||
if (ghHook == nullptr)
|
||||
return;
|
||||
|
||||
SendMessage(hwndfg, WM_HOOK_NOTIFY, 0, 0);
|
||||
|
||||
GetLongPathName(filePathBuffer, buffer, MAX_PATH_EX);
|
||||
}
|
||||
SendMessage(hwndfg, WM_HOOK_NOTIFY, 0, 0);
|
||||
|
||||
GetLongPathName(filePathBuffer, buffer, MAX_PATH_EX);
|
||||
}
|
||||
}
|
||||
|
||||
void DialogHook::getSelectedInternal(CComPtr<IShellBrowser> psb, PWCHAR buffer)
|
||||
{
|
||||
CComPtr<IShellView> psv;
|
||||
if (FAILED(psb->QueryActiveShellView(&psv)))
|
||||
return;
|
||||
CComPtr<IShellView> psv;
|
||||
if (FAILED(psb->QueryActiveShellView(&psv)))
|
||||
return;
|
||||
|
||||
CComPtr<IDataObject> dao;
|
||||
if (FAILED(psv->GetItemObject(SVGIO_SELECTION, IID_IDataObject, reinterpret_cast<void**>(&dao))))
|
||||
return;
|
||||
CComPtr<IDataObject> dao;
|
||||
if (FAILED(psv->GetItemObject(SVGIO_SELECTION, IID_IDataObject, reinterpret_cast<void**>(&dao))))
|
||||
return;
|
||||
|
||||
return HelperMethods::ObtainFirstItem(dao, buffer);
|
||||
return HelperMethods::ObtainFirstItem(dao, buffer);
|
||||
}
|
||||
|
||||
void DialogHook::GetSelectedFromWoW64HookHelper(PWCHAR buffer)
|
||||
{
|
||||
if (!WoW64HookHelper::CheckStatus())
|
||||
if (!WoW64HookHelper::Launch())
|
||||
return;
|
||||
if (!WoW64HookHelper::CheckStatus())
|
||||
if (!WoW64HookHelper::Launch())
|
||||
return;
|
||||
|
||||
auto hHelperWnd = FindWindowEx(HWND_MESSAGE, nullptr, WoW64HookHelper::GetMsgWindowClassName(), nullptr);
|
||||
if (hHelperWnd == nullptr)
|
||||
return;
|
||||
auto hHelperWnd = FindWindowEx(HWND_MESSAGE, nullptr, WoW64HookHelper::GetMsgWindowClassName(), nullptr);
|
||||
if (hHelperWnd == nullptr)
|
||||
return;
|
||||
|
||||
auto hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, MAX_PATH * sizeof WCHAR,
|
||||
SHARED_MEM_NAME);
|
||||
if (hMapFile == nullptr)
|
||||
return;
|
||||
auto hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, MAX_PATH * sizeof WCHAR,
|
||||
SHARED_MEM_NAME);
|
||||
if (hMapFile == nullptr)
|
||||
return;
|
||||
|
||||
auto sharedBuffer = static_cast<PWCHAR>(MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, MAX_PATH * sizeof WCHAR));
|
||||
if (sharedBuffer == nullptr)
|
||||
{
|
||||
CloseHandle(hMapFile);
|
||||
return;
|
||||
}
|
||||
auto sharedBuffer = static_cast<PWCHAR>(MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, MAX_PATH * sizeof WCHAR));
|
||||
if (sharedBuffer == nullptr)
|
||||
{
|
||||
CloseHandle(hMapFile);
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessage(hHelperWnd, WM_HOOK_NOTIFY, 0, 0);
|
||||
SendMessage(hHelperWnd, WM_HOOK_NOTIFY, 0, 0);
|
||||
|
||||
// the sharedBuffer should now ready
|
||||
GetLongPathName(sharedBuffer, buffer, MAX_PATH_EX);
|
||||
// the sharedBuffer should now ready
|
||||
GetLongPathName(sharedBuffer, buffer, MAX_PATH_EX);
|
||||
|
||||
UnmapViewOfFile(sharedBuffer);
|
||||
CloseHandle(hMapFile);
|
||||
UnmapViewOfFile(sharedBuffer);
|
||||
CloseHandle(hMapFile);
|
||||
}
|
||||
|
||||
HMODULE DialogHook::ModuleFromAddress(PVOID pv)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
return VirtualQuery(pv, &mbi, sizeof mbi) != 0 ? static_cast<HMODULE>(mbi.AllocationBase) : nullptr;
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
return VirtualQuery(pv, &mbi, sizeof mbi) != 0 ? static_cast<HMODULE>(mbi.AllocationBase) : nullptr;
|
||||
}
|
||||
|
||||
LRESULT DialogHook::MsgHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (nCode < 0)
|
||||
goto CONTINUE;
|
||||
if (nCode < 0)
|
||||
goto CONTINUE;
|
||||
|
||||
auto pMSG = reinterpret_cast<CWPSTRUCT*>(lParam);
|
||||
auto pMSG = reinterpret_cast<CWPSTRUCT*>(lParam);
|
||||
|
||||
// only response to WM_HOOK_NOTIFY
|
||||
if (pMSG->message != WM_HOOK_NOTIFY)
|
||||
goto CONTINUE;
|
||||
// only response to WM_HOOK_NOTIFY
|
||||
if (pMSG->message != WM_HOOK_NOTIFY)
|
||||
goto CONTINUE;
|
||||
|
||||
UnhookWindowsHookEx(ghHook);
|
||||
ghHook = nullptr;
|
||||
UnhookWindowsHookEx(ghHook);
|
||||
ghHook = nullptr;
|
||||
|
||||
// get current selected item
|
||||
auto psb = reinterpret_cast<IShellBrowser*>(SendMessage(GetForegroundWindow(), WM_USER + 7, 0, 0));
|
||||
if (psb == nullptr)
|
||||
goto CONTINUE;
|
||||
// get current selected item
|
||||
auto psb = reinterpret_cast<IShellBrowser*>(SendMessage(GetForegroundWindow(), WM_USER + 7, 0, 0));
|
||||
if (psb == nullptr)
|
||||
goto CONTINUE;
|
||||
|
||||
getSelectedInternal(psb, filePathBuffer);
|
||||
getSelectedInternal(psb, filePathBuffer);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
CONTINUE:
|
||||
return CallNextHookEx(ghHook, nCode, wParam, lParam);
|
||||
return CallNextHookEx(ghHook, nCode, wParam, lParam);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -19,11 +19,11 @@
|
||||
class DialogHook
|
||||
{
|
||||
public:
|
||||
static void GetSelected(PWCHAR buffer);
|
||||
static void GetSelected(PWCHAR buffer);
|
||||
|
||||
private:
|
||||
static void getSelectedInternal(CComPtr<IShellBrowser> psb, PWCHAR buffer);
|
||||
static void GetSelectedFromWoW64HookHelper(PWCHAR buffer);
|
||||
static HMODULE ModuleFromAddress(PVOID pv);
|
||||
static LRESULT CALLBACK MsgHookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
static void getSelectedInternal(CComPtr<IShellBrowser> psb, PWCHAR buffer);
|
||||
static void GetSelectedFromWoW64HookHelper(PWCHAR buffer);
|
||||
static HMODULE ModuleFromAddress(PVOID pv);
|
||||
static LRESULT CALLBACK MsgHookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -27,18 +27,18 @@
|
||||
EXPORT void Init()
|
||||
{
|
||||
#ifdef WIN64
|
||||
WoW64HookHelper::Launch();
|
||||
WoW64HookHelper::Launch();
|
||||
#endif
|
||||
DOpus::PrepareMessageWindow();
|
||||
DOpus::PrepareMessageWindow();
|
||||
MultiCommander::PrepareMessageWindow();
|
||||
}
|
||||
|
||||
EXPORT Shell32::FocusedWindowType GetFocusedWindowType()
|
||||
{
|
||||
return Shell32::GetFocusedWindowType();
|
||||
return Shell32::GetFocusedWindowType();
|
||||
}
|
||||
|
||||
EXPORT void GetCurrentSelection(PWCHAR buffer)
|
||||
{
|
||||
Shell32::GetCurrentSelection(buffer);
|
||||
Shell32::GetCurrentSelection(buffer);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -20,66 +20,66 @@
|
||||
|
||||
void Everything::GetSelected(PWCHAR buffer)
|
||||
{
|
||||
auto hWinFG = GetForegroundWindow();
|
||||
|
||||
// Everything v1.5 IPC via hidden window.
|
||||
HWND hWinI = FindWindowExW(hWinFG, NULL, EVERYTHING_IPC_HIDDEN_WIN_CLASS, NULL);
|
||||
|
||||
if (hWinI != nullptr) {
|
||||
int pLength = GetWindowTextLength(hWinI);
|
||||
wchar_t* pText = new wchar_t[pLength + 1];
|
||||
GetWindowText(hWinI, pText, pLength + 1);
|
||||
wcsncpy_s(buffer, MAX_PATH_EX, pText, pLength);
|
||||
return; // Success. Clipboard access unnecessary.
|
||||
}
|
||||
auto hWinFG = GetForegroundWindow();
|
||||
|
||||
// Everything v1.5 IPC via hidden window.
|
||||
HWND hWinI = FindWindowExW(hWinFG, NULL, EVERYTHING_IPC_HIDDEN_WIN_CLASS, NULL);
|
||||
|
||||
if (hWinI != nullptr) {
|
||||
int pLength = GetWindowTextLength(hWinI);
|
||||
wchar_t* pText = new wchar_t[pLength + 1];
|
||||
GetWindowText(hWinI, pText, pLength + 1);
|
||||
wcsncpy_s(buffer, MAX_PATH_EX, pText, pLength);
|
||||
return; // Success. Clipboard access unnecessary.
|
||||
}
|
||||
|
||||
HWND hWin = FindWindowW(EVERYTHING_IPC_WINDOW_CLASS, NULL);
|
||||
HWND hWin = FindWindowW(EVERYTHING_IPC_WINDOW_CLASS, NULL);
|
||||
|
||||
if (hWin != nullptr) {
|
||||
// Everything IPC Clipboard
|
||||
SendMessageW(
|
||||
hWin,
|
||||
WM_COMMAND,
|
||||
MAKEWPARAM(EVERYTHING_IPC_COPY_TO_CLIPBOARD, 0),
|
||||
0);
|
||||
if (hWin != nullptr) {
|
||||
// Everything IPC Clipboard
|
||||
SendMessageW(
|
||||
hWin,
|
||||
WM_COMMAND,
|
||||
MAKEWPARAM(EVERYTHING_IPC_COPY_TO_CLIPBOARD, 0),
|
||||
0);
|
||||
|
||||
Sleep(100);
|
||||
|
||||
if (!OpenClipboard(nullptr))
|
||||
return;
|
||||
|
||||
auto hData = GetClipboardData(CF_UNICODETEXT);
|
||||
if (hData == nullptr)
|
||||
return;
|
||||
Sleep(100);
|
||||
|
||||
if (!OpenClipboard(nullptr))
|
||||
return;
|
||||
|
||||
auto hData = GetClipboardData(CF_UNICODETEXT);
|
||||
if (hData == nullptr)
|
||||
return;
|
||||
|
||||
auto pText = static_cast<PWCHAR>(GlobalLock(hData));
|
||||
if (pText == nullptr)
|
||||
return;
|
||||
auto pText = static_cast<PWCHAR>(GlobalLock(hData));
|
||||
if (pText == nullptr)
|
||||
return;
|
||||
|
||||
auto p = wcsstr(pText, L"\r\n");
|
||||
auto l = p == nullptr ? wcslen(pText) : p - pText;
|
||||
wcsncpy_s(buffer, MAX_PATH_EX, pText, l); // Everything supports Long Path
|
||||
|
||||
GlobalUnlock(hData);
|
||||
CloseClipboard();
|
||||
}
|
||||
auto p = wcsstr(pText, L"\r\n");
|
||||
auto l = p == nullptr ? wcslen(pText) : p - pText;
|
||||
wcsncpy_s(buffer, MAX_PATH_EX, pText, l); // Everything supports Long Path
|
||||
|
||||
GlobalUnlock(hData);
|
||||
CloseClipboard();
|
||||
}
|
||||
}
|
||||
|
||||
bool Everything::MatchClass(PWCHAR classBuffer)
|
||||
{
|
||||
WCHAR sMatchC[256] = { '\0' };
|
||||
WCHAR sMatchS[256] = EVERYTHING_IPC_WINDOW_CLASS;
|
||||
size_t iLen = wcslen(sMatchS);
|
||||
wcsncpy_s(sMatchC, classBuffer, iLen);
|
||||
return (0 == wcscmp(sMatchC, sMatchS));
|
||||
WCHAR sMatchC[256] = { '\0' };
|
||||
WCHAR sMatchS[256] = EVERYTHING_IPC_WINDOW_CLASS;
|
||||
size_t iLen = wcslen(sMatchS);
|
||||
wcsncpy_s(sMatchC, classBuffer, iLen);
|
||||
return (0 == wcscmp(sMatchC, sMatchS));
|
||||
}
|
||||
|
||||
void Everything::backupClipboard()
|
||||
{
|
||||
// TODO
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Everything::restoreClipboard()
|
||||
{
|
||||
// TODO
|
||||
// TODO
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -15,18 +15,18 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define EVERYTHING_IPC_HIDDEN_WIN_CLASS L"EVERYTHING_RESULT_LIST_FOCUS"
|
||||
#define EVERYTHING_IPC_WINDOW_CLASS L"EVERYTHING"
|
||||
#define EVERYTHING_IPC_COPY_TO_CLIPBOARD 41007
|
||||
#define EVERYTHING_IPC_HIDDEN_WIN_CLASS L"EVERYTHING_RESULT_LIST_FOCUS"
|
||||
#define EVERYTHING_IPC_WINDOW_CLASS L"EVERYTHING"
|
||||
#define EVERYTHING_IPC_COPY_TO_CLIPBOARD 41007
|
||||
|
||||
#pragma once
|
||||
class Everything
|
||||
{
|
||||
public:
|
||||
static void GetSelected(PWCHAR buffer);
|
||||
static bool MatchClass(PWCHAR classBuffer);
|
||||
static void GetSelected(PWCHAR buffer);
|
||||
static bool MatchClass(PWCHAR classBuffer);
|
||||
|
||||
private:
|
||||
static void backupClipboard();
|
||||
static void restoreClipboard();
|
||||
static void backupClipboard();
|
||||
static void restoreClipboard();
|
||||
};
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -16,169 +16,118 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "strsafe.h"
|
||||
|
||||
#include "HelperMethods.h"
|
||||
|
||||
void HelperMethods::GetSelectedInternal(CComPtr<IShellBrowser> psb, PWCHAR buffer)
|
||||
{
|
||||
CComPtr<IShellView> psv;
|
||||
if (FAILED(psb->QueryActiveShellView(&psv)))
|
||||
return;
|
||||
CComPtr<IShellView> psv;
|
||||
if (FAILED(psb->QueryActiveShellView(&psv)))
|
||||
return;
|
||||
|
||||
CComPtr<IDataObject> dao;
|
||||
if (FAILED(psv->GetItemObject(SVGIO_SELECTION, IID_IDataObject, reinterpret_cast<void**>(&dao))))
|
||||
return;
|
||||
CComPtr<IDataObject> dao;
|
||||
if (FAILED(psv->GetItemObject(SVGIO_SELECTION, IID_IDataObject, reinterpret_cast<void**>(&dao))))
|
||||
return;
|
||||
|
||||
return ObtainFirstItem(dao, buffer);
|
||||
return ObtainFirstItem(dao, buffer);
|
||||
}
|
||||
|
||||
void HelperMethods::ObtainFirstItem(CComPtr<IDataObject> dao, PWCHAR buffer)
|
||||
{
|
||||
if (!dao || !buffer)
|
||||
return;
|
||||
FORMATETC formatetc;
|
||||
STGMEDIUM medium = {sizeof medium};
|
||||
|
||||
FORMATETC formatetc = {};
|
||||
STGMEDIUM medium = {};
|
||||
formatetc.cfFormat = CF_HDROP;
|
||||
formatetc.ptd = nullptr;
|
||||
formatetc.dwAspect = DVASPECT_CONTENT;
|
||||
formatetc.lindex = -1;
|
||||
formatetc.tymed = TYMED_HGLOBAL;
|
||||
|
||||
formatetc.cfFormat = CF_HDROP;
|
||||
formatetc.ptd = nullptr;
|
||||
formatetc.dwAspect = DVASPECT_CONTENT;
|
||||
formatetc.lindex = -1;
|
||||
formatetc.tymed = TYMED_HGLOBAL;
|
||||
medium.tymed = TYMED_HGLOBAL;
|
||||
|
||||
medium.tymed = TYMED_HGLOBAL;
|
||||
if (FAILED(dao->GetData(&formatetc, &medium)))
|
||||
return;
|
||||
|
||||
// Try CF_HDROP first
|
||||
// If the file path is too long, the call might fail but CFSTR_SHELLIDLIST will do it
|
||||
// https://github.com/QL-Win/QuickLook/issues/1643
|
||||
if (SUCCEEDED(dao->GetData(&formatetc, &medium)))
|
||||
{
|
||||
HDROP hDrop = HDROP(medium.hGlobal);
|
||||
int count = DragQueryFile(hDrop, 0xFFFFFFFF, nullptr, 0);
|
||||
if (count >= 1)
|
||||
{
|
||||
WCHAR localBuffer[MAX_PATH] = { '\0' };
|
||||
if (DragQueryFileW(hDrop, 0, localBuffer, MAX_PATH) > 0)
|
||||
{
|
||||
GetLongPathName(localBuffer, buffer, MAX_PATH_EX);
|
||||
ReleaseStgMedium(&medium);
|
||||
return;
|
||||
}
|
||||
ReleaseStgMedium(&medium);
|
||||
}
|
||||
}
|
||||
int n = DragQueryFile(HDROP(medium.hGlobal), 0xFFFFFFFF, nullptr, 0);
|
||||
|
||||
// If CF_HDROP fails, try CFSTR_SHELLIDLIST
|
||||
// Support Desktop Icons (This PC, Recycle Bin and so on)
|
||||
// https://github.com/QL-Win/QuickLook/issues/1610
|
||||
static const CLIPFORMAT cfShellIDList = (CLIPFORMAT)RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
|
||||
formatetc.cfFormat = cfShellIDList;
|
||||
if (n < 1)
|
||||
return;
|
||||
|
||||
if (SUCCEEDED(dao->GetData(&formatetc, &medium)))
|
||||
{
|
||||
CIDA* pida = (CIDA*)GlobalLock(medium.hGlobal);
|
||||
if (!pida)
|
||||
{
|
||||
ReleaseStgMedium(&medium);
|
||||
return;
|
||||
}
|
||||
|
||||
ITEMIDLIST* pidlFolder = (ITEMIDLIST*)((BYTE*)pida + pida->aoffset[0]);
|
||||
ITEMIDLIST* pidlItem = (ITEMIDLIST*)((BYTE*)pida + pida->aoffset[1]);
|
||||
PIDLIST_ABSOLUTE pidlFull = ILCombine(pidlFolder, pidlItem);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
ReleaseStgMedium(&medium);
|
||||
|
||||
if (!pidlFull)
|
||||
return;
|
||||
|
||||
// Convert to IShellItem to get canonical parsing path
|
||||
CComPtr<IShellItem> shellItem;
|
||||
if (SUCCEEDED(SHCreateItemFromIDList(pidlFull, IID_PPV_ARGS(&shellItem))))
|
||||
{
|
||||
PWSTR pszPath = nullptr;
|
||||
if (SUCCEEDED(shellItem->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, &pszPath)))
|
||||
{
|
||||
StringCchCopyW(buffer, MAX_PATH_EX, pszPath); // returns e.g., ::{645FF040-5081-101B-9F08-00AA002F954E}
|
||||
CoTaskMemFree(pszPath);
|
||||
}
|
||||
}
|
||||
|
||||
ILFree(pidlFull);
|
||||
}
|
||||
WCHAR localBuffer[MAX_PATH] = { '\0' };
|
||||
DragQueryFile(HDROP(medium.hGlobal), 0, localBuffer, MAX_PATH);
|
||||
|
||||
GetLongPathName(localBuffer, buffer, MAX_PATH_EX);
|
||||
}
|
||||
|
||||
bool HelperMethods::IsListaryToolbarVisible()
|
||||
{
|
||||
auto CALLBACK findListaryWindowProc = [](__in HWND hwnd, __in LPARAM lParam)-> BOOL
|
||||
{
|
||||
WCHAR classBuffer[MAX_PATH] = {'\0'};
|
||||
if (FAILED(GetClassName(hwnd, classBuffer, MAX_PATH)))
|
||||
return TRUE;
|
||||
auto CALLBACK findListaryWindowProc = [](__in HWND hwnd, __in LPARAM lParam)-> BOOL
|
||||
{
|
||||
WCHAR classBuffer[MAX_PATH] = {'\0'};
|
||||
if (FAILED(GetClassName(hwnd, classBuffer, MAX_PATH)))
|
||||
return TRUE;
|
||||
|
||||
if (wcsncmp(classBuffer, L"Listary_WidgetWin_", 18) == 0)
|
||||
{
|
||||
if (IsWindowVisible(hwnd))
|
||||
{
|
||||
*reinterpret_cast<bool*>(lParam) = true;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
};
|
||||
if (wcsncmp(classBuffer, L"Listary_WidgetWin_", 18) == 0)
|
||||
{
|
||||
if (IsWindowVisible(hwnd))
|
||||
{
|
||||
*reinterpret_cast<bool*>(lParam) = true;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
auto found = false;
|
||||
EnumWindows(findListaryWindowProc, reinterpret_cast<LPARAM>(&found));
|
||||
auto found = false;
|
||||
EnumWindows(findListaryWindowProc, reinterpret_cast<LPARAM>(&found));
|
||||
|
||||
return found;
|
||||
return found;
|
||||
}
|
||||
|
||||
// Windows 10 1909 replaced the search box in the File Explorer by a UWP control.
|
||||
// gti.flags is always 0 for UWP applications.
|
||||
bool HelperMethods::IsExplorerSearchBoxFocused()
|
||||
{
|
||||
auto* hwnd = GetFocusedControl();
|
||||
auto* hwnd = GetFocusedControl();
|
||||
|
||||
WCHAR classBuffer[MAX_PATH] = { '\0' };
|
||||
if (FAILED(GetClassName(hwnd, classBuffer, MAX_PATH)))
|
||||
return false;
|
||||
WCHAR classBuffer[MAX_PATH] = { '\0' };
|
||||
if (FAILED(GetClassName(hwnd, classBuffer, MAX_PATH)))
|
||||
return false;
|
||||
|
||||
return wcscmp(classBuffer, L"Windows.UI.Core.CoreWindow") == 0;
|
||||
return wcscmp(classBuffer, L"Windows.UI.Core.CoreWindow") == 0;
|
||||
}
|
||||
|
||||
bool HelperMethods::IsCursorActivated(HWND hwnd)
|
||||
{
|
||||
auto tId = GetWindowThreadProcessId(hwnd, nullptr);
|
||||
auto tId = GetWindowThreadProcessId(hwnd, nullptr);
|
||||
|
||||
GUITHREADINFO gti = { sizeof gti };
|
||||
GetGUIThreadInfo(tId, >i);
|
||||
GUITHREADINFO gti = { sizeof gti };
|
||||
GetGUIThreadInfo(tId, >i);
|
||||
|
||||
return gti.flags || gti.hwndCaret || IsListaryToolbarVisible();
|
||||
return gti.flags || gti.hwndCaret || IsListaryToolbarVisible();
|
||||
}
|
||||
|
||||
bool HelperMethods::IsUWP()
|
||||
{
|
||||
auto pGCPFN = decltype(&GetCurrentPackageFullName)(
|
||||
GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetCurrentPackageFullName"));
|
||||
auto pGCPFN = decltype(&GetCurrentPackageFullName)(
|
||||
GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetCurrentPackageFullName"));
|
||||
|
||||
if (!pGCPFN)
|
||||
return false;
|
||||
if (!pGCPFN)
|
||||
return false;
|
||||
|
||||
UINT32 pn = 0;
|
||||
return pGCPFN(&pn, nullptr) == ERROR_INSUFFICIENT_BUFFER;
|
||||
UINT32 pn = 0;
|
||||
return pGCPFN(&pn, nullptr) == ERROR_INSUFFICIENT_BUFFER;
|
||||
}
|
||||
|
||||
HWND HelperMethods::GetFocusedControl()
|
||||
{
|
||||
auto tid = GetWindowThreadProcessId(GetForegroundWindow(), nullptr);
|
||||
auto tid = GetWindowThreadProcessId(GetForegroundWindow(), nullptr);
|
||||
|
||||
if (0 == AttachThreadInput(GetCurrentThreadId(), tid, TRUE))
|
||||
return nullptr;
|
||||
if (0 == AttachThreadInput(GetCurrentThreadId(), tid, TRUE))
|
||||
return nullptr;
|
||||
|
||||
auto* hwnd = GetFocus();
|
||||
auto* hwnd = GetFocus();
|
||||
|
||||
AttachThreadInput(GetCurrentThreadId(), tid, FALSE);
|
||||
AttachThreadInput(GetCurrentThreadId(), tid, FALSE);
|
||||
|
||||
return hwnd;
|
||||
return hwnd;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -19,13 +19,13 @@
|
||||
class HelperMethods
|
||||
{
|
||||
public:
|
||||
static void GetSelectedInternal(CComPtr<IShellBrowser> psb, PWCHAR buffer);
|
||||
static void ObtainFirstItem(CComPtr<IDataObject> dao, PWCHAR buffer);
|
||||
static bool IsCursorActivated(HWND hwndfg);
|
||||
static bool IsExplorerSearchBoxFocused();
|
||||
static bool HelperMethods::IsUWP();
|
||||
static void GetSelectedInternal(CComPtr<IShellBrowser> psb, PWCHAR buffer);
|
||||
static void ObtainFirstItem(CComPtr<IDataObject> dao, PWCHAR buffer);
|
||||
static bool IsCursorActivated(HWND hwndfg);
|
||||
static bool IsExplorerSearchBoxFocused();
|
||||
static bool HelperMethods::IsUWP();
|
||||
|
||||
private:
|
||||
static bool IsListaryToolbarVisible();
|
||||
static HWND GetFocusedControl();
|
||||
static bool IsListaryToolbarVisible();
|
||||
static HWND GetFocusedControl();
|
||||
};
|
||||
|
@@ -1,5 +1,3 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
@@ -29,9 +27,9 @@ void MultiCommander::GetSelected(PWCHAR buffer)
|
||||
}
|
||||
|
||||
COPYDATASTRUCT cds;
|
||||
cds.dwData = MULTICMD_CPF_GETCURITEMFULL | MULTICMD_CPF_SOURCE;
|
||||
cds.cbData = 0;
|
||||
cds.lpData = nullptr;
|
||||
cds.dwData = MULTICMD_CPF_GETCURITEMFULL | MULTICMD_CPF_SOURCE;
|
||||
cds.cbData = 0;
|
||||
cds.lpData = nullptr;
|
||||
|
||||
ResetEvent(hGetResultEvent);
|
||||
|
||||
@@ -39,12 +37,12 @@ void MultiCommander::GetSelected(PWCHAR buffer)
|
||||
FindWindow(MULTICMD_CLASS, nullptr),
|
||||
WM_COPYDATA,
|
||||
reinterpret_cast<WPARAM>(hMsgWnd),
|
||||
reinterpret_cast<LPARAM>(&cds)
|
||||
reinterpret_cast<LPARAM>(&cds)
|
||||
);
|
||||
|
||||
if (!ret || WAIT_OBJECT_0 != WaitForSingleObject(hGetResultEvent, 2000)) {
|
||||
if (!ret || WAIT_OBJECT_0 != WaitForSingleObject(hGetResultEvent, 2000)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto path = reinterpret_cast<PWCHAR>(pCurrentItemPath);
|
||||
wcscpy_s(buffer, wcslen(path) + 1, path);
|
||||
@@ -80,21 +78,21 @@ bool MultiCommander::PrepareMessageWindow()
|
||||
LRESULT CALLBACK MultiCommander::msgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_COPYDATA:
|
||||
{
|
||||
{
|
||||
case WM_COPYDATA:
|
||||
{
|
||||
delete[] pCurrentItemPath;
|
||||
|
||||
auto cds = reinterpret_cast<PCOPYDATASTRUCT>(lParam);
|
||||
auto buf = static_cast<PCHAR>(cds->lpData);
|
||||
auto cds = reinterpret_cast<PCOPYDATASTRUCT>(lParam);
|
||||
auto buf = static_cast<PCHAR>(cds->lpData);
|
||||
|
||||
pCurrentItemPath = new CHAR[cds->cbData + 1]{ '\0' };
|
||||
memcpy(pCurrentItemPath, buf, cds->cbData);
|
||||
pCurrentItemPath = new CHAR[cds->cbData + 1]{ '\0' };
|
||||
memcpy(pCurrentItemPath, buf, cds->cbData);
|
||||
|
||||
SetEvent(hGetResultEvent);
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
}
|
||||
default:
|
||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,3 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
@@ -26,13 +24,13 @@
|
||||
class MultiCommander
|
||||
{
|
||||
public:
|
||||
static void GetSelected(PWCHAR buffer);
|
||||
static void GetSelected(PWCHAR buffer);
|
||||
static bool PrepareMessageWindow();
|
||||
MultiCommander() = delete;
|
||||
private:
|
||||
static HWND hMsgWnd;
|
||||
static HANDLE hGetResultEvent;
|
||||
static PCHAR pCurrentItemPath;
|
||||
static HANDLE hGetResultEvent;
|
||||
static PCHAR pCurrentItemPath;
|
||||
|
||||
static LRESULT CALLBACK msgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -28,157 +28,157 @@ using namespace std;
|
||||
|
||||
Shell32::FocusedWindowType Shell32::GetFocusedWindowType()
|
||||
{
|
||||
auto hwndfg = GetForegroundWindow();
|
||||
auto hwndfg = GetForegroundWindow();
|
||||
|
||||
if (HelperMethods::IsCursorActivated(hwndfg))
|
||||
return INVALID;
|
||||
if (HelperMethods::IsCursorActivated(hwndfg))
|
||||
return INVALID;
|
||||
|
||||
WCHAR classBuffer[MAX_PATH] = { '\0' };
|
||||
if (FAILED(GetClassName(hwndfg, classBuffer, MAX_PATH)))
|
||||
return INVALID;
|
||||
WCHAR classBuffer[MAX_PATH] = { '\0' };
|
||||
if (FAILED(GetClassName(hwndfg, classBuffer, MAX_PATH)))
|
||||
return INVALID;
|
||||
|
||||
if (wcscmp(classBuffer, MULTICMD_CLASS) == 0)
|
||||
{
|
||||
return MULTICOMMANDER;
|
||||
}
|
||||
if (wcscmp(classBuffer, L"dopus.lister") == 0)
|
||||
{
|
||||
return DOPUS;
|
||||
}
|
||||
if (Everything::MatchClass(classBuffer))
|
||||
{
|
||||
return EVERYTHING;
|
||||
}
|
||||
if (wcscmp(classBuffer, L"WorkerW") == 0 || wcscmp(classBuffer, L"Progman") == 0)
|
||||
{
|
||||
if (FindWindowEx(hwndfg, nullptr, L"SHELLDLL_DefView", nullptr) != nullptr)
|
||||
{
|
||||
return DESKTOP;
|
||||
}
|
||||
}
|
||||
if (wcscmp(classBuffer, L"ExploreWClass") == 0 || wcscmp(classBuffer, L"CabinetWClass") == 0)
|
||||
{
|
||||
if (!HelperMethods::IsExplorerSearchBoxFocused())
|
||||
{
|
||||
return EXPLORER;
|
||||
}
|
||||
}
|
||||
if (wcscmp(classBuffer, L"#32770") == 0)
|
||||
{
|
||||
if (FindWindowEx(hwndfg, nullptr, L"DUIViewWndClassName", nullptr) != nullptr)
|
||||
{
|
||||
if (!HelperMethods::IsExplorerSearchBoxFocused())
|
||||
{
|
||||
return DIALOG;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wcscmp(classBuffer, L"dopus.lister") == 0)
|
||||
{
|
||||
return DOPUS;
|
||||
}
|
||||
if (Everything::MatchClass(classBuffer))
|
||||
{
|
||||
return EVERYTHING;
|
||||
}
|
||||
if (wcscmp(classBuffer, L"WorkerW") == 0 || wcscmp(classBuffer, L"Progman") == 0)
|
||||
{
|
||||
if (FindWindowEx(hwndfg, nullptr, L"SHELLDLL_DefView", nullptr) != nullptr)
|
||||
{
|
||||
return DESKTOP;
|
||||
}
|
||||
}
|
||||
if (wcscmp(classBuffer, L"ExploreWClass") == 0 || wcscmp(classBuffer, L"CabinetWClass") == 0)
|
||||
{
|
||||
if (!HelperMethods::IsExplorerSearchBoxFocused())
|
||||
{
|
||||
return EXPLORER;
|
||||
}
|
||||
}
|
||||
if (wcscmp(classBuffer, L"#32770") == 0)
|
||||
{
|
||||
if (FindWindowEx(hwndfg, nullptr, L"DUIViewWndClassName", nullptr) != nullptr)
|
||||
{
|
||||
if (!HelperMethods::IsExplorerSearchBoxFocused())
|
||||
{
|
||||
return DIALOG;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return INVALID;
|
||||
return INVALID;
|
||||
}
|
||||
|
||||
void Shell32::GetCurrentSelection(PWCHAR buffer)
|
||||
{
|
||||
switch (GetFocusedWindowType())
|
||||
{
|
||||
case DESKTOP:
|
||||
getSelectedFromDesktop(buffer);
|
||||
break;
|
||||
case EXPLORER:
|
||||
getSelectedFromExplorer(buffer);
|
||||
break;
|
||||
case DIALOG:
|
||||
DialogHook::GetSelected(buffer);
|
||||
break;
|
||||
case EVERYTHING:
|
||||
Everything::GetSelected(buffer);
|
||||
break;
|
||||
case DOPUS:
|
||||
DOpus::GetSelected(buffer);
|
||||
break;
|
||||
switch (GetFocusedWindowType())
|
||||
{
|
||||
case DESKTOP:
|
||||
getSelectedFromDesktop(buffer);
|
||||
break;
|
||||
case EXPLORER:
|
||||
getSelectedFromExplorer(buffer);
|
||||
break;
|
||||
case DIALOG:
|
||||
DialogHook::GetSelected(buffer);
|
||||
break;
|
||||
case EVERYTHING:
|
||||
Everything::GetSelected(buffer);
|
||||
break;
|
||||
case DOPUS:
|
||||
DOpus::GetSelected(buffer);
|
||||
break;
|
||||
case MULTICOMMANDER:
|
||||
MultiCommander::GetSelected(buffer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Shell32::getSelectedFromExplorer(PWCHAR buffer)
|
||||
{
|
||||
CoInitialize(nullptr);
|
||||
CoInitialize(nullptr);
|
||||
|
||||
CComPtr<IShellWindows> psw;
|
||||
if (FAILED(psw.CoCreateInstance(CLSID_ShellWindows)))
|
||||
return;
|
||||
CComPtr<IShellWindows> psw;
|
||||
if (FAILED(psw.CoCreateInstance(CLSID_ShellWindows)))
|
||||
return;
|
||||
|
||||
auto hwndfgw = GetForegroundWindow();
|
||||
auto hwndfgt = FindWindowEx(hwndfgw, nullptr, L"ShellTabWindowClass", nullptr);
|
||||
auto hwndfgw = GetForegroundWindow();
|
||||
auto hwndfgt = FindWindowEx(hwndfgw, nullptr, L"ShellTabWindowClass", nullptr);
|
||||
|
||||
auto count = 0L;
|
||||
psw->get_Count(&count);
|
||||
auto count = 0L;
|
||||
psw->get_Count(&count);
|
||||
|
||||
for (auto i = 0; i < count; i++)
|
||||
{
|
||||
VARIANT vi;
|
||||
VariantInit(&vi);
|
||||
V_VT(&vi) = VT_I4;
|
||||
V_I4(&vi) = i;
|
||||
for (auto i = 0; i < count; i++)
|
||||
{
|
||||
VARIANT vi;
|
||||
VariantInit(&vi);
|
||||
V_VT(&vi) = VT_I4;
|
||||
V_I4(&vi) = i;
|
||||
|
||||
CComPtr<IDispatch> pdisp;
|
||||
if (S_OK != psw->Item(vi, &pdisp))
|
||||
continue;
|
||||
CComPtr<IDispatch> pdisp;
|
||||
if (S_OK != psw->Item(vi, &pdisp))
|
||||
continue;
|
||||
|
||||
CComPtr<IServiceProvider> psp;
|
||||
if (FAILED(pdisp->QueryInterface(IID_IServiceProvider, reinterpret_cast<void**>(&psp))))
|
||||
continue;
|
||||
CComPtr<IServiceProvider> psp;
|
||||
if (FAILED(pdisp->QueryInterface(IID_IServiceProvider, reinterpret_cast<void**>(&psp))))
|
||||
continue;
|
||||
|
||||
CComPtr<IShellBrowser> psb;
|
||||
if (FAILED(psp->QueryService(IID_IShellBrowser, IID_IShellBrowser, reinterpret_cast<LPVOID*>(&psb))))
|
||||
continue;
|
||||
CComPtr<IShellBrowser> psb;
|
||||
if (FAILED(psp->QueryService(IID_IShellBrowser, IID_IShellBrowser, reinterpret_cast<LPVOID*>(&psb))))
|
||||
continue;
|
||||
|
||||
HWND phwnd;
|
||||
if (FAILED(psb->GetWindow(&phwnd)))
|
||||
continue;
|
||||
HWND phwnd;
|
||||
if (FAILED(psb->GetWindow(&phwnd)))
|
||||
continue;
|
||||
|
||||
if (hwndfgw != phwnd && (hwndfgt != nullptr && hwndfgt != phwnd))
|
||||
continue;
|
||||
if (hwndfgw != phwnd && (hwndfgt != nullptr && hwndfgt != phwnd))
|
||||
continue;
|
||||
|
||||
if (HelperMethods::IsCursorActivated(0))
|
||||
continue;
|
||||
if (HelperMethods::IsCursorActivated(0))
|
||||
continue;
|
||||
|
||||
HelperMethods::GetSelectedInternal(psb, buffer);
|
||||
return;
|
||||
}
|
||||
HelperMethods::GetSelectedInternal(psb, buffer);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Shell32::getSelectedFromDesktop(PWCHAR buffer)
|
||||
{
|
||||
CoInitialize(nullptr);
|
||||
CoInitialize(nullptr);
|
||||
|
||||
CComPtr<IShellWindows> psw;
|
||||
CComPtr<IWebBrowserApp> pwba;
|
||||
CComPtr<IShellWindows> psw;
|
||||
CComPtr<IWebBrowserApp> pwba;
|
||||
|
||||
if (FAILED(psw.CoCreateInstance(CLSID_ShellWindows)))
|
||||
return;
|
||||
if (FAILED(psw.CoCreateInstance(CLSID_ShellWindows)))
|
||||
return;
|
||||
|
||||
VARIANT pvarLoc;
|
||||
VariantInit(&pvarLoc);
|
||||
long phwnd;
|
||||
if (FAILED(psw->FindWindowSW(&pvarLoc, &pvarLoc, SWC_DESKTOP, &phwnd, SWFO_NEEDDISPATCH, reinterpret_cast<IDispatch**>(
|
||||
&pwba))))
|
||||
return;
|
||||
VARIANT pvarLoc;
|
||||
VariantInit(&pvarLoc);
|
||||
long phwnd;
|
||||
if (FAILED(psw->FindWindowSW(&pvarLoc, &pvarLoc, SWC_DESKTOP, &phwnd, SWFO_NEEDDISPATCH, reinterpret_cast<IDispatch**>(
|
||||
&pwba))))
|
||||
return;
|
||||
|
||||
if (HelperMethods::IsCursorActivated(reinterpret_cast<HWND>(LongToHandle(phwnd))))
|
||||
return;
|
||||
if (HelperMethods::IsCursorActivated(reinterpret_cast<HWND>(LongToHandle(phwnd))))
|
||||
return;
|
||||
|
||||
CComPtr<IServiceProvider> psp;
|
||||
if (FAILED(pwba->QueryInterface(IID_IServiceProvider, reinterpret_cast<void**>(&psp))))
|
||||
return;
|
||||
CComPtr<IServiceProvider> psp;
|
||||
if (FAILED(pwba->QueryInterface(IID_IServiceProvider, reinterpret_cast<void**>(&psp))))
|
||||
return;
|
||||
|
||||
CComPtr<IShellBrowser> psb;
|
||||
if (FAILED(psp->QueryService(IID_IShellBrowser, IID_IShellBrowser, reinterpret_cast<LPVOID*>(&psb))))
|
||||
return;
|
||||
CComPtr<IShellBrowser> psb;
|
||||
if (FAILED(psp->QueryService(IID_IShellBrowser, IID_IShellBrowser, reinterpret_cast<LPVOID*>(&psb))))
|
||||
return;
|
||||
|
||||
HelperMethods::GetSelectedInternal(psb, buffer);
|
||||
HelperMethods::GetSelectedInternal(psb, buffer);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -22,21 +22,21 @@
|
||||
class Shell32
|
||||
{
|
||||
public:
|
||||
enum FocusedWindowType
|
||||
{
|
||||
INVALID,
|
||||
DESKTOP,
|
||||
EXPLORER,
|
||||
DIALOG,
|
||||
EVERYTHING,
|
||||
DOPUS,
|
||||
enum FocusedWindowType
|
||||
{
|
||||
INVALID,
|
||||
DESKTOP,
|
||||
EXPLORER,
|
||||
DIALOG,
|
||||
EVERYTHING,
|
||||
DOPUS,
|
||||
MULTICOMMANDER,
|
||||
};
|
||||
};
|
||||
|
||||
static FocusedWindowType GetFocusedWindowType();
|
||||
static void GetCurrentSelection(PWCHAR buffer);
|
||||
static FocusedWindowType GetFocusedWindowType();
|
||||
static void GetCurrentSelection(PWCHAR buffer);
|
||||
|
||||
private:
|
||||
static void getSelectedFromDesktop(PWCHAR buffer);
|
||||
static void getSelectedFromExplorer(PWCHAR buffer);
|
||||
static void getSelectedFromDesktop(PWCHAR buffer);
|
||||
static void getSelectedFromExplorer(PWCHAR buffer);
|
||||
};
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -27,54 +27,54 @@ HANDLE hJob = nullptr;
|
||||
|
||||
bool WoW64HookHelper::CheckStatus()
|
||||
{
|
||||
DWORD running = -1;
|
||||
GetExitCodeProcess(hHelper, &running);
|
||||
return running == STILL_ACTIVE;
|
||||
DWORD running = -1;
|
||||
GetExitCodeProcess(hHelper, &running);
|
||||
return running == STILL_ACTIVE;
|
||||
}
|
||||
|
||||
bool WoW64HookHelper::Launch()
|
||||
{
|
||||
#ifndef WIN64
|
||||
return true;
|
||||
return true;
|
||||
#endif
|
||||
|
||||
if (HelperMethods::IsUWP())
|
||||
return true;
|
||||
if (HelperMethods::IsUWP())
|
||||
return true;
|
||||
|
||||
if (CheckStatus())
|
||||
return true;
|
||||
if (CheckStatus())
|
||||
return true;
|
||||
|
||||
createJob();
|
||||
createJob();
|
||||
|
||||
WCHAR fullPath[MAX_PATH] = {'\0'};
|
||||
GetModuleFileName(nullptr, fullPath, MAX_PATH - 1);
|
||||
auto p = wcsrchr(fullPath, L'\\');
|
||||
memcpy(p, HELPER_FILE, wcslen(HELPER_FILE) * sizeof WCHAR);
|
||||
WCHAR fullPath[MAX_PATH] = {'\0'};
|
||||
GetModuleFileName(nullptr, fullPath, MAX_PATH - 1);
|
||||
auto p = wcsrchr(fullPath, L'\\');
|
||||
memcpy(p, HELPER_FILE, wcslen(HELPER_FILE) * sizeof WCHAR);
|
||||
|
||||
STARTUPINFO si = {sizeof si};
|
||||
PROCESS_INFORMATION pi = {nullptr};
|
||||
si.cb = sizeof si;
|
||||
STARTUPINFO si = {sizeof si};
|
||||
PROCESS_INFORMATION pi = {nullptr};
|
||||
si.cb = sizeof si;
|
||||
|
||||
CreateProcess(fullPath, RUN_ARG, nullptr, nullptr, false, 0, nullptr, nullptr, &si, &pi);
|
||||
hHelper = pi.hProcess;
|
||||
CreateProcess(fullPath, RUN_ARG, nullptr, nullptr, false, 0, nullptr, nullptr, &si, &pi);
|
||||
hHelper = pi.hProcess;
|
||||
|
||||
AssignProcessToJobObject(hJob, hHelper);
|
||||
AssignProcessToJobObject(hJob, hHelper);
|
||||
|
||||
return CheckStatus();
|
||||
return CheckStatus();
|
||||
}
|
||||
|
||||
void WoW64HookHelper::createJob()
|
||||
{
|
||||
if (hJob != nullptr)
|
||||
return;
|
||||
if (hJob != nullptr)
|
||||
return;
|
||||
|
||||
hJob = CreateJobObject(nullptr, nullptr);
|
||||
hJob = CreateJobObject(nullptr, nullptr);
|
||||
|
||||
JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation = {sizeof BasicLimitInformation};
|
||||
BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
|
||||
JOBOBJECT_EXTENDED_LIMIT_INFORMATION lpJobObjectInfo = {sizeof lpJobObjectInfo};
|
||||
lpJobObjectInfo.BasicLimitInformation = BasicLimitInformation;
|
||||
JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation = {sizeof BasicLimitInformation};
|
||||
BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
|
||||
JOBOBJECT_EXTENDED_LIMIT_INFORMATION lpJobObjectInfo = {sizeof lpJobObjectInfo};
|
||||
lpJobObjectInfo.BasicLimitInformation = BasicLimitInformation;
|
||||
|
||||
SetInformationJobObject(hJob, JobObjectExtendedLimitInformation, &lpJobObjectInfo,
|
||||
sizeof JOBOBJECT_EXTENDED_LIMIT_INFORMATION);
|
||||
SetInformationJobObject(hJob, JobObjectExtendedLimitInformation, &lpJobObjectInfo,
|
||||
sizeof JOBOBJECT_EXTENDED_LIMIT_INFORMATION);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -22,14 +22,14 @@
|
||||
class WoW64HookHelper
|
||||
{
|
||||
public:
|
||||
static PWCHAR GetMsgWindowClassName()
|
||||
{
|
||||
return L"QUICKLOOK_WOW64HOOKHELPER_MSG_CLASS";
|
||||
}
|
||||
static PWCHAR GetMsgWindowClassName()
|
||||
{
|
||||
return L"QUICKLOOK_WOW64HOOKHELPER_MSG_CLASS";
|
||||
}
|
||||
|
||||
static bool CheckStatus();
|
||||
static bool Launch();
|
||||
static bool CheckStatus();
|
||||
static bool Launch();
|
||||
|
||||
private:
|
||||
static void createJob();
|
||||
static void createJob();
|
||||
};
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -20,14 +20,14 @@
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -38,67 +38,67 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
{
|
||||
// do not run when double-clicking
|
||||
if (wcsstr(GetCommandLine(), RUN_ARG) == nullptr)
|
||||
{
|
||||
MessageBox(nullptr, L"This executable is not designed to launch directly.", L"QuickLook.WoW64HookHelper", 0);
|
||||
return 0;
|
||||
}
|
||||
// do not run when double-clicking
|
||||
if (wcsstr(GetCommandLine(), RUN_ARG) == nullptr)
|
||||
{
|
||||
MessageBox(nullptr, L"This executable is not designed to launch directly.", L"QuickLook.WoW64HookHelper", 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pDll = LoadLibrary(L"QuickLook.Native32.dll");
|
||||
pGCS = reinterpret_cast<PGCS>(GetProcAddress(pDll, "GetCurrentSelection"));
|
||||
pDll = LoadLibrary(L"QuickLook.Native32.dll");
|
||||
pGCS = reinterpret_cast<PGCS>(GetProcAddress(pDll, "GetCurrentSelection"));
|
||||
|
||||
WM_HOOK_NOTIFY = RegisterWindowMessage(L"WM_QUICKLOOK_HOOK_NOTIFY_MSG");
|
||||
WM_HOOK_NOTIFY = RegisterWindowMessage(L"WM_QUICKLOOK_HOOK_NOTIFY_MSG");
|
||||
|
||||
WNDCLASS wc = {};
|
||||
wc.lpfnWndProc = WndProc;
|
||||
wc.lpszClassName = MSG_WINDOW_CLASS;
|
||||
if (!RegisterClass(&wc))
|
||||
return 0;
|
||||
WNDCLASS wc = {};
|
||||
wc.lpfnWndProc = WndProc;
|
||||
wc.lpszClassName = MSG_WINDOW_CLASS;
|
||||
if (!RegisterClass(&wc))
|
||||
return 0;
|
||||
|
||||
hMsgWindow = CreateWindow(MSG_WINDOW_CLASS, nullptr, 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr, nullptr, nullptr);
|
||||
if (hMsgWindow == nullptr)
|
||||
return 0;
|
||||
hMsgWindow = CreateWindow(MSG_WINDOW_CLASS, nullptr, 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr, nullptr, nullptr);
|
||||
if (hMsgWindow == nullptr)
|
||||
return 0;
|
||||
|
||||
MSG msg;
|
||||
while (GetMessage(&msg, nullptr, 0, 0) > 0)
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
return msg.wParam;
|
||||
MSG msg;
|
||||
while (GetMessage(&msg, nullptr, 0, 0) > 0)
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
return msg.wParam;
|
||||
}
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (msg == WM_HOOK_NOTIFY)
|
||||
{
|
||||
GetCurrentSelection();
|
||||
return 0;
|
||||
}
|
||||
return DefWindowProc(hwnd, msg, wParam, lParam);
|
||||
if (msg == WM_HOOK_NOTIFY)
|
||||
{
|
||||
GetCurrentSelection();
|
||||
return 0;
|
||||
}
|
||||
return DefWindowProc(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
void GetCurrentSelection()
|
||||
{
|
||||
// This function runs inside the target process. Some of them may already support Long Path.
|
||||
// Therefore, we must assume all of them support Long Path to avoid buffer overflow.
|
||||
WCHAR dllBuffer[MAX_PATH_EX] = {'\0'};
|
||||
pGCS(dllBuffer);
|
||||
// This function runs inside the target process. Some of them may already support Long Path.
|
||||
// Therefore, we must assume all of them support Long Path to avoid buffer overflow.
|
||||
WCHAR dllBuffer[MAX_PATH_EX] = {'\0'};
|
||||
pGCS(dllBuffer);
|
||||
|
||||
auto hMapFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, false, SHARED_MEM_NAME);
|
||||
if (hMapFile == nullptr)
|
||||
return;
|
||||
auto hMapFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, false, SHARED_MEM_NAME);
|
||||
if (hMapFile == nullptr)
|
||||
return;
|
||||
|
||||
auto buffer = static_cast<PWCHAR>(MapViewOfFile(hMapFile, FILE_MAP_WRITE, 0, 0, 0));
|
||||
if (buffer == nullptr)
|
||||
{
|
||||
CloseHandle(hMapFile);
|
||||
return;
|
||||
}
|
||||
auto buffer = static_cast<PWCHAR>(MapViewOfFile(hMapFile, FILE_MAP_WRITE, 0, 0, 0));
|
||||
if (buffer == nullptr)
|
||||
{
|
||||
CloseHandle(hMapFile);
|
||||
return;
|
||||
}
|
||||
|
||||
wcscpy_s(buffer, wcslen(dllBuffer) + 1, dllBuffer);
|
||||
wcscpy_s(buffer, wcslen(dllBuffer) + 1, dllBuffer);
|
||||
|
||||
UnmapViewOfFile(buffer);
|
||||
CloseHandle(hMapFile);
|
||||
UnmapViewOfFile(buffer);
|
||||
CloseHandle(hMapFile);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|