static int RunExit() { nNormalLast = 0; // Stop sound if it was playing AudSoundStop(); return 0; }
// Show a message box with an error message int AppError(char *szText,int bWarning) { AudSoundStop(); MessageBox(hScrnWnd,szText, bWarning ? APP_TITLE " Warning" : APP_TITLE " Error", MB_OK | (bWarning?MB_ICONWARNING:MB_ICONERROR) ); AudSoundPlay(); return 0; }
void MediaChangeFps(int scale) { nAppVirtualFps = nBaseFps * scale / 100; if (bAudOkay) { if (bAudPlaying) { AudSoundStop(); } if (AudSoundSetFps()) { return; } nBurnSoundRate = nAudSampleRate[0]; nBurnSoundLen = nAudSegLen; AudSoundPlay(); } }
// MOUSE MOVE (DRAG) static int OnMouseMove(HWND /*hwnd*/, int /*x*/, int /*y*/, UINT keyIndicators) { if(bDrag && keyIndicators == MK_LBUTTON && !nVidFullscreen && !bMenuEnabled) { AudSoundStop(); // If UxThemes are active (Windows XP+) or DWM Composition is active if(GetThemeStatus() || IsCompositeOn()) { // Redraw everything on the MDI frame to get accurate calculatations RedrawWindow(hWndChildFrame, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN); } POINT pointer; memset(&pointer, 0, sizeof(POINT)); GetCursorPos(&pointer); nMoveX = pointer.x; nMoveY = pointer.y; // negative (left / up) [-] if((nMoveX < nDownX && nMoveX != 0) || (nMoveY < nDownY && nMoveY != 0)) { nWindowPosX = nOldWindowX - (int)(nDownX - nMoveX); nWindowPosY = nOldWindowY - (int)(nDownY - nMoveY); SetWindowPos(hScrnWnd, NULL, nWindowPosX, nWindowPosY, 0, 0, SWP_NOREPOSITION | SWP_NOSIZE); } // positive (right / down) [+] if((nMoveX > nDownX && nMoveX != 0) || (nMoveY > nDownY && nMoveY != 0)) { nWindowPosX = nOldWindowX + (int)(nMoveX - nDownX); nWindowPosY = nOldWindowY + (int)(nMoveY - nDownY); SetWindowPos(hScrnWnd, NULL, nWindowPosX, nWindowPosY, 0, 0, SWP_NOREPOSITION | SWP_NOSIZE); } AudSoundPlay(); return 0; } return 1; }