Hi Marc,
From your description, I feel unsure what type of monitor you are trying to draw on. Could you try following code, post what it outputs in this thread and point out which monitor you are going to draw please? //-------------------------------------------------------------------------- ----
int _tmain(int argc, _TCHAR* argv[])
{
BOOL bRet = FALSE;
DWORD dwNum =0;
vector< DISPLAY_DEVICE> dispVec;
do {
DISPLAY_DEVICE disp;
disp.cb = sizeof( DISPLAY_DEVICE );
bRet = EnumDisplayDevices(NULL,dwNum,&disp,0);
if( bRet)
dispVec.push_back(disp);
dwNum++;
} while(bRet);
vector<DISPLAY_DEVICE>::iterator it = dispVec.begin();
vector<DISPLAY_DEVICE>::iterator it_end = dispVec.end();
cout<<endl<<"* * * * * * Enumerate Monitor Devices * * * * * *"<<endl;
for ( ; it != it_end ; it++ )
{
cout<<"********************************************************************* ****"<<endl;
cout<<"DeviceName:\t" <<(*it).DeviceName << endl;
cout<< "DeviceString:\t"<<(*it).DeviceString << endl;
cout<<"StateFlag:\t"<<hex<<(*it).StateFlags<<endl;
cout<<"DeviceID:\t" <<(*it).DeviceID<<endl;
// code to obtain the monitor name
DISPLAY_DEVICE monInfo;
monInfo.cb = sizeof( DISPLAY_DEVICE );
if (EnumDisplayDevices(dispVec[0].DeviceName,0,&monInfo,0))
{
cout<< "Monitor name is :"<< monInfo.DeviceString <<endl;
}
cout<<"********************************************************************* ****"<<endl;
}
//.......Cleanup ...
} //-------------------------------------------------------------------------- -------
Best regards,
Rhett Gong [MSFT]
Microsoft Online Partner Support
This posting is provided "AS IS" with no warranties, and confers no rights. Please reply to newsgroups only. Thanks.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 294 |
Nodes: | 16 (2 / 14) |
Uptime: | 247:01:57 |
Calls: | 6,626 |
Calls today: | 2 |
Files: | 12,175 |
Messages: | 5,320,795 |