From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
WPFProject/Utils/Win32Helper.cs | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/WPFProject/Utils/Win32Helper.cs b/WPFProject/Utils/Win32Helper.cs
new file mode 100644
index 0000000..974a69a
--- /dev/null
+++ b/WPFProject/Utils/Win32Helper.cs
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Windows;
+using System.Windows.Interop;
+
+namespace WPFProject.Utils
+{
+ public class Win32Helper
+ {
+ [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetParent")]
+ public extern static IntPtr SetParent(IntPtr childPtr, IntPtr parentPtr);
+
+
+ public static IntPtr SetParentForWPF(Window child, Window parent)
+ {
+ WindowInteropHelper parentHelper = new WindowInteropHelper(parent);
+ WindowInteropHelper childHelper = new WindowInteropHelper(child);
+ child.Owner = parent;
+ return SetParent(childHelper.Handle, parentHelper.Handle);
+ }
+ }
+}
--
Gitblit v1.9.1