DXUTCreateWindow
Microsoft DirectX 9.0 SDK Update (October 2004)

DXUTCreateWindow Function


Creates the window for the application.

Syntax

HRESULT DXUTCreateWindow(      

    const WCHAR *strWindowTitle,     HINSTANCE hInstance,     HICON hIcon,     HMENU hMenu,     INT x,     INT y );

Parameters

strWindowTitle
[in] Title bar caption for the window. The default value is L"Direct3D Window".
hInstance
[in] Handle of the application's instance, or NULL to retrieve the handle of the current module. The default value is NULL.
hIcon
[in] Handle to the application's icon, or NULL to use the first icon embedded in the application's executable. The default value is NULL.
hMenu
[in] Handle to the application's menu resource, or NULL to indicate no menu. The default value is NULL.
x
[in] Horizontal coordinate of the window's upper left corner, in screen coordinates. Using a value of CW_USEDEFAULT allows Microsoft Windows to choose an appropriate location. The default value is CW_USEDEFAULT.
y
[in] Vertical coordinate of the window's upper left corner, in screen coordinates. Using a value of CW_USEDEFAULT allows Windows to choose an appropriate location. The default value is CW_USEDEFAULT.

Return Value

If the function succeeds, the return value is S_OK.

If the function fails, the return value can be one of the error codes in DXUTERR.

Remarks

This function creates a new window for the application; alternately, the application can handle window creation and pass the desired window handle to the sample framework by using the DXUTSetWindow function. If neither DXUTCreateWindow nor DXUTSetWindow has been called before calling a device creation framework method, the framework will call DXUTCreateWindow using the default parameter values. The window width and height are set later using the device settings.

All parameters are optional.

If both x and y are CW_USEDEFAULT and a windowed non-primary Microsoft Direct3D device is created, the window will automatically be moved to the adapter's monitor to ensure maximum performance.

Function Information

Headerdxut.h
Import libraryNone
Minimum operating systems Windows 98

See Also

Creating a Window, CreateWindow Function World Wide Web link


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.