Skip to content

Commit fc8f140

Browse files
committed
Fixed delayed image display
1 parent 5fbe49e commit fc8f140

5 files changed

Lines changed: 47 additions & 28 deletions

File tree

SvgShellExtensions.dll

-2.38 MB
Binary file not shown.

dll_binary/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SvgShellExtensions.dll
2+
3+
4+
Windows (64bit) Explorer Shell Extensions for SVG files
5+
Preview Handler and Thumbnail Provider
6+
7+
----------
8+
Install:
9+
----------
10+
11+
1. Right click Windows' Start Button<br>
12+
2. Select Windows PowerShell (Admin)<br>
13+
In Windows PowerShell ...<br>
14+
**cd** path_to_SvgShellExtensions<br>
15+
**regsvr32** SvgShellExtensions.dll<br>
16+
exit<br><br>
17+
18+
----------
19+
Uninstall:
20+
----------
21+
22+
1. Right click Windows' Start Button<br>
23+
2. Select Windows PowerShell (Admin)<br>
24+
In Windows PowerShell ...<br>
25+
**cd** path_to_SvgShellExtensions<br>
26+
**regsvr32 /u** SvgShellExtensions.dll<br>
27+
exit<br><br>
28+
29+
----------
30+
31+
32+
![Preview](https://user-images.githubusercontent.com/5280692/150119503-11700028-4dcf-4eca-aeaf-a787c4339a28.png)
33+
34+
![Thumbnail](https://user-images.githubusercontent.com/5280692/150119536-2b499495-f0dd-42e8-9e99-367657e3d783.png)
35+
36+
37+

dll_binary/SvgShellExtensions.dll

2.39 MB
Binary file not shown.

install tips.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.

source/SvgPreview.pas

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ function TSvgShellExt.DoPreview: HRESULT;
259259
if fSvgRead.IsEmpty then Exit;
260260

261261
//create the display dialog containing an image control
262-
fDialog := CreateDialog(hInstance,
263-
MAKEINTRESOURCE(1), fParent, @DlgProc);
262+
fDialog := CreateDialog(hInstance, MAKEINTRESOURCE(1), fParent, @DlgProc);
264263
SetWindowLongPtr(fDialog, GWLP_USERDATA, NativeInt(self));
265264
if fDarkModeEnabled then
266265
fDarkBrush := CreateSolidBrush(darkBkColor);
@@ -379,10 +378,18 @@ procedure LoadFonts;
379378
end;
380379
//------------------------------------------------------------------------------
381380

381+
var
382+
res: HRESULT;
383+
382384
initialization
383-
LoadFonts; //needed when displaying SVG text
385+
res := OleInitialize(nil);
384386

387+
LoadFonts; //needed when displaying SVG text
385388
TComObjectFactory.Create(ComServer,
386389
TSvgShellExt, IID_EXT_ShellExtensions,
387390
appId, appDescription, ciMultiInstance, tmApartment);
391+
392+
finalization
393+
if res = S_OK then OleUninitialize();
394+
388395
end.

0 commit comments

Comments
 (0)