I want to tile C# winforms but it seems that the .Net framework does not support this. So I used the Win32 function TileWindows. Here's the code:
GCHandle gcHandle = GCHandle.Alloc(handles, GCHandleType.Pinned);
IntPtr arrayHandle = gcHandle.AddrOfPinnedObject();
TileWindows(IntPtr.Zero,
(uint)(Tile.Vertical | Tile.SkipDisabled),
IntPtr.Zero,
(uint)handles.Length, ref arrayHandle);
gcHandle.Free();
handles is the array of winforms handles and Tile is just an enum of uints. The problem is after calling this function all of the open windows on my dekstop is affected instead of the passed array handles. Any suggestions?