• 08/15/00 02:50 PM
    Sign in to follow this  

    Multiple Monitor Support Code

    General and Gameplay Programming

    Myopic Rhino
    This code allows the user to select which video card to use if there are more than one present.

    [indent][code]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;
    }[/code][/indent] And to use the routine in your code:

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

    [indent][code]DirectDrawCreate(gpSelectedDriverGUID, &lpdd, NULL);[/code][/indent]


      Report Article
    Sign in to follow this  


    User Feedback

    Create an account or sign in to leave a review

    You need to be a member in order to leave a review

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    There are no reviews to display.