一旦应用程序现在被用作父应用程序,您将如何将其从窗体中分离出来?
[DllImport("user32.dll")]
public static extern int SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("coredll.dll", SetLastError = true)]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("coredll.dll", SetLastError = true)]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
SetParent(setter, this.panel1.Handle);为了解锁,我尝试了SetParent(setter,setter);,但没有成功。
发布于 2016-05-17 22:12:34
我知道这很晚了,但是我能够传入0来从父母那里解开:
SetParent(process.MainWindowHandle, IntPtr.Zero);这会将桌面窗口设置为新的父窗口。
发布于 2013-03-04 14:32:34
SetParent返回上一个父窗口句柄。要“解锁”窗口,您应该能够使用最初得到的句柄调用SetParent。
https://stackoverflow.com/questions/15195376
复制相似问题