DirectXSetup

int WINAPI DirectXSetup(HWND hWnd, LPSTR lpszRootPath,

DWORD dwFlags);

Installs one or more DirectX components.

·Returns SUCCESS if successful, or an error otherwise. For a list of possible return codes, see DirectSetup Return Values.

hWnd

Handle of the parent window for the setup dialog boxes.

lpszRootPath

Address of 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 Dsetup.dll file. (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 used to indicate which DirectX components should be installed. A full installation (DSETUP_DIRECTX) is recommended.

DSETUP_D3D Installs Direct3D™.

DSETUP_DDRAW Installs DirectDraw.

DSETUP_DDRAWDRV Installs DirectDraw device drivers.

DSETUP_DINPUT Installs DirectInput™.

DSETUP_DIRECTX Installs all DirectX components.

DSETUP_DIRECTXSETUP Installs DirectXSetup DLLs.

DSETUP_DPLAY Installs DirectPlay®.

DSETUP_DPLAYSP Installs DirectPlay service providers.

DSETUP_DSOUND Installs DirectSound®.

DSETUP_DSOUNDDRV Installs DirectSound device drivers.

DSETUP_DVIDEO Installs DirectVideo.

DSETUP_PROMPTFORDRIVERS Prompts before replacing display and audio device drivers.

DSETUP_RESTOREDRIVERS Restores display and audio drivers.

Before you use DirectXSetup in your setup program, you should ensure that there is at least 5 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.