以下是VC dirctdraw取得双显卡的片段,我的目的是以delphi取得两个显卡的guid从而建立两个表面,再向它们输出文字、图像。
哪位有这样的测试程序。
GUID g_Guid,g_Mulguid;
//-----------------------------------------------------------------------------
BOOL WINAPI DDEnumCallbackEx( GUID* pGuid, LPTSTR pszDesc, LPTSTR pszDriverName,
              OID* pContext, HMONITOR hmon )
{
    EnumInfo* pEnumInfo = (EnumInfo*)pContext;
 
 GUID guidNull;
 ZeroMemory(&guidNull, sizeof(guidNull)); if (pGuid != NULL && g_Guid != guidNull)
   g_Mulguid = *pGuid; if (pGuid != NULL && g_Guid == guidNull)
   g_Guid = *pGuid;    return TRUE; // Keep enumerating
}//-----------------------------------------------------------------------------
// Name: EnumerateScreens()
// Desc: Creates a Screen structure for every appropriate screen in the user's
//       computer.  
//-----------------------------------------------------------------------------
HRESULT EnumerateScreens()
{
    HRESULT  hr;
    EnumInfo enumInfo;
 
    ZeroMemory( &enumInfo, sizeof(enumInfo) );
    enumInfo.bMultimonSupported = TRUE;
 
    if( FAILED( hr = DirectDrawEnumerateEx( DDEnumCallbackEx, 
   &enumInfo, DDENUM_ATTACHEDSECONDARYDEVICES ) ) )
        return hr;
 
    // If something failed inside the enumeration, be sure to return that RESULT
    if( FAILED(enumInfo.hr) )
        return enumInfo.hr;
    return S_OK;
}
在msdn上没有找到DirectDrawEnumerateEx的例子,谢谢了。