[PreviewPane]Fix crash on 64 bit file handles (#32826)

* [PreviewPane] Parse input window handle as IntPtr type instead of Int32

* [PreviewPane] Apply IntPtr arg parser fix for the following handlers:
GcodePreviewHandler
MarkdownPreviewHandler
PdfPreviewHandler
QoiPreviewHandler
SvgPreviewHandler
This commit is contained in:
z4pf1sh
2024-06-03 20:17:40 +08:00
committed by GitHub
parent 4558d2e01b
commit e993ea3c64
6 changed files with 12 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Qoi
if (args.Length == 6)
{
string filePath = args[0];
int hwnd = Convert.ToInt32(args[1], 16);
IntPtr hwnd = IntPtr.Parse(args[1], NumberStyles.HexNumber, CultureInfo.InvariantCulture);
int left = Convert.ToInt32(args[2], 10);
int right = Convert.ToInt32(args[3], 10);
@@ -36,7 +36,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Qoi
Rectangle s = new Rectangle(left, top, right - left, bottom - top);
_previewHandlerControl = new QoiPreviewHandlerControl();
_previewHandlerControl.SetWindow((IntPtr)hwnd, s);
_previewHandlerControl.SetWindow(hwnd, s);
_previewHandlerControl.DoPreview(filePath);
NativeEventWaiter.WaitForEventLoop(