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

Commit

Permalink
Add missing method to create Target from Device
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
prasannavl authored Oct 10, 2016
1 parent aed636b commit 6221710
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Source/SharpDX.DirectComposition/Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,17 @@ public static Target FromHwnd(DesktopDevice desktopDevice, IntPtr hwnd, bool top
{
return desktopDevice.CreateTargetForHwnd(hwnd, topmost);
}

/// <summary>
/// Creates a composition target object that is bound to the window that is represented by the specified window handle.
/// </summary>
/// <param name="device">A device the target is to be associated with.</param>
/// <param name="hwnd">The window to which the composition object will be bound. This cannot be null.</param>
/// <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>
/// <returns></returns>
public static Target FromHwnd(Device device, IntPtr hwnd, bool topmost)
{
return device.CreateTargetForHwnd(hwnd, topmost);
}
}
}

0 comments on commit 6221710

Please sign in to comment.