DirectXSetup

The DirectXSetup function installs one or more DirectX components.

int WINAPI DirectXSetup(
  HWND hWnd,           
  LPSTR lpszRootPath,  
  DWORD dwFlags        
);
 

Parameters

hWnd
Handle to the parent window for the setup dialog boxes.
lpszRootPath
Pointer to a string that contains the root path of the DirectX component files. This string must specify a full path to the directory that contains the files Dsetup.dll, Dsetup16.dll, and Dsetup32.dll. This directory is typically Redist. If you are certain the current directory contains Dsetup.dll and the Directx directory, this parameter can be NULL.
dwFlags
One or more flags indicating which DirectX components should be installed. A full installation (DSETUP_DIRECTX) is recommended.
DSETUP_D3D Obsolete. DirectX 3 programs that use this flag will install all DirectX components.
DSETUP_DDRAW Obsolete. DirectX 3 programs that use this flag will install all DirectX components.
DSETUP_DDRAWDRV Installs display drivers provided by Microsoft.
DSETUP_DINPUT Obsolete. DirectX 3 programs that use this flag will install all DirectX components.
DSETUP_DIRECTX Installs DirectX runtime components as well as DirectX-compatible display and audio drivers.
DSETUP_DIRECTXSETUP Obsolete. DirectX 3 programs that use this flag will install all DirectX components.
DSETUP_DPLAY Obsolete. DirectX 3 programs that use this flag will install all DirectX components.
DSETUP_DPLAYSP Obsolete. DirectX 3 programs that use this flag will install all DirectX components.
DSETUP_DSOUND Obsolete. DirectX 3 programs that use this flag will install all DirectX components.
DSETUP_DSOUNDDRV Installs audio drivers provided by Microsoft.
DSETUP_DXCORE Installs DirectX runtime components. Does not install DirectX-compatible display and audio drivers.
DSETUP_TESTINSTALL Performs a test installation. Does not actually install new components.

Return Values

If this function is successful, it returns SUCCESS.

If it is not successful, it returns an error code. For a list of possible return codes, see Return Values.

Remarks

Before you use the DirectXSetup function in your setup program, you should ensure that there is at least 15 MB of available disk space on the user's system. This is the maximum space required for DirectX to set up the appropriate files. If the user's system already contains the DirectX files, this space is not needed.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in dsetup.h.
  Import Library: Use dsetup.lib.

See Also

Using the DirectXSetup Function.