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:
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;
|
||||
}
|
||||
Reference in New Issue
Block a user