I have this function:
I call Title() before the main windows loop, like this:Code:void Title() { int width; int height; HDC hDC = GetDC(hWnd); RECT rcClient; GetClientRect(hWnd, &rcClient); HDC hDCBuffer = CreateCompatibleDC(hDC); HBITMAP hbmOldBuffer = (HBITMAP)SelectObject(hDCBuffer, c); //InvalidateRect(hWnd, &rcClient, TRUE); BitBlt(hDC, 0, 0, rcClient.right, rcClient.bottom, hDCBuffer, 0, 0, SRCPAINT); //InvalidateRect(hWnd, &rcClient, TRUE); PlaySound("intro.wav", NULL, SND_FILENAME); }
should this display anything onto the screen? for some reason, it doesn't. What did I do wrong?Code://....... ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); Title(); PlaySound("intro.wav", NULL, SND_FILENAME); PlaySound("music1.wav", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP); //Working example //PlaySound("a.wav", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP); // Step 3: The Message Loop for(;;) { if(newgame == true) { players = GetPlayers(*phWnd); SetPlayers(); newgame = false; finished = false; SetQuestions(); } GetMessage(&Msg, NULL, 0, 0); if(Msg.message == WM_QUIT || Msg.message == WM_DESTROY) break; TranslateMessage(&Msg); DispatchMessage(&Msg); if(finished == false) MainLoop(*phWnd, players); else if(endone == false) End(); } return Msg.wParam; }



LinkBack URL
About LinkBacks


