InstallNewDevice function

Installs a new device. The user is prompted to select the device.


BOOL WINAPI InstallNewDevice(
  _In_  HWND   hwndParent,
  _In_  LPGUID ClassGuid,
  _Out_ PDWORD pReboot


hwndParent [in]

A handle to the top-level window to be used for any required user interface.

ClassGuid [in]

A pointer to a class GUID. This parameter is optional. If this parameter is NULL, the user starts at the detection choice page. If this parameter is GUID_NULL or GUID_DEVCLASS_UNKNOWN, the user starts at the class selection page.

pReboot [out]

A pointer to a variable that receives the reboot status. This parameter can be DI_NEEDRESTART or DI_NEEDREBOOT.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


This function has no associated import library. You must use the LoadLibrary and GetProcAddress functions to dynamically link to NewDev.dll.


Requirement Value
Minimum supported client
Windows XP
Minimum supported server
Windows Server 2003

See also

Device Management Functions