Multiple Monitor Support Code

Published August 15, 2000 by David Stubbs, posted by Myopic Rhino
Do you see issues with this article? Let us know.
Advertisement
This code allows the user to select which video card to use if there are more than one present.

static GUID *gpSelectedDriverGUID;

BOOL WINAPI Callback(
GUID FAR *lpGUID,
LPSTR lpDriverDescription,
LPSTR lpDriverName,
LPVOID lpContext,
HMONITOR hm
)
{
char buffer[256];

if (lpGUID)
{
wsprintf(buffer, "Use the %hs video card?", lpDriverDescription);
if (MessageBoxEx(NULL, buffer, "Avoidance", MB_YESNO, NULL) == IDYES)
{
gpSelectedDriverGUID=lpGUID;
return DDENUMRET_CANCEL;
}
}
return DDENUMRET_OK;
}
And to use the routine in your code:

DirectDrawEnumerateExA(Callback, NULL, DDENUM_ATTACHEDSECONDARYDEVICES |
DDENUM_NONDISPLAYDEVICES | DDENUM_DETACHEDSECONDARYDEVICES);
if (!gpSelectedDriverGUID)
gpSelectedDriverGUID = NULL;
Then when creating the DirectDraw object just call it like this:

DirectDrawCreate(gpSelectedDriverGUID, &lpdd, NULL);
Cancel Save
0 Likes 0 Comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement