Initial commit: ROW Client source code
Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
135
Library/dxx8/samples/Multimedia/Misc/DXErr/DXErr.dsp
Normal file
135
Library/dxx8/samples/Multimedia/Misc/DXErr/DXErr.dsp
Normal file
@@ -0,0 +1,135 @@
|
||||
# Microsoft Developer Studio Project File - Name="DXErr" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=DXErr - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DXErr.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DXErr.mak" CFG="DXErr - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DXErr - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "DXErr - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "DXErr - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\common\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 dxerr8.lib winmm.lib dsound.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "DXErr - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\common\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 comctl32.lib dxerr8.lib winmm.lib dsound.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "DXErr - Win32 Release"
|
||||
# Name "DXErr - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DXErr.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\direcx.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DXErr.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\dxutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\include\dxutil.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\readme.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
132
Library/dxx8/samples/Multimedia/Misc/DXErr/DXErr.rc
Normal file
132
Library/dxx8/samples/Multimedia/Misc/DXErr/DXErr.rc
Normal file
@@ -0,0 +1,132 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "directx.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_MAIN DIALOG DISCARDABLE 0, 0, 240, 126
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE |
|
||||
WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "DirectX Error Lookup"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Value (in hex):",IDC_STATIC,7,9,46,8
|
||||
EDITTEXT IDC_VALUE,55,7,109,12,ES_AUTOHSCROLL
|
||||
LTEXT "Error Message:",IDC_STATIC,7,25,48,8
|
||||
EDITTEXT IDC_MESSAGE,7,36,226,63,ES_MULTILINE | ES_AUTOVSCROLL |
|
||||
ES_READONLY | WS_VSCROLL
|
||||
DEFPUSHBUTTON "&Look Up",IDC_LOOKUP,7,104,50,14
|
||||
PUSHBUTTON "E&xit",IDCANCEL,183,104,50,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_MAIN, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 233
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 118
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
BIN
Library/dxx8/samples/Multimedia/Misc/DXErr/directx.ico
Normal file
BIN
Library/dxx8/samples/Multimedia/Misc/DXErr/directx.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
188
Library/dxx8/samples/Multimedia/Misc/DXErr/dxerr.cpp
Normal file
188
Library/dxx8/samples/Multimedia/Misc/DXErr/dxerr.cpp
Normal file
@@ -0,0 +1,188 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// File: DXErr.cpp
|
||||
//
|
||||
// Desc: The DXErr sample allows users to enter a numberical HRESULT and get back
|
||||
// the string match its define. For example, entering 0x8878000a will
|
||||
// return DSERR_ALLOCATED.
|
||||
//
|
||||
// Copyright (c) 1999-2001 Microsoft Corp. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <basetsd.h>
|
||||
#include <dxerr8.h>
|
||||
#include <tchar.h>
|
||||
#include "resource.h"
|
||||
#include "DXUtil.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Function-prototypes
|
||||
//-----------------------------------------------------------------------------
|
||||
INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
|
||||
VOID OnInitDialog( HWND hDlg );
|
||||
VOID LookupValue( HWND hDlg );
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Defines, constants, and global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: WinMain()
|
||||
// Desc: Entry point for the application. Since we use a simple dialog for
|
||||
// user interaction we don't need to pump messages.
|
||||
//-----------------------------------------------------------------------------
|
||||
INT APIENTRY WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR pCmdLine,
|
||||
INT nCmdShow )
|
||||
{
|
||||
// Display the main dialog box.
|
||||
DialogBox( hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDlgProc );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: MainDlgProc()
|
||||
// Desc: Handles dialog messages
|
||||
//-----------------------------------------------------------------------------
|
||||
INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( msg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
OnInitDialog( hDlg );
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDC_LOOKUP:
|
||||
LookupValue( hDlg );
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog( hDlg, IDCANCEL );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE; // Didn't handle message
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE; // Didn't handle message
|
||||
}
|
||||
|
||||
return TRUE; // Handled message
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: OnInitDialog()
|
||||
// Desc: Initializes the dialogs (sets up UI controls, etc.)
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID OnInitDialog( HWND hDlg )
|
||||
{
|
||||
// Load the icon
|
||||
#ifdef _WIN64
|
||||
HINSTANCE hInst = (HINSTANCE) GetWindowLongPtr( hDlg, GWLP_HINSTANCE );
|
||||
#else
|
||||
HINSTANCE hInst = (HINSTANCE) GetWindowLong( hDlg, GWL_HINSTANCE );
|
||||
#endif
|
||||
HICON hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDR_MAINFRAME ) );
|
||||
|
||||
// Set the icon for this dialog.
|
||||
SendMessage( hDlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon ); // Set big icon
|
||||
SendMessage( hDlg, WM_SETICON, ICON_SMALL, (LPARAM) hIcon ); // Set small icon
|
||||
|
||||
SendMessage( hDlg, EM_LIMITTEXT, 20, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: LookupValue()
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID LookupValue( HWND hDlg )
|
||||
{
|
||||
HRESULT hrErr = 0;
|
||||
TCHAR strValue[MAX_PATH];
|
||||
const TCHAR* strHRESULT;
|
||||
const TCHAR* strDescription;
|
||||
TCHAR strHRESULTCopy[MAX_PATH*2];
|
||||
int nIndex;
|
||||
int nPower = 0;
|
||||
int nDigit = 0;
|
||||
GetDlgItemText( hDlg, IDC_VALUE, strValue, MAX_PATH );
|
||||
|
||||
nIndex = lstrlen(strValue) - 1;
|
||||
|
||||
// skip whitespace
|
||||
while( nIndex >= 0 )
|
||||
{
|
||||
if( strValue[nIndex] != ' ' &&
|
||||
strValue[nIndex] != 'L' )
|
||||
break;
|
||||
|
||||
nIndex--;
|
||||
}
|
||||
|
||||
while( nIndex >= 0 )
|
||||
{
|
||||
// Convert to uppercase
|
||||
if( strValue[nIndex] >= 'a' && strValue[nIndex] <= 'z' )
|
||||
strValue[nIndex] += 'A' - 'a';
|
||||
|
||||
if( strValue[nIndex] >= 'A' && strValue[nIndex] <= 'F' )
|
||||
nDigit = strValue[nIndex] - 'A' + 10;
|
||||
else if( strValue[nIndex] >= '0' && strValue[nIndex] <= '9' )
|
||||
nDigit = strValue[nIndex] - '0';
|
||||
else
|
||||
break;
|
||||
|
||||
hrErr += ( nDigit << (nPower*4) );
|
||||
|
||||
nIndex--;
|
||||
nPower++;
|
||||
}
|
||||
|
||||
// Use DXErr8.lib to lookup HRESULT.
|
||||
strHRESULT = DXGetErrorString8( hrErr );
|
||||
_tcscpy( strHRESULTCopy, TEXT("HRESULT: ") );
|
||||
_tcscat( strHRESULTCopy, strHRESULT );
|
||||
|
||||
strDescription = DXGetErrorDescription8( hrErr );
|
||||
|
||||
TCHAR* strTemp;
|
||||
while( strTemp = _tcschr( strHRESULTCopy, '&') )
|
||||
{
|
||||
strTemp[0] = '\r';
|
||||
strTemp[1] = '\n';
|
||||
}
|
||||
|
||||
if( lstrlen(strDescription) > 0 )
|
||||
{
|
||||
_tcscat( strHRESULTCopy, TEXT("\r\nDescription: ") );
|
||||
_tcscat( strHRESULTCopy, strDescription );
|
||||
}
|
||||
|
||||
SetDlgItemText( hDlg, IDC_MESSAGE, strHRESULTCopy );
|
||||
return;
|
||||
}
|
||||
29
Library/dxx8/samples/Multimedia/Misc/DXErr/dxerr.dsw
Normal file
29
Library/dxx8/samples/Multimedia/Misc/DXErr/dxerr.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "DXErr"=.\DXErr.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
211
Library/dxx8/samples/Multimedia/Misc/DXErr/dxerr.mak
Normal file
211
Library/dxx8/samples/Multimedia/Misc/DXErr/dxerr.mak
Normal file
@@ -0,0 +1,211 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on DXErr.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=DXErr - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to DXErr - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "DXErr - Win32 Release" && "$(CFG)" != "DXErr - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DXErr.mak" CFG="DXErr - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DXErr - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "DXErr - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "DXErr - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\DXErr.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\DXErr.obj"
|
||||
-@erase "$(INTDIR)\DXErr.res"
|
||||
-@erase "$(INTDIR)\dxutil.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\DXErr.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\common\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\DXErr.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\DXErr.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\DXErr.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dxerr8.lib winmm.lib dsound.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\DXErr.pdb" /machine:I386 /out:"$(OUTDIR)\DXErr.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\DXErr.obj" \
|
||||
"$(INTDIR)\dxutil.obj" \
|
||||
"$(INTDIR)\DXErr.res"
|
||||
|
||||
"$(OUTDIR)\DXErr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "DXErr - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\DXErr.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\DXErr.obj"
|
||||
-@erase "$(INTDIR)\DXErr.res"
|
||||
-@erase "$(INTDIR)\dxutil.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\DXErr.exe"
|
||||
-@erase "$(OUTDIR)\DXErr.ilk"
|
||||
-@erase "$(OUTDIR)\DXErr.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\common\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\DXErr.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\DXErr.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\DXErr.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=comctl32.lib dxerr8.lib winmm.lib dsound.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\DXErr.pdb" /debug /machine:I386 /out:"$(OUTDIR)\DXErr.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\DXErr.obj" \
|
||||
"$(INTDIR)\dxutil.obj" \
|
||||
"$(INTDIR)\DXErr.res"
|
||||
|
||||
"$(OUTDIR)\DXErr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("DXErr.dep")
|
||||
!INCLUDE "DXErr.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "DXErr.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "DXErr - Win32 Release" || "$(CFG)" == "DXErr - Win32 Debug"
|
||||
SOURCE=.\DXErr.cpp
|
||||
|
||||
"$(INTDIR)\DXErr.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\DXErr.rc
|
||||
|
||||
"$(INTDIR)\DXErr.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\..\common\src\dxutil.cpp
|
||||
|
||||
"$(INTDIR)\dxutil.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
23
Library/dxx8/samples/Multimedia/Misc/DXErr/readme.txt
Normal file
23
Library/dxx8/samples/Multimedia/Misc/DXErr/readme.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Sample Name: DXErr Sample
|
||||
//
|
||||
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
The DXErr sample allows users to enter a numerical HRESULT and get back
|
||||
the string equivalent as well as its description. For example, entering
|
||||
0x8878000a will return
|
||||
HRESULT: DSERR_ALLOCATED
|
||||
Description: The call failed because resources (such as a priority
|
||||
level) were already being used by another caller.
|
||||
|
||||
Path
|
||||
====
|
||||
Source: DXSDK\Samples\Multimedia\Misc\DXErr
|
||||
|
||||
Executable: DXSDK\Samples\Multimedia\DXErr\Bin
|
||||
26
Library/dxx8/samples/Multimedia/Misc/DXErr/resource.h
Normal file
26
Library/dxx8/samples/Multimedia/Misc/DXErr/resource.h
Normal file
@@ -0,0 +1,26 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by DXErr.rc
|
||||
//
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_MAIN 130
|
||||
#define IDR_ACCELERATOR1 131
|
||||
#define IDC_PLAY 1000
|
||||
#define IDC_STOP 1001
|
||||
#define IDC_LOOP_CHECK 1009
|
||||
#define IDC_SOUNDFILE 1011
|
||||
#define IDC_FILENAME 1015
|
||||
#define IDC_VALUE 1019
|
||||
#define IDC_LOOKUP 1020
|
||||
#define IDC_MESSAGE 1022
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 132
|
||||
#define _APS_NEXT_COMMAND_VALUE 32772
|
||||
#define _APS_NEXT_CONTROL_VALUE 1023
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
BIN
Library/dxx8/samples/Multimedia/Misc/DXinstall/directx.ico
Normal file
BIN
Library/dxx8/samples/Multimedia/Misc/DXinstall/directx.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
420
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.cpp
Normal file
420
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.cpp
Normal file
@@ -0,0 +1,420 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: DxInstall.cpp
|
||||
//
|
||||
// Desc: Example code showing how to use DirectXSetup.
|
||||
//
|
||||
// This file contains code that will handle all messages sent to the
|
||||
// DirectXSetupCallbackFunction, with the filtering level set at what the
|
||||
// user wants. This way you can test to see which messages you want to
|
||||
// h andle automatically or pass on to the user.
|
||||
//
|
||||
// Call Tree:
|
||||
// DirectXInstallWndProc See WINCODE.CPP
|
||||
// DirectXInstall Set up the callback and handle return codes
|
||||
// GetReply See WINCODE.CPP
|
||||
// DirectXGetVersion Display the results of DirectXSetupGetVersion()
|
||||
// DirectXSetupCallbackFunction Called from DirectXSetup
|
||||
// GetReply See WINCODE.CPP
|
||||
// SetButtons See WINCODE.CPP
|
||||
// ShowButton See WINCODE.CPP
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <dsetup.h>
|
||||
#include "resource.h"
|
||||
#include "DXInstall.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Externs for global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
extern DWORD g_dwStatus; // Filter setting for messages from DirectXSetup
|
||||
extern HINSTANCE g_hInstance; // Global instance handle
|
||||
extern HWND g_hDlg; // Window handle to dialog proc
|
||||
extern CHAR g_strAppTitle[256]; // Application title
|
||||
extern INT g_iReply; // Global value for dialog return
|
||||
extern BOOL g_bCheckOlder; // Whether or not to check for older installs
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: GetReply()
|
||||
// Desc: Waits for the user to click on a button on our simulated message box
|
||||
// See DlgProc for the code that sets g_wReply
|
||||
//-----------------------------------------------------------------------------
|
||||
DWORD GetReply( DWORD dwMsgType )
|
||||
{
|
||||
DWORD dwDefaultButton = 0;
|
||||
|
||||
// Wait until DlgProc() lets us know that the user clicked on a button
|
||||
while( g_iReply == -1 )
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
// Forward my messages...
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
|
||||
{
|
||||
if( msg.message == WM_QUIT ||
|
||||
msg.message == WM_CLOSE ||
|
||||
msg.message == WM_SYSCOMMAND ||
|
||||
msg.message == WM_DESTROY )
|
||||
{
|
||||
// Put the message back on the queue and get out of here.
|
||||
PostMessage( msg.hwnd, msg.message, msg.wParam, msg.lParam );
|
||||
break;
|
||||
}
|
||||
if( !IsDialogMessage( msg.hwnd, &msg ) )
|
||||
{
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return the proper ID value for the button the user clicked on
|
||||
// This code simulates what MessageBox() would return
|
||||
switch( dwMsgType & 0x0000000F )
|
||||
{
|
||||
case MB_OKCANCEL:
|
||||
dwDefaultButton = (g_iReply==IDBUT1) ? IDOK : IDCANCEL;
|
||||
break;
|
||||
|
||||
case MB_OK:
|
||||
dwDefaultButton = IDOK;
|
||||
break;
|
||||
|
||||
case MB_RETRYCANCEL:
|
||||
dwDefaultButton = (g_iReply==IDBUT1) ? IDRETRY : IDCANCEL;
|
||||
break;
|
||||
|
||||
case MB_ABORTRETRYIGNORE:
|
||||
if( g_iReply == IDBUT1 )
|
||||
dwDefaultButton = IDABORT;
|
||||
else if (g_iReply == IDBUT2)
|
||||
dwDefaultButton = IDRETRY;
|
||||
else
|
||||
dwDefaultButton = IDIGNORE;
|
||||
break;
|
||||
|
||||
case MB_YESNOCANCEL:
|
||||
if( g_iReply == IDBUT1 )
|
||||
dwDefaultButton = IDYES;
|
||||
else if( g_iReply == IDBUT2 )
|
||||
dwDefaultButton = IDNO;
|
||||
else
|
||||
dwDefaultButton = IDCANCEL;
|
||||
break;
|
||||
|
||||
case MB_YESNO:
|
||||
dwDefaultButton = (g_iReply==IDBUT1) ? IDYES : IDNO;
|
||||
break;
|
||||
|
||||
default:
|
||||
dwDefaultButton = IDOK;
|
||||
}
|
||||
|
||||
g_iReply = -1;
|
||||
|
||||
return dwDefaultButton;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: DirectXSetupCallbackFunction()
|
||||
// Desc: Handle each reason for why the callback was called, filtering each
|
||||
// message by what the current state of g_fStatus is.
|
||||
//-----------------------------------------------------------------------------
|
||||
DWORD WINAPI DirectXSetupCallbackFunction( DWORD dwReason, DWORD dwMsgType,
|
||||
LPSTR strMessage, LPSTR strName,
|
||||
VOID* pInfo )
|
||||
{
|
||||
if( strMessage == NULL && strName == NULL )
|
||||
return IDOK;
|
||||
|
||||
SetButtons( g_hDlg, -1 );
|
||||
if( g_dwStatus == SHOW_ALL )
|
||||
{
|
||||
// Show all messages from DirectSetup
|
||||
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), strMessage );
|
||||
|
||||
// When dwMsgType is equal to zero we can display status information but
|
||||
// should not wait for input from the user.
|
||||
if( dwMsgType == 0 )
|
||||
{
|
||||
Sleep(1000);
|
||||
return IDOK;
|
||||
}
|
||||
|
||||
SetButtons( g_hDlg, dwMsgType );
|
||||
}
|
||||
else if( g_dwStatus == SHOW_UPGRADES )
|
||||
{
|
||||
// Show only upgrade messages
|
||||
|
||||
switch( dwReason )
|
||||
{
|
||||
case DSETUP_CB_MSG_SETUP_INIT_FAILED:
|
||||
case DSETUP_CB_MSG_INTERNAL_ERROR:
|
||||
case DSETUP_CB_MSG_OUTOFDISKSPACE:
|
||||
case DSETUP_CB_MSG_FILECOPYERROR:
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), strMessage );
|
||||
SetButtons( g_hDlg, dwMsgType );
|
||||
break;
|
||||
|
||||
case DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE:
|
||||
{
|
||||
// pInfo points to a structure containing flags that summarize
|
||||
// the DirectXSetup functions recommendation on how the upgrade
|
||||
// of DirectX components and drivers should be preformed
|
||||
DWORD dwUpgrade = ( ((DSETUP_CB_UPGRADEINFO*)pInfo)->UpgradeFlags
|
||||
& DSETUP_CB_UPGRADE_TYPE_MASK );
|
||||
switch( dwUpgrade )
|
||||
{
|
||||
case DSETUP_CB_UPGRADE_FORCE:
|
||||
case DSETUP_CB_UPGRADE_KEEP:
|
||||
case DSETUP_CB_UPGRADE_SAFE:
|
||||
case DSETUP_CB_UPGRADE_UNKNOWN:
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), strMessage );
|
||||
SetButtons( g_hDlg, dwMsgType );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return IDOK;
|
||||
}
|
||||
}
|
||||
else if( g_dwStatus == SHOW_PROBLEMS )
|
||||
{
|
||||
// Show only problem messages
|
||||
|
||||
switch( dwReason )
|
||||
{
|
||||
case DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS:
|
||||
case DSETUP_CB_MSG_CANTINSTALL_NT:
|
||||
case DSETUP_CB_MSG_CANTINSTALL_BETA:
|
||||
case DSETUP_CB_MSG_CANTINSTALL_NOTWIN32:
|
||||
case DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE:
|
||||
case DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM:
|
||||
case DSETUP_CB_MSG_PREINSTALL_NT:
|
||||
case DSETUP_CB_MSG_NOTPREINSTALLEDONNT:
|
||||
case DSETUP_CB_MSG_SETUP_INIT_FAILED:
|
||||
case DSETUP_CB_MSG_INTERNAL_ERROR:
|
||||
case DSETUP_CB_MSG_OUTOFDISKSPACE:
|
||||
case DSETUP_CB_MSG_FILECOPYERROR:
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), strMessage );
|
||||
SetButtons( g_hDlg, dwMsgType );
|
||||
break;
|
||||
|
||||
case DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE:
|
||||
{
|
||||
DWORD dwUpgrade = ( ((DSETUP_CB_UPGRADEINFO*)pInfo)->UpgradeFlags
|
||||
& DSETUP_CB_UPGRADE_TYPE_MASK );
|
||||
switch( dwUpgrade )
|
||||
{
|
||||
case DSETUP_CB_UPGRADE_FORCE:
|
||||
case (DSETUP_CB_UPGRADE_SAFE & DSETUP_CB_UPGRADE_HASWARNINGS):
|
||||
case DSETUP_CB_UPGRADE_UNKNOWN:
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), strMessage );
|
||||
SetButtons( g_hDlg, dwMsgType );
|
||||
break;
|
||||
|
||||
case DSETUP_CB_UPGRADE_KEEP:
|
||||
return IDOK;
|
||||
|
||||
case DSETUP_CB_UPGRADE_SAFE:
|
||||
switch( dwMsgType & 0x0000000F )
|
||||
{
|
||||
case MB_YESNO:
|
||||
case MB_YESNOCANCEL:
|
||||
return IDYES;
|
||||
|
||||
case MB_OKCANCEL:
|
||||
case MB_OK:
|
||||
default:
|
||||
return IDOK;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return IDOK;
|
||||
}
|
||||
}
|
||||
else if( g_dwStatus == SHOW_NONE )
|
||||
{
|
||||
// Don't show any messages
|
||||
return IDOK;
|
||||
}
|
||||
|
||||
return GetReply( dwMsgType );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: DirectXGetVersion()
|
||||
// Desc: Shows the results of a call to DirectXSetupGetVersion()
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID DirectXGetVersion()
|
||||
{
|
||||
DWORD dwVersion;
|
||||
DWORD dwRevision;
|
||||
|
||||
INT iRetCode = DirectXSetupGetVersion( &dwVersion, &dwRevision );
|
||||
// Use HIWORD(dwVersion); to get the DirectX major version
|
||||
// Use LOWORD(dwVersion); to get the DirectX minor version
|
||||
// For example: for DirectX 5 dwVersion == 0x00040005
|
||||
|
||||
CHAR strBuf[128];
|
||||
sprintf( strBuf, "Version 0x%08lX\nRevision %ld", dwVersion, dwRevision );
|
||||
MessageBox( NULL, strBuf, "Results:", MB_OK|MB_ICONINFORMATION );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: DirectXInstall()
|
||||
// Desc: Set up the callback function for DirectXSetup and handle the return
|
||||
// results. This function starts a modeless version of MessageBox() so
|
||||
// that the user can see the progress of the DirectX installation.
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL DirectXInstall( HWND hWnd )
|
||||
{
|
||||
CHAR strSource[_MAX_PATH];
|
||||
CHAR string[256];
|
||||
INT iRetCode;
|
||||
DWORD dwFlags;
|
||||
|
||||
// The DSETUP DLLs should be at the current path, along with the DirectX
|
||||
// redist directory so that it can be found and set up. Otherwise, change
|
||||
// the code below to reflect the real path.
|
||||
GetCurrentDirectory( _MAX_PATH, strSource );
|
||||
|
||||
// If the user wants any messages, bring up the simulated MessageBox
|
||||
// dialog
|
||||
if( g_dwStatus != SHOW_NONE )
|
||||
{
|
||||
// Create a modeless dialog box so we can show messages that don't
|
||||
// need user input
|
||||
g_hDlg = CreateDialog( g_hInstance, "INSTDX", hWnd, (DLGPROC)DlgProc );
|
||||
if( g_hDlg == NULL )
|
||||
{
|
||||
CHAR buf[200];
|
||||
LoadString( g_hInstance, STR_NODIALOG, buf, 200 );
|
||||
MessageBox( hWnd, string, g_strAppTitle, MB_ICONSTOP|MB_OK );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow( GetDlgItem( g_hDlg, IDBUT1 ), SW_HIDE );
|
||||
ShowWindow( GetDlgItem( g_hDlg, IDBUT2 ), SW_HIDE );
|
||||
ShowWindow( GetDlgItem( g_hDlg, IDBUT3 ), SW_HIDE );
|
||||
ShowWindow( g_hDlg, SW_NORMAL );
|
||||
}
|
||||
|
||||
// Set the callback function up before calling DirectXSetup
|
||||
DirectXSetupSetCallback( (DSETUP_CALLBACK)DirectXSetupCallbackFunction );
|
||||
if( g_dwStatus != SHOW_NONE )
|
||||
{
|
||||
LoadString( g_hInstance, STR_STARTSETUP, string, 256 );
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), string );
|
||||
SetButtons( g_hDlg, -1 );
|
||||
Sleep( 1000 );
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// IMPORTANT NOTE: We are about to do the DirectXSetup, but only in test
|
||||
// mode. In the real world, you would remove the DSETUP_TESTINSTALL
|
||||
//-------------------------------------------------------------------------
|
||||
dwFlags = DSETUP_DIRECTX | DSETUP_TESTINSTALL;
|
||||
if( g_bCheckOlder == TRUE )
|
||||
dwFlags |= DSETUP_USEROLDERFLAG;
|
||||
|
||||
iRetCode = DirectXSetup( hWnd, strSource, dwFlags );
|
||||
|
||||
// If the user didn't want any message, we now need to bring up the dialog
|
||||
// to reflect the return message from DirectXSetup
|
||||
if( g_dwStatus == SHOW_NONE )
|
||||
{
|
||||
g_hDlg = CreateDialog( g_hInstance, "INSTDX", hWnd, (DLGPROC)DlgProc );
|
||||
if( g_hDlg == NULL )
|
||||
{
|
||||
CHAR buf[200];
|
||||
LoadString( g_hInstance, STR_NODIALOG, buf, 200 );
|
||||
MessageBox( hWnd, string, g_strAppTitle, MB_ICONSTOP|MB_OK );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow( GetDlgItem( g_hDlg, IDBUT1 ), SW_HIDE );
|
||||
ShowWindow( GetDlgItem( g_hDlg, IDBUT2 ), SW_HIDE );
|
||||
ShowWindow( GetDlgItem( g_hDlg, IDBUT3 ), SW_HIDE );
|
||||
ShowWindow( g_hDlg, SW_NORMAL );
|
||||
}
|
||||
|
||||
switch( iRetCode )
|
||||
{
|
||||
// Since our MessageBox dialog is still up, display the results in it
|
||||
case DSETUPERR_NEWERVERSION:
|
||||
MessageBox( NULL, "Installation is newer than one being installed",
|
||||
"DirectX Setup", MB_OK );
|
||||
break;
|
||||
|
||||
case DSETUPERR_SUCCESS_RESTART:
|
||||
LoadString( g_hInstance, STR_RESTART, string, 256 );
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), string );
|
||||
SetButtons( g_hDlg, -1 );
|
||||
SetButtons( g_hDlg, MB_YESNO );
|
||||
if( GetReply( MB_YESNO ) == IDYES )
|
||||
{
|
||||
// Restart Windows
|
||||
ExitWindowsEx( EWX_REBOOT, 0 );
|
||||
}
|
||||
break;
|
||||
|
||||
case DSETUPERR_SUCCESS:
|
||||
LoadString( g_hInstance, STR_SUCCESS, string, 256 );
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), string );
|
||||
SetButtons( g_hDlg, -1 );
|
||||
SetButtons( g_hDlg, MB_OK );
|
||||
GetReply( MB_OK );
|
||||
break;
|
||||
|
||||
case DSETUPERR_BADWINDOWSVERSION:
|
||||
case DSETUPERR_SOURCEFILENOTFOUND:
|
||||
case DSETUPERR_BADSOURCESIZE:
|
||||
case DSETUPERR_BADSOURCETIME:
|
||||
case DSETUPERR_NOCOPY:
|
||||
case DSETUPERR_OUTOFDISKSPACE:
|
||||
case DSETUPERR_CANTFINDINF:
|
||||
case DSETUPERR_CANTFINDDIR:
|
||||
case DSETUPERR_INTERNAL:
|
||||
case DSETUPERR_UNKNOWNOS:
|
||||
case DSETUPERR_USERHITCANCEL:
|
||||
case DSETUPERR_NOTPREINSTALLEDONNT:
|
||||
LoadString( g_hInstance, STR_ERRORRETURN + (iRetCode * -1) - 1, string, 256 );
|
||||
SetWindowText( GetDlgItem( g_hDlg, ID_MYMESSAGE ), string );
|
||||
SetButtons( g_hDlg, -1 );
|
||||
SetButtons( g_hDlg, MB_OK );
|
||||
GetReply( MB_OK );
|
||||
break;
|
||||
}
|
||||
|
||||
DestroyWindow( g_hDlg );
|
||||
g_hDlg = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
115
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.dsp
Normal file
115
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.dsp
Normal file
@@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="DXInstall" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=DXInstall - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DXInstall.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DXInstall.mak" CFG="DXInstall - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DXInstall - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "DXInstall - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "DXInstall - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 dsetup.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "DXInstall - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 dsetup.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "DXInstall - Win32 Release"
|
||||
# Name "DXInstall - Win32 Debug"
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dxinstall.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dxinstall.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dxinstall.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\winmain.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
29
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.dsw
Normal file
29
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "DXInstall"=.\dxinstall.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
31
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.h
Normal file
31
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: DXInstall.h
|
||||
//
|
||||
// Desc: Header file for example code showing how to use DirectXSetup.
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID SetButtons( HWND hDlg, DWORD wMsgType );
|
||||
DLGPROC DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
|
||||
BOOL DirectXInstall( HWND hWnd );
|
||||
VOID DirectXGetVersion();
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Defines, constants, and global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
#define DSETUP_REINSTALL 0x00000080
|
||||
|
||||
#define SHOW_ALL 1
|
||||
#define SHOW_UPGRADES 2
|
||||
#define SHOW_PROBLEMS 3
|
||||
#define SHOW_NONE 4
|
||||
210
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.mak
Normal file
210
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.mak
Normal file
@@ -0,0 +1,210 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on dxinstall.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=DXInstall - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to DXInstall - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "DXInstall - Win32 Release" && "$(CFG)" != "DXInstall - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "dxinstall.mak" CFG="DXInstall - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DXInstall - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "DXInstall - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "DXInstall - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\dxinstall.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\dxinstall.obj"
|
||||
-@erase "$(INTDIR)\dxinstall.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\winmain.obj"
|
||||
-@erase "$(OUTDIR)\dxinstall.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\dxinstall.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\dxinstall.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dxinstall.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dsetup.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\dxinstall.pdb" /machine:I386 /out:"$(OUTDIR)\dxinstall.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\dxinstall.obj" \
|
||||
"$(INTDIR)\winmain.obj" \
|
||||
"$(INTDIR)\dxinstall.res"
|
||||
|
||||
"$(OUTDIR)\dxinstall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "DXInstall - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\dxinstall.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\dxinstall.obj"
|
||||
-@erase "$(INTDIR)\dxinstall.res"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(INTDIR)\winmain.obj"
|
||||
-@erase "$(OUTDIR)\dxinstall.exe"
|
||||
-@erase "$(OUTDIR)\dxinstall.ilk"
|
||||
-@erase "$(OUTDIR)\dxinstall.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\dxinstall.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\dxinstall.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dxinstall.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dsetup.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\dxinstall.pdb" /debug /machine:I386 /out:"$(OUTDIR)\dxinstall.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\dxinstall.obj" \
|
||||
"$(INTDIR)\winmain.obj" \
|
||||
"$(INTDIR)\dxinstall.res"
|
||||
|
||||
"$(OUTDIR)\dxinstall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("dxinstall.dep")
|
||||
!INCLUDE "dxinstall.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "dxinstall.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "DXInstall - Win32 Release" || "$(CFG)" == "DXInstall - Win32 Debug"
|
||||
SOURCE=.\dxinstall.rc
|
||||
|
||||
"$(INTDIR)\dxinstall.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\dxinstall.cpp
|
||||
|
||||
"$(INTDIR)\dxinstall.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\winmain.cpp
|
||||
|
||||
"$(INTDIR)\winmain.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
172
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.rc
Normal file
172
Library/dxx8/samples/Multimedia/Misc/DXinstall/dxinstall.rc
Normal file
@@ -0,0 +1,172 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_MAIN_ICON ICON DISCARDABLE "DirectX.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
INSTDX DIALOG DISCARDABLE 0, 0, 242, 170
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "DirectXSetup Sample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "",ID_MYMESSAGE,13,15,215,105
|
||||
PUSHBUTTON "",IDBUT1,31,135,48,14
|
||||
PUSHBUTTON "",IDBUT2,158,135,52,14
|
||||
PUSHBUTTON "",IDBUT3,93,135,50,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
"INSTDX", DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 235
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 163
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
MAINMENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&Start Install...", IDINSTALL
|
||||
MENUITEM "Get &Version...", IDGETVERSION
|
||||
MENUITEM "E&xit", IDEXIT
|
||||
END
|
||||
POPUP "&Options"
|
||||
BEGIN
|
||||
MENUITEM "&Show All Messages", IDSHOWALL
|
||||
MENUITEM "Show &Problems Only", IDSHOWPROBLEMS
|
||||
MENUITEM "Show &Updates Only", IDSHOWUPGRADES
|
||||
MENUITEM "Show &No Feedback", IDSHOWNOTHING
|
||||
MENUITEM "&Check Older Install", IDCHECKOLDERINSTALL
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STR_TITLE "DirectXSetup sample installer"
|
||||
STR_NODIALOG "Unable to create the message dialog."
|
||||
STR_YES "&Yes"
|
||||
STR_NO "&No"
|
||||
STR_CANCEL "&Cancel"
|
||||
STR_OK "&Ok"
|
||||
STR_RETRY "&Retry"
|
||||
STR_ABORT "&Abort"
|
||||
STR_IGNORE "&Ignore"
|
||||
STR_STARTSETUP "Starting DirectXSetup..."
|
||||
STR_SETUPDONE "DirectXSetup returned %d."
|
||||
STR_ERRORRETURN "DirectX does not support the Windows version on the system."
|
||||
STR_ERRORRETURN1 "One of the required source files could not be found."
|
||||
STR_ERRORRETURN2 "A file's size could not be verified or was incorrect."
|
||||
STR_ERRORRETURN3 "A file's date and time could not be verified or were incorrect."
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STR_ERRORRETURN4 "A file's version could not be verified or was incorrect."
|
||||
STR_ERRORRETURN5 "The setup program ran out of disk space during installation."
|
||||
STR_ERRORRETURN6 "A required .inf file could not be found."
|
||||
STR_ERRORRETURN7 "The setup program could not find the working directory."
|
||||
STR_ERRORRETURN8 "An internal error occurred."
|
||||
STR_ERRORRETURN9 "This version of DirectX on Windows NT has no 3D support."
|
||||
STR_ERRORRETURN10 "The operating system on your system is not currently supported."
|
||||
STR_ERRORRETURN11 "The Cancel button was pressed before the application was fully installed."
|
||||
STR_ERRORRETURN12 "The version of Windows NT on the system does not contain the current version of DirectX. An older version of DirectX may be present, or DirectX may be absent altogether."
|
||||
STR_RESTART "DirectX was successfully installed on your system, you must now restart Windows for the changes to take effect.\nDo you wish to restart Windows?"
|
||||
STR_SUCCESS "DirectX was successfully installed on your system."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
54
Library/dxx8/samples/Multimedia/Misc/DXinstall/readme.txt
Normal file
54
Library/dxx8/samples/Multimedia/Misc/DXinstall/readme.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Sample Name: DXInstall Sample
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
DXInstall is an example of how to use DirectXSetup interfaces to install the
|
||||
DirectX subsystem and DirectX drivers. It shows how to use a callback
|
||||
function to present messages and get user input through a custom interface,
|
||||
in this case a simple modeless dialog box.
|
||||
|
||||
Path
|
||||
====
|
||||
Source: DXSDK\Samples\Multimedia\Misc\DXInstall
|
||||
|
||||
User's Guide
|
||||
============
|
||||
First copy the entire contents of the Redist\DirectX8 folder from the DirectX
|
||||
SDK CD into the same folder as DXInstall.exe. In your development environment,
|
||||
set the working directory to this folder as well. (In Microsoft(r) Visual C++(r),
|
||||
this setting is on the Debug page of the Project Settings dialog box.)
|
||||
|
||||
Run the program and select Start Install from the File menu. DirectSetup
|
||||
performs a simulated installation of DirectX (see Programming Notes) and
|
||||
advises you of its progress in a modeless dialog box. The Options menu allows
|
||||
you to change the level of messages shown. However, if you are performing
|
||||
only a simulated installation, you will never see problem or update messages.
|
||||
|
||||
Choose Get Version from the File menu. The program shows the version and
|
||||
revision number of DirectX currently installed on the system.
|
||||
|
||||
Programming Notes
|
||||
=================
|
||||
|
||||
By default, the program passes DSETUP_TESTINSTALL to the DirectXSetup
|
||||
function. This means that no files are actually copied, nor is the registry
|
||||
modified. To perform a real installation, delete this flag from the call.
|
||||
|
||||
DXInstall employs a callback function to monitor the progress of installation
|
||||
and intercept messages. Depending on the user's preferred warning level, as
|
||||
tracked in g_fStatus, messages may be ignored or presented to the user in a
|
||||
modeless dialog box. If user input is required, the appropriate buttons are
|
||||
displayed and the GetReply function monitors the message queue until one of
|
||||
the buttons is pressed.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
54
Library/dxx8/samples/Multimedia/Misc/DXinstall/resource.h
Normal file
54
Library/dxx8/samples/Multimedia/Misc/DXinstall/resource.h
Normal file
@@ -0,0 +1,54 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by dxinstall.rc
|
||||
//
|
||||
#define STR_TITLE 1
|
||||
#define STR_NODIALOG 2
|
||||
#define STR_YES 3
|
||||
#define STR_NO 4
|
||||
#define STR_CANCEL 5
|
||||
#define STR_OK 6
|
||||
#define STR_RETRY 7
|
||||
#define STR_ABORT 8
|
||||
#define STR_IGNORE 9
|
||||
#define STR_STARTSETUP 10
|
||||
#define STR_SETUPDONE 11
|
||||
#define STR_ERRORRETURN 12
|
||||
#define STR_ERRORRETURN1 13
|
||||
#define STR_ERRORRETURN2 14
|
||||
#define STR_ERRORRETURN3 15
|
||||
#define STR_ERRORRETURN4 16
|
||||
#define STR_ERRORRETURN5 17
|
||||
#define STR_ERRORRETURN6 18
|
||||
#define STR_ERRORRETURN7 19
|
||||
#define STR_ERRORRETURN8 20
|
||||
#define STR_ERRORRETURN9 21
|
||||
#define STR_ERRORRETURN10 22
|
||||
#define STR_ERRORRETURN11 23
|
||||
#define STR_ERRORRETURN12 24
|
||||
#define STR_RESTART 25
|
||||
#define STR_SUCCESS 26
|
||||
#define ID_MYMESSAGE 100
|
||||
#define IDI_MAIN_ICON 101
|
||||
#define IDBUT1 1001
|
||||
#define IDBUT2 1002
|
||||
#define IDBUT3 1003
|
||||
#define IDINSTALL 40001
|
||||
#define IDEXIT 40002
|
||||
#define IDSHOWALL 40003
|
||||
#define IDSHOWPROBLEMS 40004
|
||||
#define IDSHOWUPGRADES 40005
|
||||
#define IDSHOWNOTHING 40006
|
||||
#define IDGETVERSION 40007
|
||||
#define IDCHECKOLDERINSTALL 40008
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||
#define _APS_NEXT_COMMAND_VALUE 40009
|
||||
#define _APS_NEXT_CONTROL_VALUE 1004
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#endif
|
||||
#endif
|
||||
347
Library/dxx8/samples/Multimedia/Misc/DXinstall/winmain.cpp
Normal file
347
Library/dxx8/samples/Multimedia/Misc/DXinstall/winmain.cpp
Normal file
@@ -0,0 +1,347 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: WinCode.cpp
|
||||
//
|
||||
// Desc: All of the Windows specific code needed for the DSetup sample
|
||||
//
|
||||
// The code in this file includes the main Windows entry point
|
||||
// as well as code to handle messages and our modeless version of
|
||||
// MessageBox().
|
||||
//
|
||||
// Call Tree:
|
||||
// WinMain Main Windows Entry Point
|
||||
// DirectXInstallInit Initializes & registers window class
|
||||
// DirectXInstallWndProc Processes windows messages
|
||||
// DirectXInstall See DINSTALL.CPP
|
||||
// DirectXGetVersion See DINSTALL.CPP
|
||||
// DirectXInstall See DINSTALL.CPP
|
||||
// DlgProc Handles all messages for our modeless MessageBox()
|
||||
// SetButtons Initializes the text of the dialog buttons to mimmic MessageBox()
|
||||
// ShowButton Helper function to get and set the text of a button from resource strings
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <windows.h>
|
||||
#include <basetsd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <dsetup.h>
|
||||
#include "resource.h"
|
||||
#include "DXInstall.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
DWORD g_dwStatus = SHOW_ALL; // Filter setting for messages from DirectXSetup
|
||||
HINSTANCE g_hInstance; // Global instance handle
|
||||
HWND g_hDlg = NULL; // Window handle to dialog proc
|
||||
CHAR g_strAppTitle[256]; // Application title
|
||||
INT g_iReply = -1; // Global value for dialog return
|
||||
BOOL g_bCheckOlder = FALSE; // Whether or not to check for older installs
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: ShowButton()
|
||||
// Desc: Helper function to get and set the text of a button from the
|
||||
// resource strings.
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID ShowButton( HWND hDlg, int Id, int strid )
|
||||
{
|
||||
HWND btnHwd = GetDlgItem( hDlg, Id );
|
||||
CHAR buf[20];
|
||||
|
||||
LoadString( g_hInstance, strid, buf, 20 );
|
||||
SetWindowText( btnHwd, buf );
|
||||
ShowWindow( btnHwd, SW_NORMAL );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: SetButtons()
|
||||
// Desc: Initializes the text of the dialog buttons to mimmic MessageBox()
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID SetButtons( HWND hDlg, DWORD wMsgType )
|
||||
{
|
||||
LONG dwStyle;
|
||||
|
||||
switch( wMsgType & 0x0000000F )
|
||||
{
|
||||
case MB_OKCANCEL:
|
||||
ShowButton( hDlg, IDBUT1, STR_OK );
|
||||
ShowButton( hDlg, IDBUT2, STR_CANCEL );
|
||||
ShowWindow( GetDlgItem( hDlg, IDBUT3 ), SW_HIDE );
|
||||
break;
|
||||
|
||||
case MB_OK:
|
||||
ShowButton( hDlg, IDBUT3, STR_OK );
|
||||
break;
|
||||
|
||||
case MB_RETRYCANCEL:
|
||||
ShowButton( hDlg, IDBUT1, STR_RETRY );
|
||||
ShowButton( hDlg, IDBUT2, STR_CANCEL );
|
||||
ShowWindow( GetDlgItem( hDlg, IDBUT3 ), SW_HIDE );
|
||||
break;
|
||||
|
||||
case MB_ABORTRETRYIGNORE:
|
||||
ShowButton( hDlg, IDBUT1, STR_ABORT );
|
||||
ShowButton( hDlg, IDBUT3, STR_RETRY );
|
||||
ShowButton( hDlg, IDBUT2, STR_IGNORE );
|
||||
break;
|
||||
|
||||
case MB_YESNOCANCEL:
|
||||
ShowButton( hDlg, IDBUT1, STR_YES );
|
||||
ShowButton( hDlg, IDBUT3, STR_NO );
|
||||
ShowButton( hDlg, IDBUT2, STR_CANCEL );
|
||||
break;
|
||||
|
||||
case MB_YESNO:
|
||||
ShowButton( hDlg, IDBUT1, STR_YES );
|
||||
ShowButton( hDlg, IDBUT2, STR_NO );
|
||||
ShowWindow( GetDlgItem( hDlg, IDBUT3 ), SW_HIDE );
|
||||
break;
|
||||
|
||||
default:
|
||||
ShowWindow( GetDlgItem( hDlg, IDBUT1 ), SW_HIDE );
|
||||
ShowWindow( GetDlgItem( hDlg, IDBUT2 ), SW_HIDE );
|
||||
ShowWindow( GetDlgItem( hDlg, IDBUT3 ), SW_HIDE );
|
||||
break;
|
||||
}
|
||||
|
||||
if( !(wMsgType & MB_DEFBUTTON2) )
|
||||
{
|
||||
dwStyle = GetWindowLong( GetDlgItem( hDlg, IDBUT2 ), GWL_STYLE );
|
||||
SendMessage( GetDlgItem( hDlg, IDBUT2 ), BM_SETSTYLE, dwStyle & ~BS_DEFPUSHBUTTON, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
dwStyle = GetWindowLong(GetDlgItem( hDlg, IDBUT2 ), GWL_STYLE);
|
||||
SendMessage( GetDlgItem( hDlg, IDBUT2 ), BM_SETSTYLE, dwStyle | BS_DEFPUSHBUTTON, 0 );
|
||||
}
|
||||
|
||||
if (!(wMsgType & MB_DEFBUTTON3))
|
||||
{
|
||||
dwStyle = GetWindowLong( GetDlgItem( hDlg, IDBUT3 ), GWL_STYLE);
|
||||
SendMessage( GetDlgItem( hDlg, IDBUT3 ), BM_SETSTYLE, dwStyle & ~BS_DEFPUSHBUTTON, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
dwStyle = GetWindowLong( GetDlgItem( hDlg, IDBUT3 ), GWL_STYLE);
|
||||
SendMessage( GetDlgItem( hDlg, IDBUT3 ), BM_SETSTYLE, dwStyle | BS_DEFPUSHBUTTON, 0 );
|
||||
}
|
||||
|
||||
if (!(wMsgType & MB_DEFBUTTON3) && !(wMsgType & MB_DEFBUTTON2))
|
||||
{
|
||||
dwStyle = GetWindowLong( GetDlgItem( hDlg, IDBUT1 ), GWL_STYLE);
|
||||
SendMessage( GetDlgItem( hDlg, IDBUT1 ), BM_SETSTYLE, dwStyle | BS_DEFPUSHBUTTON, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
dwStyle = GetWindowLong( GetDlgItem( hDlg, IDBUT1 ), GWL_STYLE );
|
||||
SendMessage( GetDlgItem( hDlg, IDBUT1 ), BM_SETSTYLE, dwStyle & ~BS_DEFPUSHBUTTON, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: DlgProc()
|
||||
// Desc: Message proc for our modeless version of MessageBox()
|
||||
// This function sets g_wReply for GetReply()
|
||||
//-----------------------------------------------------------------------------
|
||||
DLGPROC DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( msg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SetButtons( hDlg, -1 );
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDBUT1:
|
||||
case IDBUT2:
|
||||
case IDBUT3:
|
||||
// Let GetReply() know the user clicked on a button
|
||||
g_iReply = LOWORD(wParam);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case WM_ACTIVATE:
|
||||
if( LOWORD(wParam) == WA_INACTIVE )
|
||||
{
|
||||
if( (HWND)lParam == GetParent( hDlg ) )
|
||||
{
|
||||
SetForegroundWindow( hDlg );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: SetStatusChecks()
|
||||
// Desc: Helper function to set checkmarks by status menu items
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID SetStatusChecks( HWND hWnd )
|
||||
{
|
||||
CheckMenuItem( GetMenu( hWnd ), IDSHOWALL, MF_BYCOMMAND|MF_UNCHECKED );
|
||||
CheckMenuItem( GetMenu( hWnd ), IDSHOWUPGRADES, MF_BYCOMMAND|MF_UNCHECKED );
|
||||
CheckMenuItem( GetMenu( hWnd ), IDSHOWPROBLEMS, MF_BYCOMMAND|MF_UNCHECKED );
|
||||
CheckMenuItem( GetMenu( hWnd ), IDSHOWNOTHING, MF_BYCOMMAND|MF_UNCHECKED );
|
||||
|
||||
switch( g_dwStatus )
|
||||
{
|
||||
case SHOW_ALL:
|
||||
CheckMenuItem( GetMenu( hWnd ), IDSHOWALL, MF_BYCOMMAND|MF_CHECKED );
|
||||
break;
|
||||
case SHOW_UPGRADES:
|
||||
CheckMenuItem( GetMenu( hWnd ), IDSHOWUPGRADES, MF_BYCOMMAND|MF_CHECKED );
|
||||
break;
|
||||
case SHOW_PROBLEMS:
|
||||
CheckMenuItem( GetMenu( hWnd ), IDSHOWPROBLEMS, MF_BYCOMMAND|MF_CHECKED );
|
||||
break;
|
||||
case SHOW_NONE:
|
||||
CheckMenuItem( GetMenu( hWnd ), IDSHOWNOTHING, MF_BYCOMMAND|MF_CHECKED );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: DirectXInstallWndProc()
|
||||
// Desc: Processes windows messages
|
||||
//-----------------------------------------------------------------------------
|
||||
INT_PTR CALLBACK DirectXInstallWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( msg )
|
||||
{
|
||||
case WM_COMMAND:
|
||||
// Process menu items
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDINSTALL:
|
||||
DirectXInstall( hWnd );
|
||||
break;
|
||||
case IDGETVERSION:
|
||||
DirectXGetVersion();
|
||||
break;
|
||||
case IDEXIT:
|
||||
DestroyWindow( hWnd );
|
||||
break;
|
||||
case IDSHOWALL:
|
||||
g_dwStatus = SHOW_ALL;
|
||||
SetStatusChecks( hWnd );
|
||||
break;
|
||||
case IDSHOWUPGRADES:
|
||||
g_dwStatus = SHOW_UPGRADES;
|
||||
SetStatusChecks( hWnd );
|
||||
break;
|
||||
case IDSHOWPROBLEMS:
|
||||
g_dwStatus = SHOW_PROBLEMS;
|
||||
SetStatusChecks( hWnd );
|
||||
break;
|
||||
case IDSHOWNOTHING:
|
||||
g_dwStatus = SHOW_NONE;
|
||||
SetStatusChecks( hWnd );
|
||||
break;
|
||||
case IDCHECKOLDERINSTALL:
|
||||
g_bCheckOlder = !g_bCheckOlder;
|
||||
CheckMenuItem( GetMenu(hWnd), IDCHECKOLDERINSTALL,
|
||||
MF_BYCOMMAND|MF_CHECKED );
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage( 0 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DefWindowProc( hWnd, msg, wParam, lParam );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: DirectXInstallInit()
|
||||
// Desc: Initializes window data and registers window class
|
||||
// Sets up a structure to register the window class. Structure includes
|
||||
// such information as what function will process messages, what cursor
|
||||
// and icon to use, etc.
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL DirectXInstallInit( HINSTANCE hInstance )
|
||||
{
|
||||
WNDCLASS wndClass; // structure pointer
|
||||
ZeroMemory( &wndClass, sizeof(WNDCLASS) );
|
||||
wndClass.style = CS_GLOBALCLASS;
|
||||
wndClass.lpfnWndProc = (WNDPROC) DirectXInstallWndProc;
|
||||
wndClass.hInstance = hInstance;
|
||||
wndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAIN_ICON));
|
||||
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
|
||||
wndClass.lpszMenuName = "MainMenu";
|
||||
wndClass.lpszClassName = (LPSTR) "DirectXInstall";
|
||||
|
||||
// Returns result of registering the window
|
||||
return RegisterClass( &wndClass );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: WinMain()
|
||||
// Desc: Calls initialization function, processes message loop
|
||||
// This will initialize the window class if it is the first time this
|
||||
// application is run. It then creates the window, and processes the
|
||||
// message loop until a PostQuitMessage is received. It exits the
|
||||
// application by returning the value passed by the PostQuitMessage.
|
||||
//-----------------------------------------------------------------------------
|
||||
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR strCmdLine, int nCmdShow )
|
||||
{
|
||||
// Has application been initialized?
|
||||
if( NULL == hPrevInstance )
|
||||
if( 0 == DirectXInstallInit( hInstance ) )
|
||||
return 0;
|
||||
|
||||
g_hInstance = hInstance;
|
||||
|
||||
HWND hWnd = CreateWindow( "DirectXInstall", "DirectX Install",
|
||||
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
NULL, NULL, g_hInstance, NULL );
|
||||
if( NULL == hWnd )
|
||||
return 0;
|
||||
|
||||
LoadString( g_hInstance, STR_TITLE, g_strAppTitle, 200 );
|
||||
ShowWindow( hWnd, SW_NORMAL );
|
||||
UpdateWindow( hWnd ); // Send a WM_PAINT message
|
||||
SetStatusChecks( hWnd ); // Check the default message menu item
|
||||
|
||||
MSG msg;
|
||||
while( GetMessage( &msg, NULL, 0, 0 ) )
|
||||
{
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
|
||||
// Returns the value from PostQuitMessage
|
||||
return (int)msg.wParam;
|
||||
}
|
||||
77
Library/dxx8/samples/Multimedia/Misc/GetDXVer/dxver.cpp
Normal file
77
Library/dxx8/samples/Multimedia/Misc/GetDXVer/dxver.cpp
Normal file
@@ -0,0 +1,77 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: DXVer.cpp
|
||||
//
|
||||
// Desc: Windows code that calls GetDXVersion and displays the results.
|
||||
//
|
||||
// (C) Copyright 1995-2001 Microsoft Corp. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// External function-prototypes
|
||||
//-----------------------------------------------------------------------------
|
||||
extern DWORD GetDXVersion();
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: WinMain()
|
||||
// Desc: Entry point to the program. Initializes everything, and pops
|
||||
// up a message box with the results of the GetDXVersion call
|
||||
//-----------------------------------------------------------------------------
|
||||
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR strCmdLine, int nCmdShow )
|
||||
{
|
||||
TCHAR* strResult;
|
||||
DWORD dwDXVersion = GetDXVersion();
|
||||
|
||||
switch( dwDXVersion )
|
||||
{
|
||||
case 0x000:
|
||||
strResult = _T("No DirectX installed" );
|
||||
break;
|
||||
case 0x100:
|
||||
strResult = _T("DirectX 1 installed" );
|
||||
break;
|
||||
case 0x200:
|
||||
strResult = _T("DirectX 2 installed" );
|
||||
break;
|
||||
case 0x300:
|
||||
strResult = _T("DirectX 3 installed" );
|
||||
break;
|
||||
case 0x500:
|
||||
strResult = _T("DirectX 5 installed" );
|
||||
break;
|
||||
case 0x600:
|
||||
strResult = _T("DirectX 6 installed" );
|
||||
break;
|
||||
case 0x601:
|
||||
strResult = _T("DirectX 6.1 installed" );
|
||||
break;
|
||||
case 0x700:
|
||||
strResult = _T("DirectX 7" );
|
||||
break;
|
||||
case 0x800:
|
||||
strResult = _T("DirectX 8.0 installed" );
|
||||
break;
|
||||
case 0x801:
|
||||
strResult = _T("DirectX 8.1 or better installed" );
|
||||
break;
|
||||
default:
|
||||
strResult = _T("Unknown version of DirectX installed." );
|
||||
break;
|
||||
}
|
||||
|
||||
MessageBox( NULL, strResult, "DirectX Version:",
|
||||
MB_OK | MB_ICONINFORMATION );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
315
Library/dxx8/samples/Multimedia/Misc/GetDXVer/getdxver.cpp
Normal file
315
Library/dxx8/samples/Multimedia/Misc/GetDXVer/getdxver.cpp
Normal file
@@ -0,0 +1,315 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: GetDXVer.cpp
|
||||
//
|
||||
// Desc: Demonstrates how applications can detect what version of DirectX
|
||||
// is installed.
|
||||
//
|
||||
// (C) Copyright 1995-2001 Microsoft Corp. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <basetsd.h>
|
||||
#include <ddraw.h>
|
||||
#include <dinput.h>
|
||||
#include <dmusici.h>
|
||||
|
||||
|
||||
|
||||
|
||||
typedef HRESULT(WINAPI * DIRECTDRAWCREATE)( GUID*, LPDIRECTDRAW*, IUnknown* );
|
||||
typedef HRESULT(WINAPI * DIRECTDRAWCREATEEX)( GUID*, VOID**, REFIID, IUnknown* );
|
||||
typedef HRESULT(WINAPI * DIRECTINPUTCREATE)( HINSTANCE, DWORD, LPDIRECTINPUT*,
|
||||
IUnknown* );
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: GetDXVersion()
|
||||
// Desc: This function returns the DirectX version number as follows:
|
||||
// 0x0000 = No DirectX installed
|
||||
// 0x0100 = DirectX version 1 installed
|
||||
// 0x0200 = DirectX 2 installed
|
||||
// 0x0300 = DirectX 3 installed
|
||||
// 0x0500 = At least DirectX 5 installed.
|
||||
// 0x0600 = At least DirectX 6 installed.
|
||||
// 0x0601 = At least DirectX 6.1 installed.
|
||||
// 0x0700 = At least DirectX 7 installed.
|
||||
// 0x0800 = At least DirectX 8 installed.
|
||||
//
|
||||
// Please note that this code is intended as a general guideline. Your
|
||||
// app will probably be able to simply query for functionality (via
|
||||
// QueryInterface) for one or two components.
|
||||
//
|
||||
// Please also note:
|
||||
// "if( dwDXVersion != 0x500 ) return FALSE;" is VERY BAD.
|
||||
// "if( dwDXVersion < 0x500 ) return FALSE;" is MUCH BETTER.
|
||||
// to ensure your app will run on future releases of DirectX.
|
||||
//-----------------------------------------------------------------------------
|
||||
DWORD GetDXVersion()
|
||||
{
|
||||
DIRECTDRAWCREATE DirectDrawCreate = NULL;
|
||||
DIRECTDRAWCREATEEX DirectDrawCreateEx = NULL;
|
||||
DIRECTINPUTCREATE DirectInputCreate = NULL;
|
||||
HINSTANCE hDDrawDLL = NULL;
|
||||
HINSTANCE hDInputDLL = NULL;
|
||||
HINSTANCE hD3D8DLL = NULL;
|
||||
HINSTANCE hDPNHPASTDLL = NULL;
|
||||
LPDIRECTDRAW pDDraw = NULL;
|
||||
LPDIRECTDRAW2 pDDraw2 = NULL;
|
||||
LPDIRECTDRAWSURFACE pSurf = NULL;
|
||||
LPDIRECTDRAWSURFACE3 pSurf3 = NULL;
|
||||
LPDIRECTDRAWSURFACE4 pSurf4 = NULL;
|
||||
DWORD dwDXVersion = 0;
|
||||
HRESULT hr;
|
||||
|
||||
// First see if DDRAW.DLL even exists.
|
||||
hDDrawDLL = LoadLibrary( "DDRAW.DLL" );
|
||||
if( hDDrawDLL == NULL )
|
||||
{
|
||||
dwDXVersion = 0;
|
||||
OutputDebugString( "Couldn't LoadLibrary DDraw\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// See if we can create the DirectDraw object.
|
||||
DirectDrawCreate = (DIRECTDRAWCREATE)GetProcAddress( hDDrawDLL, "DirectDrawCreate" );
|
||||
if( DirectDrawCreate == NULL )
|
||||
{
|
||||
dwDXVersion = 0;
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't GetProcAddress DirectDrawCreate\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
hr = DirectDrawCreate( NULL, &pDDraw, NULL );
|
||||
if( FAILED(hr) )
|
||||
{
|
||||
dwDXVersion = 0;
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't create DDraw\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// So DirectDraw exists. We are at least DX1.
|
||||
dwDXVersion = 0x100;
|
||||
|
||||
// Let's see if IID_IDirectDraw2 exists.
|
||||
hr = pDDraw->QueryInterface( IID_IDirectDraw2, (VOID**)&pDDraw2 );
|
||||
if( FAILED(hr) )
|
||||
{
|
||||
// No IDirectDraw2 exists... must be DX1
|
||||
pDDraw->Release();
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't QI DDraw2\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// IDirectDraw2 exists. We must be at least DX2
|
||||
pDDraw2->Release();
|
||||
dwDXVersion = 0x200;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// DirectX 3.0 Checks
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// DirectInput was added for DX3
|
||||
hDInputDLL = LoadLibrary( "DINPUT.DLL" );
|
||||
if( hDInputDLL == NULL )
|
||||
{
|
||||
// No DInput... must not be DX3
|
||||
pDDraw->Release();
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't LoadLibrary DInput\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
DirectInputCreate = (DIRECTINPUTCREATE)GetProcAddress( hDInputDLL,
|
||||
"DirectInputCreateA" );
|
||||
if( DirectInputCreate == NULL )
|
||||
{
|
||||
// No DInput... must be DX2
|
||||
FreeLibrary( hDInputDLL );
|
||||
pDDraw->Release();
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't GetProcAddress DInputCreate\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// DirectInputCreate exists. We are at least DX3
|
||||
dwDXVersion = 0x300;
|
||||
FreeLibrary( hDInputDLL );
|
||||
|
||||
// Can do checks for 3a vs 3b here
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// DirectX 5.0 Checks
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// We can tell if DX5 is present by checking for the existence of
|
||||
// IDirectDrawSurface3. First, we need a surface to QI off of.
|
||||
DDSURFACEDESC ddsd;
|
||||
ZeroMemory( &ddsd, sizeof(ddsd) );
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
ddsd.dwFlags = DDSD_CAPS;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
||||
|
||||
hr = pDDraw->SetCooperativeLevel( NULL, DDSCL_NORMAL );
|
||||
if( FAILED(hr) )
|
||||
{
|
||||
// Failure. This means DDraw isn't properly installed.
|
||||
pDDraw->Release();
|
||||
FreeLibrary( hDDrawDLL );
|
||||
dwDXVersion = 0;
|
||||
OutputDebugString( "Couldn't Set coop level\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
hr = pDDraw->CreateSurface( &ddsd, &pSurf, NULL );
|
||||
if( FAILED(hr) )
|
||||
{
|
||||
// Failure. This means DDraw isn't properly installed.
|
||||
pDDraw->Release();
|
||||
FreeLibrary( hDDrawDLL );
|
||||
dwDXVersion = 0;
|
||||
OutputDebugString( "Couldn't CreateSurface\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// Query for the IDirectDrawSurface3 interface
|
||||
if( FAILED( pSurf->QueryInterface( IID_IDirectDrawSurface3,
|
||||
(VOID**)&pSurf3 ) ) )
|
||||
{
|
||||
pSurf->Release();
|
||||
pDDraw->Release();
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't QI DDS3\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// QI for IDirectDrawSurface3 succeeded. We must be at least DX5
|
||||
dwDXVersion = 0x500;
|
||||
pSurf3->Release();
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// DirectX 6.0 Checks
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// The IDirectDrawSurface4 interface was introduced with DX 6.0
|
||||
if( FAILED( pSurf->QueryInterface( IID_IDirectDrawSurface4,
|
||||
(VOID**)&pSurf4 ) ) )
|
||||
{
|
||||
pSurf->Release();
|
||||
pDDraw->Release();
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't QI DDS4\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// IDirectDrawSurface4 was create successfully. We must be at least DX6
|
||||
dwDXVersion = 0x600;
|
||||
pSurf4->Release();
|
||||
pSurf->Release();
|
||||
pDDraw->Release();
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// DirectX 6.1 Checks
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Check for DMusic, which was introduced with DX6.1
|
||||
LPDIRECTMUSIC pDMusic = NULL;
|
||||
CoInitialize( NULL );
|
||||
hr = CoCreateInstance( CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_IDirectMusic, (VOID**)&pDMusic );
|
||||
if( FAILED(hr) )
|
||||
{
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't create CLSID_DirectMusic\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// DirectMusic was created successfully. We must be at least DX6.1
|
||||
dwDXVersion = 0x601;
|
||||
pDMusic->Release();
|
||||
CoUninitialize();
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// DirectX 7.0 Checks
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Check for DirectX 7 by creating a DDraw7 object
|
||||
LPDIRECTDRAW7 pDD7;
|
||||
DirectDrawCreateEx = (DIRECTDRAWCREATEEX)GetProcAddress( hDDrawDLL,
|
||||
"DirectDrawCreateEx" );
|
||||
if( NULL == DirectDrawCreateEx )
|
||||
{
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't GetProcAddress DirectDrawCreateEx\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
if( FAILED( DirectDrawCreateEx( NULL, (VOID**)&pDD7, IID_IDirectDraw7,
|
||||
NULL ) ) )
|
||||
{
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't DirectDrawCreateEx\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// DDraw7 was created successfully. We must be at least DX7.0
|
||||
dwDXVersion = 0x700;
|
||||
pDD7->Release();
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// DirectX 8.0 Checks
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Simply see if D3D8.dll exists.
|
||||
hD3D8DLL = LoadLibrary( "D3D8.DLL" );
|
||||
if( hD3D8DLL == NULL )
|
||||
{
|
||||
FreeLibrary( hDDrawDLL );
|
||||
OutputDebugString( "Couldn't LoadLibrary D3D8.DLL\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// D3D8.dll exists. We must be at least DX8.0
|
||||
dwDXVersion = 0x800;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// DirectX 8.1 Checks
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Simply see if dpnhpast.dll exists.
|
||||
hDPNHPASTDLL = LoadLibrary( "dpnhpast.dll" );
|
||||
if( hDPNHPASTDLL == NULL )
|
||||
{
|
||||
FreeLibrary( hDPNHPASTDLL );
|
||||
OutputDebugString( "Couldn't LoadLibrary dpnhpast.dll\r\n" );
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
// dpnhpast.dll exists. We must be at least DX8.1
|
||||
dwDXVersion = 0x801;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// End of checking for versions of DirectX
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Close open libraries and return
|
||||
FreeLibrary( hDDrawDLL );
|
||||
FreeLibrary( hD3D8DLL );
|
||||
|
||||
return dwDXVersion;
|
||||
}
|
||||
|
||||
|
||||
|
||||
111
Library/dxx8/samples/Multimedia/Misc/GetDXVer/getdxver.dsp
Normal file
111
Library/dxx8/samples/Multimedia/Misc/GetDXVer/getdxver.dsp
Normal file
@@ -0,0 +1,111 @@
|
||||
# Microsoft Developer Studio Project File - Name="GetDXVer" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=GetDXVer - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "GetDXVer.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "GetDXVer.mak" CFG="GetDXVer - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "GetDXVer - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "GetDXVer - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "GetDXVer - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib uuid.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
|
||||
|
||||
!ELSEIF "$(CFG)" == "GetDXVer - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "GetDXVer - Win32 Release"
|
||||
# Name "GetDXVer - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dxver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\getdxver.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
29
Library/dxx8/samples/Multimedia/Misc/GetDXVer/getdxver.dsw
Normal file
29
Library/dxx8/samples/Multimedia/Misc/GetDXVer/getdxver.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "GetDXVer"=.\getdxver.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
198
Library/dxx8/samples/Multimedia/Misc/GetDXVer/getdxver.mak
Normal file
198
Library/dxx8/samples/Multimedia/Misc/GetDXVer/getdxver.mak
Normal file
@@ -0,0 +1,198 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on getdxver.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=GetDXVer - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to GetDXVer - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "GetDXVer - Win32 Release" && "$(CFG)" != "GetDXVer - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "getdxver.mak" CFG="GetDXVer - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "GetDXVer - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "GetDXVer - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "GetDXVer - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\getdxver.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\dxver.obj"
|
||||
-@erase "$(INTDIR)\getdxver.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\getdxver.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\getdxver.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\getdxver.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib uuid.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\getdxver.pdb" /machine:I386 /out:"$(OUTDIR)\getdxver.exe" /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\dxver.obj" \
|
||||
"$(INTDIR)\getdxver.obj"
|
||||
|
||||
"$(OUTDIR)\getdxver.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "GetDXVer - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\getdxver.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\dxver.obj"
|
||||
-@erase "$(INTDIR)\getdxver.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\getdxver.exe"
|
||||
-@erase "$(OUTDIR)\getdxver.ilk"
|
||||
-@erase "$(OUTDIR)\getdxver.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\getdxver.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\getdxver.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib uuid.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\getdxver.pdb" /debug /machine:I386 /out:"$(OUTDIR)\getdxver.exe" /pdbtype:sept /stack:0x200000,0x200000
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\dxver.obj" \
|
||||
"$(INTDIR)\getdxver.obj"
|
||||
|
||||
"$(OUTDIR)\getdxver.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("getdxver.dep")
|
||||
!INCLUDE "getdxver.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "getdxver.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "GetDXVer - Win32 Release" || "$(CFG)" == "GetDXVer - Win32 Debug"
|
||||
SOURCE=.\dxver.cpp
|
||||
|
||||
"$(INTDIR)\dxver.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\getdxver.cpp
|
||||
|
||||
"$(INTDIR)\getdxver.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
18
Library/dxx8/samples/Multimedia/Misc/GetDXVer/readme.txt
Normal file
18
Library/dxx8/samples/Multimedia/Misc/GetDXVer/readme.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: Readme.txt
|
||||
//
|
||||
// Desc: Readme for GetDXVersion() sample
|
||||
//
|
||||
// Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
The purpose of this sample is to show the return results from a call to the
|
||||
function GetDXVersion(). When you run GETDXVER.EXE, it will display a MessageBox
|
||||
with the installed DirectX version.
|
||||
|
||||
You can determine which version of DirectX is installed on a system by
|
||||
thoroughly querying for various DirectX object interfaces. The GetDXVersion
|
||||
sample function shows one way this might be done. However, real-world
|
||||
applications should not rely on this function, and should always query the
|
||||
DirectX objects for all necessary functionality during startup.
|
||||
|
||||
Reference in New Issue
Block a user