⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alarm.c

📁 这是DOS系统的源代码
💻 C
字号:
/*
	COW : Character Oriented Windows
	(COW USER EVENT)

	alarm.c : alarm function
*/

#define COW
#include <cow.h>

#include <uevent.h>
#include <uutil.h>
#include <kinput.h>

#include "event.h"


STATIC DWORD ticksAlarm = 0L;
PUBLIC PWND pwndAlarm = NULL;


PUBLIC VOID FARPUBLIC
SetAlarm(pwnd, ctick)
/*
  -- set alarm to send a WM_ALARM message to window "pwnd" in "ctick" ticks
*/
PWND pwnd;
WORD ctick;
	{
	StartPublic();
	pwndAlarm = pwnd;
	KickTimer((DWORD) ctick);	/* set kick time before finding time */
	ticksAlarm = ClockTicks() + ctick;
	StopPublic();
	}



PUBLIC VOID FARPUBLIC
KillAlarm()
	{
	StartPublic();
	pwndAlarm = NULL;
	KickTimer(ctickIdle);			/* idle timer thread */
	StopPublic();
	}



PRIVATE BOOL FARPRIVATE
FCheckAlarm(pmsg)
MSG *pmsg;
	{
	if (pwndAlarm != NULL && ClockTicks() >= ticksAlarm) 
		{
		pmsg->pwnd = pwndAlarm;
		pmsg->message = WM_ALARM;
		KillAlarm();
		return TRUE;
		}
	return FALSE;
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -