本文整理汇总了C++中LPDIRECTDRAW7::GetDeviceIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTDRAW7::GetDeviceIdentifier方法的具体用法?C++ LPDIRECTDRAW7::GetDeviceIdentifier怎么用?C++ LPDIRECTDRAW7::GetDeviceIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTDRAW7
的用法示例。
在下文中一共展示了LPDIRECTDRAW7::GetDeviceIdentifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DDEnumCallbackEx
//-----------------------------------------------------------------------------
// Name: DDEnumCallbackEx()
// Desc: This callback gets the information for each device enumerated
//-----------------------------------------------------------------------------
BOOL WINAPI DDEnumCallbackEx( GUID *pGUID, LPSTR pDescription, LPSTR strName,
LPVOID pContext, HMONITOR hm )
{
LPDIRECTDRAW7 pDD = NULL;
HRESULT hr;
// Create a DirectDraw object using the enumerated GUID
if( FAILED( hr = DirectDrawCreateEx( pGUID, (VOID**)&pDD,
IID_IDirectDraw7, NULL ) ) )
return DDENUMRET_CANCEL;
// Get the device information and save it
pDD->GetDeviceIdentifier( &g_DeviceIdent[g_iMaxDevices].DeviceInfo, 0 );
pDD->GetDeviceIdentifier( &g_DeviceIdent[g_iMaxDevices].DeviceInfoHost,
DDGDI_GETHOSTIDENTIFIER );
// Finished with the DirectDraw object, so release it
SAFE_RELEASE( pDD );
// Bump to the next open slot or finish the callbacks if full
if( g_iMaxDevices < MAX_DEVICES )
g_iMaxDevices++;
else
return DDENUMRET_CANCEL;
return DDENUMRET_OK;
}
示例2: DDEnumCallback
BOOL WINAPI DDEnumCallback( GUID *pGUID, LPSTR pDescription, LPSTR strName,
LPVOID pContext )
{
LPDIRECTDRAW7 pDD = NULL;
HRESULT hr;
if( FAILED( hr = DirectDrawCreateEx( pGUID, (VOID**)&pDD,
IID_IDirectDraw7, NULL ) ) )
return DDENUMRET_CANCEL;
pDD->GetDeviceIdentifier( &DeviceInfo[g_iMaxDevices], 0 );
if(pDD) {
pDD->Release();
pDD = NULL;
}
if( g_iMaxDevices < MAX_DEVICES )
g_iMaxDevices++;
else
return DDENUMRET_CANCEL;
return DDENUMRET_OK;
}