HwndSource Constructors

Definition

Initializes a new instance of the HwndSource class.

Overloads

HwndSource(HwndSourceParameters)

Initializes a new instance of the HwndSource class by using a structure that contains the initial settings.

HwndSource(Int32, Int32, Int32, Int32, Int32, String, IntPtr)

Initializes a new instance of the HwndSource class with a specified class style, style, extended style, x-y position, name, and parent window.

HwndSource(Int32, Int32, Int32, Int32, Int32, Int32, Int32, String, IntPtr)

Initializes a new instance of the HwndSource class with a specified class style, style, extended style, x-y position, width, height, name, and parent window.

HwndSource(Int32, Int32, Int32, Int32, Int32, Int32, Int32, String, IntPtr, Boolean)

Initializes a new instance of the HwndSource class with a specified class style, style, extended style, x-y position, width, height, name, and parent window, and by specifying whether the window is autosized.

Remarks

Important

This method is not available in the Internet security zone.

HwndSource(HwndSourceParameters)

Initializes a new instance of the HwndSource class by using a structure that contains the initial settings.

C#
[System.Security.SecurityCritical]
public HwndSource(System.Windows.Interop.HwndSourceParameters parameters);
C#
public HwndSource(System.Windows.Interop.HwndSourceParameters parameters);

Parameters

parameters
HwndSourceParameters

A structure that contains the parameters that are required to create the window.

Attributes

Remarks

Important

This method is not available in the Internet security zone.

This constructor signature might be more convenient in certain situations, because the default structure contains some appropriate initial default values.

Important

If you use this signature, do not use the default HwndSourceParameters constructor to construct the HwndSourceParameters structure for the parameters value. You must use the HwndSourceParameters constructor that enables you to specify an initial window name. If you use the default HwndSourceParameters constructor and create an HwndSource with it, that HwndSource does not display because an initial window name is a construction requirement for the represented HWND.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

HwndSource(Int32, Int32, Int32, Int32, Int32, String, IntPtr)

Initializes a new instance of the HwndSource class with a specified class style, style, extended style, x-y position, name, and parent window.

C#
[System.Security.SecurityCritical]
public HwndSource(int classStyle, int style, int exStyle, int x, int y, string name, IntPtr parent);
C#
public HwndSource(int classStyle, int style, int exStyle, int x, int y, string name, IntPtr parent);

Parameters

classStyle
Int32

The Win32 class styles for the window.

style
Int32

The Win32 styles for the window.

exStyle
Int32

The extended Win32 styles for the window.

x
Int32

The position of the window's left edge.

y
Int32

The position of the window's upper edge.

name
String

The name of the window.

parent
IntPtr

The handle of the window's parent window.

Attributes

Remarks

Important

This method is not available in the Internet security zone.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

HwndSource(Int32, Int32, Int32, Int32, Int32, Int32, Int32, String, IntPtr)

Initializes a new instance of the HwndSource class with a specified class style, style, extended style, x-y position, width, height, name, and parent window.

C#
[System.Security.SecurityCritical]
public HwndSource(int classStyle, int style, int exStyle, int x, int y, int width, int height, string name, IntPtr parent);
C#
public HwndSource(int classStyle, int style, int exStyle, int x, int y, int width, int height, string name, IntPtr parent);

Parameters

classStyle
Int32

The Win32 class styles for the window.

style
Int32

The Win32 styles for the window.

exStyle
Int32

The extended Win32 styles for the window.

x
Int32

The position of the window's left edge.

y
Int32

The position of the window's upper edge.

width
Int32

The width of the window.

height
Int32

The height of the window.

name
String

The name of the window.

parent
IntPtr

The handle of the window's parent window.

Attributes

Remarks

Important

This method is not available in the Internet security zone.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

HwndSource(Int32, Int32, Int32, Int32, Int32, Int32, Int32, String, IntPtr, Boolean)

Initializes a new instance of the HwndSource class with a specified class style, style, extended style, x-y position, width, height, name, and parent window, and by specifying whether the window is autosized.

C#
[System.Security.SecurityCritical]
public HwndSource(int classStyle, int style, int exStyle, int x, int y, int width, int height, string name, IntPtr parent, bool adjustSizingForNonClientArea);
C#
public HwndSource(int classStyle, int style, int exStyle, int x, int y, int width, int height, string name, IntPtr parent, bool adjustSizingForNonClientArea);

Parameters

classStyle
Int32

The Win32 class styles for the window.

style
Int32

The Win32 styles for the window.

exStyle
Int32

The extended Win32 styles for the window.

x
Int32

The position of the window's left edge.

y
Int32

The position of the window's upper edge.

width
Int32

The width of the window.

height
Int32

The height of the window.

name
String

The name of the window.

parent
IntPtr

The handle of the window's parent window.

adjustSizingForNonClientArea
Boolean

true to have the layout manager include the non-client area for sizing; otherwise, false.

Attributes

Remarks

Important

This method is not available in the Internet security zone.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9