Original: C # WPF keeps your window pinned to the desktop
IntPtr hWnd = new Windowinterophelper (Application.Current.MainWindow). Handle; IntPtr Hwndprogman = FindWindow ("ProgMan", "program Manager"); SetParent (HWnd, Hwndprogman);
[DllImport ("user32.dll", SetLastError = True)] static extern int SetWindowLong (IntPtr hWnd, int nIndex, IntPtr dwnewlong); [DllImport ("user32.dll", SetLastError = True)] static extern IntPtr FindWindow (string lpwindowclass, String lpwindowname); [DllImport ("user32.dll", SetLastError = True)] static extern IntPtr FindWindowEx (IntPtr parenthandle, IntPtr childafter, String className, String windowtitle); const int gwl_hwndparent =-8; [DllImport ("User32.dll")] static extern IntPtr SetParent (IntPtr hwndchild, IntPtr hwndnewparent);
var handle = new Windowinterophelper (Application.Current.MainWindow). Handle; IntPtr Hprog = FindWindowEx ( FindWindowEx ( FindWindow ("ProgMan", "program Manager"), IntPtr.Zero, " Shelldll_defview "," " ), IntPtr.Zero," SysListView32 "," Folderview " ); SetWindowLong (handle, Gwl_hwndparent, Hprog);
C # WPF keeps your window pinned to the desktop