} else if (mode == BELL_PCSPEAKER) { static long lastbeep = 0; long beepdiff;  beepdiff = GetTickCount() - lastbeep; if (beepdiff >= 0 && beepdiff < 50) return;   if(osVersion.dwPlatformId == VER_PLATFORM_WIN32_NT) Beep(800, 100); else MessageBeep(-1); lastbeep = GetTickCount();
void beep(void *frontend, int mode){    if (mode == BELL_DEFAULT) {	/*	 * For MessageBeep style bells, we want to be careful of	 * timing, because they don't have the nice property of	 * PlaySound bells that each one cancels the previous	 * active one. So we limit the rate to one per 50ms or so.	 */	static long lastbeep = 0;	long beepdiff;	beepdiff = GetTickCount() - lastbeep;	if (beepdiff >= 0 && beepdiff < 50)	    return;	MessageBeep(MB_OK);	/*	 * The above MessageBeep call takes time, so we record the	 * time _after_ it finishes rather than before it starts.	 */	lastbeep = GetTickCount();    } else if (mode == BELL_WAVEFILE) {	if (!PlaySound(cfg.bell_wavefile.path, NULL,		       SND_ASYNC | SND_FILENAME)) {	    char buf[sizeof(cfg.bell_wavefile) + 80];	    char otherbuf[100];	    sprintf(buf, "Unable to play sound file\n%s\n"		    "Using default sound instead", cfg.bell_wavefile);	    sprintf(otherbuf, "%.70s Sound Error", appname);	    MessageBox(hwnd, buf, otherbuf,		       MB_OK | MB_ICONEXCLAMATION);	    cfg.beep = BELL_DEFAULT;	}    }    /* Otherwise, either visual bell or disabled; do nothing here */    if (!term->has_focus) {	flash_window(2);	       /* start */    }}