It is possible to pass in presentation parameters when creating a window, using WinCreateWindow. The last parameter pPresParams is a pointer to a PRESPARAMS structure containing an array of PARAM structures, which in turn contain the presentation parameter indexes and values. The size field in PRESPARAMS should be set to the size of the array being passed.
/*******************************************************************/ /* Set a presentation parameter when creating a window */ /*******************************************************************/ PPRESPARAMS ppresMain; lColor = RGB_RED; /*******************************************************************/ /* Allocate space for PRESPARAMS structure and one presparam */ /*******************************************************************/ ppresMain = (PPRESPARAMS)malloc(sizeof(ULONG) * 4); /*******************************************************************/ /* Set up PRESPARAMS structure with a background color */ /*******************************************************************/ ppresMain->cb = sizeof(ULONG) * 3; ppresMain->aparam[0].id = PP_BACKGROUNDCOLOR; ppresMain->aparam[0].cb = sizeof(lColor); memcpy(&ppresMain->aparam[0].ab, &lColor, sizeof(lColor)); /*******************************************************************/ /* Create the window and pass in the background color presparam */ /*******************************************************************/ hwndMain = WinCreateWindow(hwndFrame, "MainWindow", 0, 0, 0, 0, 0, 0, 0, HWND_TOP, FID_CLIENT, NULL, ppresMain); /* Pass presparam data */