HOWTO: Programmatically Install a Display Driver

ID: Q232539


The information in this article applies to:
  • Microsoft Windows NT 4.0


SUMMARY

This article explains how to programmatically install a Windows NT 4.0 Display Driver after installation of the operating system has been completed.


MORE INFORMATION

To install a new Display Driver, the Display control panel applet Desk.cpl exports the function InstallGraphicsDriver().

This function is defined as:


DWORD
InstallGraphicsDriver(
   HWND    hwnd, /* Optional */ 
   LPCWSTR pszSourceDirectory,
   LPCWSTR pszModel,
   LPCWSTR pszInf
   ) 

Parameters




hwnd 
Handle to the Parent Window (Optional).

pszSourceDirectory 
NULL-terminated Unicode string that contains the Directory where the display driver can be found.

pszModel 
NULL-terminated Unicode string that contains the device description found in the associated .inf file.

pszInf 
NULL-terminated Unicode string that contains the .inf file for the Display Driver.
A program written to use this function might look like the following sample:

Graphics.c

#include <windows.h>

int wmain( int argc, wchar_t *argv[ ], wchar_t *envp[ ] )
{
    HINSTANCE hLib;
    if (hLib = LoadLibrary("desk.cpl"))
    {
       FARPROC InstGraphDrv;
       if (InstGraphDrv = GetProcAddress(hLib,"InstallGraphicsDriver"))
           (InstGraphDrv)(NULL,argv[1],argv[2],argv[3]);

       FreeLibrary(hLib);
    }
} 
To install the 3D RAGE PRO TURBO driver using a driver and an *.inf file in the directory C:\ati\, the command might look like the following:

Graphics.exe c:\ati\ "3D RAGE PRO TURBO" ati.inf 

Additional query words:

Keywords : kbdisplay kbsetup kbGrpNTDDK
Version : winnt:4.0
Platform : winnt
Issue type : kbhowto


Last Reviewed: May 26, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.