[Feature request] sendmessage to QuickLook by WM_COPYDATA
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 24.7k
- Forks
- 1.3k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 1
Description
For all's convenience, please use English to fill this issue.
It would be better to call QuickLook by SendMessage, rather than create a new instance by QuickLook.exe <filename> or bridge.exe <filename> . Because the latter two get to launch exe first.
Is your feature request related to a problem? Please describe.
Sort of. I've tried using QuickLook.exe <filename> to preview many *.mhtml files (average size is about 5Mb) one by one using the shortcut defined by Autohotkey. There is appreant lagging and blink.
As you can see below, it takes about 2 seconds for the next mhtml file fully loaded.
Describe the solution you'd like
Allow user to call Quicklook by sending WM_COPYDATA.
And for Quicklook 's class name, it would be better to set it as permanant other than with a guid surfix.
HwndWrapper[QuickLook.exe;;1f7df3e4-cc2f-4886-937e-cecdc1dd0b7c]
Below is what I'd like to implement in Excel with VBA.
Option Explicit
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPtr
Public Type CopyDataStruct
dwData As LongPtr
cbData As Long
lpData As LongPtr
End Type
Private Const WM_COPYDATA = &H4A
Sub QuickLook()
Dim cds As CopyDataStruct, result As LongPtr
Dim hwndTC As LongPtr
Dim FileName As String
Dim wParam As Long
wParam = 0
hwndQC = FindWindow(QuickLookClass, QuickLookTitle)
FileName=Cells(1,1).Value
cds.dwData = xxx ' ????
cds.cbData = Len(FileName) * 2 + 2
cds.lpData = StrPtr(FileName)
result = SendMessage(hwndQC, WM_COPYDATA, wParam, cds)
End Sub
Describe alternatives you've considered
run by QuickLook.exe <filename> or bridge.exe <filename>
takes longer time.
Additional context
Add any other context or screenshots about the feature request here.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names QuickLook.exe, bridge.exe, FindWindow, SendMessage, and WM_COPYDATA but no source files or tests. Begin by locating the existing launch entry points and determine the message contract, stable class name, and filename behavior; done means Excel/VBA can invoke an existing QuickLook instance without launching another process.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100