Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 6221710

Browse files
authored
Add missing method to create Target from Device
This is method is the only way to create a Target in Windows 8, which doesn't have `DesktopDevice`. And this method is unfortuately missing.
1 parent aed636b commit 6221710

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Source/SharpDX.DirectComposition/Target.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,17 @@ public static Target FromHwnd(DesktopDevice desktopDevice, IntPtr hwnd, bool top
1818
{
1919
return desktopDevice.CreateTargetForHwnd(hwnd, topmost);
2020
}
21+
22+
/// <summary>
23+
/// Creates a composition target object that is bound to the window that is represented by the specified window handle.
24+
/// </summary>
25+
/// <param name="device">A device the target is to be associated with.</param>
26+
/// <param name="hwnd">The window to which the composition object will be bound. This cannot be null.</param>
27+
/// <param name="topmost">TRUE if the visual tree should be displayed on top of the children of the window specified by the hwnd parameter; otherwise, the visual tree is displayed behind the children.</param>
28+
/// <returns></returns>
29+
public static Target FromHwnd(Device device, IntPtr hwnd, bool topmost)
30+
{
31+
return device.CreateTargetForHwnd(hwnd, topmost);
32+
}
2133
}
2234
}

0 commit comments

Comments
 (0)