PPT Slide
//Check if any messages were received from the other player
hr = lpDirectPlay1->Receive(lpmsgFrom, lpmsgTo, DPRECEIVE_ALL, pMessage, &msgSize);
if(SUCCEEDED(hr)) //If yes, ...
// Update his coordinates
//Erase the back buffer to remove 'Hello World!' from previous position
ddbltfx.dwSize = sizeof( ddbltfx );
ddbltfx.dwFillColor = PALETTEINDEX(0);
hr = lpBackBuffer->Blt( NULL,
DDBLT_COLORFILL | DDBLT_WAIT,
if(lpBackBuffer->GetDC(&hdc) == DD_OK)
GetTextExtentPoint32(hdc, msg, strlen(msg), &size );
if(strcmp(direction,"UP")==0) //If UP arrow was pressed
if(strcmp(direction,"DOWN")==0) //If DOWN arrow was pressed
if((y+size.cy) < window_height) y+=ychange;
if(strcmp(direction,"LEFT")==0) //If LEFT arrow was pressed
if(strcmp(direction,"RIGHT")==0) //If RIGHT arrow was pressed
if((x+size.cx) < window_width) x+=xchange;