Microsoft KB Archive/232539

{|
 * width="100%"|

HOWTO: Programmatically Install a Display Driver

 * }

Q232539

-

The information in this article applies to:


 * Microsoft Windows NT Server version 4.0
 * Microsoft Windows NT Workstation version 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 

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 kbGrpDSNTDDK

Issue type : kbhowto

Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbWinNTSsearch kbWinNTS400xsearch kbWinNTS400