home *** CD-ROM | disk | FTP | other *** search
-
- // PROG15_3.CPP - DirectSetup version detection demo
-
- // INCLUDES ///////////////////////////////////////////////
-
- #define WIN32_LEAN_AND_MEAN
- #define INITGUID
-
- #include <windows.h> // include important windows stuff
- #include <windowsx.h>
- #include <mmsystem.h>
- #include <iostream.h> // include important C/C++ stuff
- #include <conio.h>
- #include <stdlib.h>
- #include <malloc.h>
- #include <memory.h>
- #include <string.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <math.h>
- #include <io.h>
- #include <fcntl.h>
- #include <dsetup.h>
-
- // WINMAIN ////////////////////////////////////////////////
-
- int WINAPI WinMain( HINSTANCE hinstance,
- HINSTANCE hprevinstance,
- LPSTR lpcmdline,
- int ncmdshow)
- {
- // this is a very simple version detector
-
- DWORD version; // used to hold version information
- DWORD revision; // used to hold revision information
- char buffer[256]; // used to hold messages
-
- // test if directX is installed, if so then print out
- // verison and revision, otherwise print out error
- if (DirectXSetupGetVersion(&version, &revision))
- {
- // build up message
- sprintf(buffer,"DirectX version is %d.%d.%d.%d\n",
- HIWORD(version), LOWORD(version),
- HIWORD(revision), LOWORD(revision));
-
- // display a message box with the info
- MessageBox(NULL,buffer,
- "DirectX Setup Version Demo",MB_OK);
-
- } // end if
- else
- MessageBox(NULL,"Previous Versions of DirectX not Installed!",
- "DirectX Setup Version Demo",MB_OK);
-
- // return to Windows like this
- return(0);
-
- } // end WinMain
-
-