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

📄 yyxmsg.cpp

📁 DOS下的图形界面开发包
💻 CPP
字号:
// 1993 (c) ALL RIGHTS RESERVED
// AUTHOR  BY XuYongYong

/* 	yyxmsg.cpp
*/
#include "yyxmsg.h"
#include "yyxmain.h"

MSGQueue::MSGQueue()
{
	this->Reset();
}

void MSGQueue::SendMessage (long int ID,long int Action,void *fptr)
{   asm cli;
	msg_array[first].ID =ID;
	msg_array[first].Action =Action;
	msg_array[first].fptr =fptr;

    oldfirst =first;
	first -=1;
	if ( first <0 )  first=MAXMSGNUM;
	if ( last==first ) {
//		puts("\007\007\007MSGQueue Overflow");
//		exit (100);
		error("\007\007\007MSGQueue Overflow");
	}
	asm sti;
}

BOOL MSGQueue::GetMessage (MSG& message)
{
	if ( first ==last ) return FALSE;
	message=msg_array[last];
	last -=1;
	if ( last <0)  last =MAXMSGNUM;
	return TRUE;
}

BOOL MSGQueue::PeekMessage (MSG& message)
{
	if ( first ==last ) return FALSE;
	message=msg_array[last];
	return TRUE;
}

BOOL MSGQueue::QueueFull ()
{ register int i;
	i = last - first;
	if ( i<0 ) i +=MAXMSGNUM;
	if ( i >= MSGFULLNUM ) return TRUE;
	return FALSE;
}

void MSGQueue::Reset ()
{
	first=last;
}

MSGQueue::~MSGQueue()
{
}

⌨️ 快捷键说明

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