您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Beep函数代码示例

51自学网 2021-06-01 19:54:51
  C++
这篇教程C++ Beep函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中Beep函数的典型用法代码示例。如果您正苦于以下问题:C++ Beep函数的具体用法?C++ Beep怎么用?C++ Beep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了Beep函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: BL_Bootloader

void BL_Bootloader(void) {  S191_FileStatus fileStatus;    DisableInterrupts;#if PL_HAS_HW_SOUNDER  Beep(1);#endif#if PL_BOOTLOADER_LCD  if (JM_ELE_GetVal()!=0) {    /* JM_ELE switch is off: the JM128 is controlling the LCD */    LCD1_Init();    LCD1_Clear();  }  PrintLCDText(0, "Bootloader mode: waiting for S19 file...");#endif  BLUSB1_InitUSB();    fileStatus = S191_FILE_STATUS_NOT_STARTED;  for(;;) {    BLUSB1_PollAndProcessUSB(&fileStatus); /* Poll USB device for any input device */    if(fileStatus==S191_FILE_STATUS_READING) {    #if PL_BOOTLOADER_LCD      PrintLCDText(1, "Loading S19 file...");    #endif      BL_flashErased = FALSE;      BLUSB1_ReadAndProcessS19(&fileStatus);      switch(fileStatus) {        case S191_FILE_STATUS_FINISHED:          #if PL_BOOTLOADER_LCD          PrintLCDText(2, "Loading successful!/nYou can reset the board now.");          #endif          #if PL_HAS_HW_SOUNDER          Beep(1);          #endif          break;        case S191_FILE_ERASE_FAILED:          #if PL_BOOTLOADER_LCD          PrintLCDText(2, "*** Flash erase error! ***");          #endif          #if PL_HAS_HW_SOUNDER          Beep(4);          #endif          break;        case S191_FILE_FLASH_FAILED:          #if PL_BOOTLOADER_LCD          PrintLCDText(2, "*** Flash programming error! ***");          #endif          #if PL_HAS_HW_SOUNDER          Beep(6);          #endif          break;        default:          #if PL_BOOTLOADER_LCD          PrintLCDText(2, "*** Error processing file! ***");          #endif          #if PL_HAS_HW_SOUNDER          Beep(8);          #endif          break;      } /* switch */    } /* if */      } /* for */}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:63,


示例2: gopherLoop

void gopherLoop(){	//initialize variables ------------------------------------------------------------------------------------------------------------------	int leftX;	int leftY;	//int rightx; //disabled to avoid 'unused' compiler warning	//int righty;	float addXLeft;	float addYLeft;	//float addXRight;	//float addYRight;	int deadZone = 3000; //X and Y minimum, below this is ignored since all controllers have some stick to them	int scrollDeadZone = 7000; // Right thumbstick should be less sensitive.	int scrollSpeed = 20; // Speed at which you scroll page.	float range = 4.0f; //4 gives a decent range. Raising this requires a lowering of speed as well.	int truncZone = 3; //anything below this is ignored and the mouse sits still, similar to a deadzone	int sleepAmount = 16; //ideally 16, refreshes 60 times per second (1000/16 = ~60)	POINT cursor; //ehh//read input ---------------------------------------------------------------------------------------------------------------------------------//read input ---------------------------------------------------------------------------------------------------------------------------------//read input ---------------------------------------------------------------------------------------------------------------------------------		//XINPUT_GAMEPAD_BACK	if(Controller->GetState().Gamepad.wButtons == XINPUT_GAMEPAD_BACK)	{		holdBack = true;	}	else if (Controller->GetState().Gamepad.wButtons != XINPUT_GAMEPAD_BACK)	{		holdBack = false;	}	//XINPUT_GAMEPAD_BACK - disable/enable	if(holdBack == true && holdingBack == false){ // && holdingLeftMouseButton == false		holdingBack = true;		printf("---------------BACK-DOWN/n");	}	else if(holdBack == false && holdingBack == true){		holdingBack = false;		if(disabled == false){				printf("---------------BACK-UP - Toggled off, ignoring all input but 'Back'./n");				disabled = true;				Beep(1800,200);				Beep(1600,200);				Beep(1400,200);				Beep(1200,200);				Beep(1000,200);				//Sleep(1000);		}		else if(disabled == true){				printf("---------------BACK-UP - Toggled on, taking all input./n");				disabled = false;				Beep(1000,200);				Beep(1200,200);				Beep(1400,200);				Beep(1600,200);				Beep(1800,200);				//Sleep(1000);		}	}	if(disabled == false){	//get LX info	if(abs(Controller->GetState().Gamepad.sThumbLX) > deadZone)	{		addXLeft = (speed * (Controller->GetState().Gamepad.sThumbLX*range));	}	//zero check	else	{		addXLeft = 0.0f;	}	//get LY info	if(abs(Controller->GetState().Gamepad.sThumbLY) > deadZone)	{		addYLeft = -(speed * (Controller->GetState().Gamepad.sThumbLY*range));	}	//zero check	else	{		addYLeft = 0.0f;	}	//Get RY info	holdScrollUp = (Controller->GetState().Gamepad.sThumbRY > scrollDeadZone);//.........这里部分代码省略.........
开发者ID:miguelmig,项目名称:Gopher,代码行数:101,


示例3: main

/***************************************************************** 函数原型:main() 功能描述:主函数 参数描述: 返回值:   无 作  者:   许岩/刘及华 日  期:   2012-11-24 修改历史:		日期        修改人      修改描述		------      ---------   -------------*****************************************************************/int main(void){		INT8U   ret = 0;	char    mainflag = 1;	INT8S   buf[30];	uchar   uckey;	uint 	uikey;	BUS_TIME ltime;	(void)EA_ucSetStopFlag( EM_DISABLE_STOP );  //不允许系统进入睡眠状态;reboot:	ret = System_Init();     //系统初始化,包括PSAM,参数表,GPRS初始化	if( ret != ok )		 	{		lcddisperr("系统初始化失败!");		goto reboot;	}	Beep(1000);	for ( ;; )	{		Get_Time(&ltime);		sprintf((void *)buf, "  %02X%02X-%02X-%02X %02X:%02X",				ltime.century, ltime.year, ltime.month, ltime.day, ltime.hour, ltime.minute);//  	EA_vTextOut(0, 0, EM_key_FONT8X16, 0, 1, 1, (char *)buf);		EA_vDisplay(3, (void *)buf);		if( mainflag == 1 )		{			DisplayWelcomeMenu();			mainflag = 0;		}		uckey = EA_ucKBHit();		if(uckey == EM_key_HIT)       //有按键		{			uikey = EA_uiInkey(0);    //读取按键键值			switch ( uikey )			{				case EM_key_EXIT:     //关机				{					mainflag = 1;					goto shutdown;					break;				}				case EM_key_F3:				{					Login();                  //登录界面                    						mainflag = 1;					break;				}				case EM_key_F1:					{					Parm_Setting();          //参数配置					mainflag = 1;					break;				}				case EM_key_1:				{					GPRS_TEST();             //无线连接测试					mainflag = 1;					break;				}				case EM_key_F2:				{//  				QUERY_NOTE_RECORD();					Gprs_Upload_data();      //数据上传					mainflag = 1;					break;				}				default:					break;			}		}	}shutdown:	Power_Down();}
开发者ID:12019,项目名称:zibogas,代码行数:93,


示例4: gdk_display_beep

voidgdk_display_beep (GdkDisplay *display){  g_return_if_fail (display == gdk_display_get_default());  Beep(1000, 50);}
开发者ID:batman52,项目名称:dingux-code,代码行数:6,


示例5: checklala

void checklala(int i,int j,int *arr[3][3],int player,int *arr2[9][8],int *a){    if(player==shortcut2(i,arr))// player 2 1 a zete parbena & player 1 2 te zete parbena.    {        i=i-1;        if(i>8||i<0)        {            printf("Error..! You have range between 1 to 9/n");            Beep(250,250);        }        else if(i==4)        {            if(j==arr2[i][0]||j==arr2[i][1]||j==arr2[i][2]||j==arr2[i][3]||j==arr2[i][4]||j==arr2[i][5]||j==arr2[i][6]||j==arr2[i][7])            {                if(shortcut2(j,arr)==0)                {                    move(arr,i+1,j,player);                    printf("A=%d/n",++*a);                }                else                {                    printf("Error/n");                    Beep(250,250);                }            }            else            {                printf("Error/n");                Beep(250,250);            }        } else {            if(j==arr2[i][0]||j==arr2[i][1]||j==arr2[i][2]) {                if(shortcut2(j,arr)==0)                {                    move(arr,i+1,j,player);                    printf("A=%d/n",++*a);                }                else                {                    printf("Error/n");                    Beep(250,250);                }            }   else            {                printf("Error/n");                Beep(250,250);            }        }    }    system("cls");}
开发者ID:mostasimbillah,项目名称:Tin_guti,代码行数:64,


示例6: key_SetAddresses

void    key_SetAddresses(void){static uchar ibCan;  if (bKey == bKEY_ENTER)  {                                               if (enKeyboard == KBD_ENTER)    {      enKeyboard = KBD_INPUT1;      Number();      ShowHi(szAddresses);    }     else if (enKeyboard == KBD_INPUT1)    {      enKeyboard = KBD_POSTENTER;      ibCan = 0;      Show(ibCan);    }    else if (enKeyboard == KBD_POSTINPUT1)    {      if ((ibCan = GetCharLo(10,11) - 1) < bCANALS)      {        enKeyboard = KBD_POSTENTER;        Show(ibCan);      }      else Beep();    }    else if (enKeyboard == KBD_POSTENTER)    {      if (++ibCan >= bCANALS) ibCan = 0;      Show(ibCan);    }    else if (enKeyboard == KBD_POSTINPUT3)    {      ulong dw;      if ((dw = GetLongLo(8,15)) <= 100000000)      {        enKeyboard = KBD_POSTENTER;        ibRecordCan = ibCan;        AddSysRecordReprogram(EVE_EDIT_ADDRESS20);        mpdwAddress2[ibCan] = dw;        SaveCache(&chAddress2);        AddSysRecordReprogram(EVE_EDIT_ADDRESS21);        if (++ibCan >= bCANALS) ibCan = 0;        Show(ibCan);      }      else Beep();    }    else Beep();  }  else if (bKey == bKEY_POINT)  {            if (enKeyboard == KBD_POSTENTER)    {      if (ibCan > 0) ibCan--; else ibCan = bCANALS-1;      Show(ibCan);    }     else if (enKeyboard == KBD_POSTINPUT2)    {      ulong dw;      if ((dw = GetLongHi(8,15)) <= 100000000)      {        enKeyboard = KBD_INPUT3;        sprintf(szLo+8,szMaskAddresses);        ibRecordCan = ibCan;        AddSysRecordReprogram(EVE_EDIT_ADDRESS10);        mpdwAddress1[ibCan] = dw;        SaveCache(&chAddress1);        AddSysRecordReprogram(EVE_EDIT_ADDRESS11);      }      else Beep();    }    else Beep();  }   else if (bKey < 10)  {            if (enKeyboard == KBD_POSTENTER)    {      if ((enGlobal == GLB_PROGRAM) || (enGlobal == GLB_REPROGRAM))      {        enKeyboard = KBD_INPUT2;        sprintf(szHi+8,szMaskAddresses);        sprintf(szLo+8,szNullAddresses);      }      else Beep();    }    if ((enKeyboard == KBD_INPUT1) || (enKeyboard == KBD_POSTINPUT1))    {      enKeyboard = KBD_POSTINPUT1;//.........这里部分代码省略.........
开发者ID:feilongfl,项目名称:tm4c1294ncpdt,代码行数:101,


示例7: bstrConnString

void CADOUtil::RunSP_ReturnRS(_bstr_t SP_Name, _RecordsetPtr& out_pRs, CParamArray *ParamArray){	if(!CheckCurrentProcess())		throw ERR_NEW_PROCESS_DETECTED;	_ConnectionPtr	pConn	= NULL;	_ParameterPtr	pPrm	= NULL;	_ParameterPtr	pprm	= NULL;	ErrorPtr		pErr	= NULL;	_CommandPtr		pComm	= NULL;	CParam*			pr		= NULL;	LONG			ErrSQLState = 0;	LONG			count = 0;	LONG			ErrorCode = 0;	_variant_t		vIndex;	_bstr_t			bsEmpty;	//********************************************************************	//Connectin to Pool	try 	{		_bstr_t bstrConnString(szConnectionString);		pConn.CreateInstance(__uuidof(Connection));		if(pConn == NULL)		{			throw(ErrorCode = ERR_UNABLE_CREATE_CONN);		}		pConn->ConnectionTimeout = 7;		pConn->Open(bstrConnString, L"", L"", adConnectUnspecified);	}	catch(...)	{		Beep(2000, 100);		//m_ExternalLink.Add2Log(WL_ERROR_LEVEL1,"Unable set connection to SQL Error = Unknown");		ErrorCode = ERR_UNABLE_CREATE_CONN;	}	if(ErrorCode)		throw ErrorCode;	//*******************************************************************		//Execut command	try	{		pComm.CreateInstance(__uuidof(Command));		if(pComm == NULL)		{			throw(ErrorCode = ERR_UNABLE_CREATE_COMM);		}		out_pRs.CreateInstance(__uuidof(Recordset));		if(out_pRs == NULL)		{			throw(ErrorCode = ERR_UNABLE_CREATE_RECSET);		}		pComm->ActiveConnection = pConn;		pComm->CommandText = SP_Name;		pComm->CommandType = adCmdStoredProc;		if(ParamArray != NULL)		{			DWORD Count = ParamArray->GetSize();			for (DWORD i=0; i < Count; i++)			{				pr = (*ParamArray)[i];				pprm = pComm->CreateParameter(bsEmpty, pr->Type, pr->Direction, pr->Size, pr->Value);				pComm->Parameters->Append(pprm);			}		}		out_pRs->CursorLocation = adUseClient;		out_pRs->Open(_variant_t((IDispatch *)pComm, true), vtMissing, adOpenForwardOnly, adLockReadOnly, NULL);		out_pRs->PutRefActiveConnection(NULL);		pConn->Close();		return;	}	//Handle Execut error	catch(_com_error)	{		try		{			count = pConn->Errors->Count;			if(count)			{				vIndex = _variant_t((LONG)0);				pErr = pConn->Errors->GetItem(vIndex);				ErrSQLState = atol((LPCSTR)pErr->SQLState);				/*				//m_ExternalLink.Add2Log(WL_ERROR_LEVEL3,				"SQL (RS) Error %d [Error #%d Description /"%s/" (Source: %s)"				"(SQL State: %s)](NativeError: %s)",				e.Error(),				pErr->Number,				(LPCSTR)pErr->Description,				(LPCSTR)pErr->Source,				(LPCSTR)pErr->SQLState,				(LPCSTR)pErr->NativeError);*/			}			pConn->Close();			if (pComm->ActiveConnection != NULL)//.........这里部分代码省略.........
开发者ID:0anion0,项目名称:IBN,代码行数:101,


示例8: from_file

void from_file(){    ////fn void from_file()    ////brief Corectarea unui sir de caractere.    ///    ///Implementarea corectarii a unui sir de caractere citit din fisier.    char fileName[100];    char buff[2255];    char *p;    FILE * f_corected = fopen("from file corected.txt","w");    FILE * file;    char ch[2],word[150],wordINIT[150];    ch[1]='/0';    List sim_words ;    POINT curs, cursBack;// cursor position    tryAgain:    system("cls");    printf("/n/tPlease enter the name of the file (e.g. : file.txt):  ");    gets(fileName);    if(fileName[strlen(fileName)-1]=='/n')        fileName[strlen(fileName)-1]='/0';    if(strlen(fileName)<=2)        goto tryAgain;    file = fopen(fileName,"r");    if( file == NULL ){        printf("/n/t This file doesn't exist!");        Sleep(2000);        goto tryAgain;    }    GotoXY(3,3);    printf(" Here you will see all the informations you need about your text!");    GotoXY(3,9);    printf("Your text:");    // complex flush    fflush(stdin);    while ((ch[0] = getchar()) != '/n' && ch[0] != EOF)        continue;    GotoXY(3,10);// typing     while(1){        word[0]='/0';        ch[0]='/0';            if(kbhit()){                ch[0] = getch();                if(is_letter(ch[0]) == true){                    strcat(word,ch );                    printf("%c",ch[0]);                }            }        save_curs(&curs);        if(!fgets(ch,2,file)){                getchar();                fclose(f_corected);                fclose(file);                return;            }        //add a word        while( is_letter(ch[0])==true  ){            strcat(word,ch);            printf("%c",ch[0]);            if(GetAsyncKeyState( VK_ESCAPE )& 0x8000){                fclose(f_corected);                return;            }            if(!fgets(ch,2,file)){                getchar();                fclose(f_corected);                return;            }        }        strcpy(wordINIT,word);        strcpy(word,strlwr(word));        // if an word was typed        if(word[0]>='A' && word[0]<='z' && strlen(word)>=2){            if(word[strlen(word)-1]<'A' || word[strlen(word)-1]>'z')                word[strlen(word)-1]='/0';            // if the word is incorrect            if(list_search(&dict_lex, strlwr(word))==NULL){                Beep(20,200);                    GotoXY(3,3);                    printf("The word /"%s/" is incorrect!",word);//.........这里部分代码省略.........
开发者ID:dumitrubogdanmihai,项目名称:levenshtein-project,代码行数:101,


示例9: live_input

void live_input(){    ////fn void live_input()    ////brief Corectare in timp real.    ///    ///Implementarea corectarii in timp real ale cuvintelor introduse de la tastatura.    FILE * f_corected = fopen("live_input f_corected.txt","w");    FILE * f_inserted = fopen("live_input f_inserted.txt","w");    char ch[2],word[50],wordINIT[50];    ch[1]='/0';    List sim_words ;    POINT curs, cursBack;// cursor position    ClearSelectAreea();    GotoXY(3,3);    printf(" Here you will see all the informations you need about your text ");    GotoXY(3,9);    printf("Your text:");    // complex flush    fflush(stdin);    while ((ch[0] = getchar()) != '/n' && ch[0] != EOF)        continue;    GotoXY(3,10);// typing    while(1){        word[0]='/0';        ch[0]='/0';        save_curs(&curs);        //add a word        while( is_letter(ch[0])==true ){            if(kbhit()){                ch[0] = getch();                if(is_letter(ch[0]) == true){                    strcat(word,ch);                    printf("%c",ch[0]);                }            }            if(GetAsyncKeyState( VK_BACK )& 0x8000){                if( strlen(word) != 0){                    save_curs(&cursBack);                    GotoXY( cursBack.x-1, cursBack.y);                    printf(" ");                    word[strlen(word)-1]='/0';                    GotoXY(curs.x,curs.y);                    printf("%s",word);                    GotoXY(cursBack.x-1, cursBack.y);                    Sleep(100);                }            }            if(GetAsyncKeyState( VK_ESCAPE )& 0x8000){                return;                fclose(f_inserted);                fclose(f_corected);            }            if(GetAsyncKeyState( VK_RETURN )& 0x8000) break;        }        strcpy(wordINIT,word);        strcpy(word,strlwr(word));        // if an word was typed        if(word[0]>='A' && word[0]<='z' && strlen(word)>=2){            if(word[strlen(word)-1]<'A' || word[strlen(word)-1]>'z')                word[strlen(word)-1]='/0';            fprintf(f_inserted,"%s",word);            fprintf(f_inserted,"%c",ch[0]);            // if the word is incorrect            if(list_search(&dict_lex, word)==NULL){                Beep(20,200);                find_sim_words(&sim_words, word, strlen(word), dict_lex.head, dict_lex.tail);                if(sim_words.head==NULL){                    ClearSelectAreea();                    Beep(90,200);                    ClearSelectAreea();                    GotoXY(3,3);                    printf("The word /"%s/" is incorrect and there are no word like him!/n",word);                    Sleep(650);                    getchar();                }                else{                    Beep(70,200);                    List_Node * newTail = malloc(sizeof(List_Node));                    newTail->word = malloc(sizeof(char)*strlen(wordINIT)+1);                    strcpy(newTail->word,wordINIT);                    list_insert(&sim_words,newTail);                    Select_correct_word(word, &sim_words);//.........这里部分代码省略.........
开发者ID:dumitrubogdanmihai,项目名称:levenshtein-project,代码行数:101,


示例10: Beep

//---------------------------------------------------------------------------void __fastcall TForm1::BewegingstimerTimer(TObject *Sender){//Neerzetten met double buffering:   //achtergrond   ImageCanvas->Picture=BackgroundImage->Picture;   //musica   Beep(random(500),500);   //staff laten bewegen als barman   if (b==0)        {           StaffImage->Left=StaffImage->Left+random(50)-25;                if (StaffImage->Left<600) StaffImage->Left=600;                if (StaffImage->Left>700) StaffImage->Left=700;                ImageCanvas->Canvas->Draw(StaffImage->Left,StaffImage->Top,StaffImage->Picture->Graphic);                ImageCanvas->Canvas->Draw(ItemImage->Left,ItemImage->Top,ItemImage->Picture->Graphic);        }   else   //het dwijlorkest        {           switch (dwijlorkest)                {                case 0:                  ImageCanvas->Canvas->Draw(524,100,OrkestImage1->Picture->Graphic);                  dwijlorkest=1;                  break;                case 1:                  ImageCanvas->Canvas->Draw(525,100,OrkestImage2->Picture->Graphic);                  dwijlorkest=0;                  break;                }        }   //dienblad:   ImageCanvas->Canvas->Draw(10,140,ArrowImage->Picture->Graphic);   ImageCanvas->Canvas->Draw(8,80,DienbladImage->Picture->Graphic);   for (int t=0; t<aantalglazen+1; t++)        {         switch (t)                {                 case 0:                   break;                 case 1:                   ImageCanvas->Canvas->Draw(48,80,GlasImage->Picture->Graphic);                   break;                 case 2:                   ImageCanvas->Canvas->Draw(63,82,GlasImage->Picture->Graphic);                   break;                 case 3:                   ImageCanvas->Canvas->Draw(28,84,GlasImage->Picture->Graphic);                   break;                 case 4:                   ImageCanvas->Canvas->Draw(14,94,GlasImage->Picture->Graphic);                   break;                 case 5:                   ImageCanvas->Canvas->Draw(30,94,GlasImage->Picture->Graphic);                   break;                 case 6:                   ImageCanvas->Canvas->Draw(47,89,GlasImage->Picture->Graphic);                   break;                 case 7:                   ImageCanvas->Canvas->Draw(61,90,GlasImage->Picture->Graphic);                   break;                 case 8:                   ImageCanvas->Canvas->Draw(56,96,GlasImage->Picture->Graphic);                   break;                 case 9:                   ImageCanvas->Canvas->Draw(88,88,GlasImage->Picture->Graphic);                   break;                 case 10:                   ImageCanvas->Canvas->Draw(90,95,GlasImage->Picture->Graphic);                   break;                 case 11:                   ImageCanvas->Canvas->Draw(74,95,GlasImage->Picture->Graphic);                   break;                }        }   //de glazen vullen:   if(random(3)==1) c[random(10)][1]=1;     //kans 1op30;   //de glazen tekenen als de bar er is:   if (b==0)        {           for (int we=0; we<10; we++)                {                switch (c[we][1])                        {                        case 0:                           break;                        case 1:                           ImageCanvas->Canvas->Draw(c[we][0],360,GlasImage->Picture->Graphic);                           break;                        }                }        }//end glazenifstatement//.........这里部分代码省略.........
开发者ID:RLED,项目名称:ProjectRichelBilderbeek,代码行数:101,


示例11: export_cb

/* export_cb : Export Callback   Export to file the entry highlighted in the browser. */void export_cb(FL_OBJECT *a, long l){  Int4 index;  int RetVal;  unsigned char *pImgBuf;  short Width;  short Height;  const char *format;  RetVal = fl_get_browser(wad_brow);  if ( RetVal == 1 )           /* first line is the legend */    return;  index = LinearMap[RetVal];    switch (pEntryTag[index])    {    case TAG_MUS  :       GenFileName(pDirEnt[index].name, ".mus", TmpNameStr);      RetVal = Gen_MUS_File(WADfp, pDirEnt[index], TmpNameStr);      break;    case TAG_SFX  :      GenFileName(pDirEnt[index].name, ".wav", TmpNameStr);      RetVal = Gen_WAV_File(WADfp, pDirEnt[index], TmpNameStr);      break;    case TAG_FLAT :    case TAG_FULL :    case TAG_IMG  :      pImgBuf = ParseImgBlock(pDirEnt[index], pEntryTag[index], 			      &Width, &Height, NULL, NULL, WADfp);      if (pImgBuf == NULL) {	RetVal = 4;	break;      }      format = fl_get_choice_text( exp_img_fmt_cho );      if ( !strcmp(format, PCX_STR ) ) {           /* pcx */	GenFileName(pDirEnt[index].name, ".pcx", TmpNameStr);	RetVal = PCX_WriteImage(pDirEnt[index], WADfp, Width, Height, 				pImgBuf, 1, TmpNameStr);      }      else {  /* xpm */	char **xpm;	GenFileName(pDirEnt[index].name, ".xpm", TmpNameStr);	/* don't just redraw, we don't know what's in the xpm: */	xpm = CreateXpmImage( pImgBuf, Width, Height, 0, NULL ); 	if ( xpm && CreateXpmFile( xpm, TmpNameStr ) ) 	  RetVal = 0;	else	  RetVal = 666; /* why not? */      }      break;    case TAG_HIRES:      GenFileName(pDirEnt[index].name, ".pcx", TmpNameStr);      RetVal = PCX_WriteImage(pDirEnt[index], WADfp, 640, 480, 			      pBitMap, 4, TmpNameStr);      break;    default:      RetVal = 1;      break;    }    if (RetVal != 0) {    Beep();    Message("error generating external file /"%s/" (%d)/n", 	   TmpNameStr, RetVal);  }  else    Message("External file /"%s/" created OK/n", TmpNameStr); }
开发者ID:Doom-Utils,项目名称:xwadtools,代码行数:70,


示例12: UpdateData

void CWipeFree::OnDmWipe() {	LVITEM				lvitem;	int					nSel;	int					i;	YG_PARTITION_INFO	*pTargetParInfo = NULL;	CWipeProc			WipeProcDlg;	BOOL				bSel = FALSE;	CString				cstr,csCaption;	TCHAR				szCurDir[MAX_PATH];	TCHAR				szDir[32];	UpdateData(TRUE);	g_bBeepOff = m_BeepOff.GetCheck();	nSel = m_SelMothed.GetCurSel ();	g_nWipeMothed = nSel;	csCaption.LoadString (IDS_DM_ERROR);	lvitem.mask = LVIF_IMAGE;	lvitem.iSubItem = 0;		for(i = 0; i < m_WipeParList.GetItemCount (); i++) 	{		lvitem.iItem = i;		m_WipeParList.GetItem(&lvitem);		if(lvitem.iImage == IMG_LIST_SELECT) 		{			pTargetParInfo		= (YG_PARTITION_INFO*)m_WipeParList.GetItemData (i);			g_pTargetParInfo	= pTargetParInfo;			bSel				= TRUE;			break;		}	}	if(bSel)	{		if(g_pTargetParInfo->DriveLetter == _T('*'))		{			cstr.LoadString (IDS_Q_FORMAT_PARTITION);			csCaption.LoadString (IDS_DM_INFO);			MessageBox(cstr,csCaption,MB_OK);			return ;		}		ZeroMemory(szDir, 32  * sizeof(TCHAR));		_tcscpy(szDir,_T("C://"));		szDir[0] = g_pTargetParInfo->DriveLetter;		GetCurrentDirectory(MAX_PATH,szCurDir);		if(!SetCurrentDirectory(szDir))		{			cstr.LoadString (IDS_Q_FORMAT_PARTITION);			csCaption.LoadString (IDS_DM_INFO);			MessageBox(cstr,csCaption,MB_OK);			return ;		}		SetCurrentDirectory(szCurDir);		cstr.Format (IDS_CONFIRM_WIPE_FREE,g_pTargetParInfo->DriveLetter);		csCaption.LoadString (IDS_DM_CONFIRM_CAPTITION);		if(IDYES == MessageBox (cstr,csCaption,MB_YESNO))		{			WipeProcDlg.m_DriveLetter = g_pTargetParInfo->DriveLetter;			if (!g_bBeepOff) Beep(1000,100);			WipeProcDlg.DoModal ();		}	}}
开发者ID:xfxf123444,项目名称:japan,代码行数:67,


示例13: main

int main(int argc, void **argv){	char *pszdir;	char *pszWadName;	char *pszScriptName;	char szBuf[1024];	HANDLE hFile, hScriptFile;	WIN32_FIND_DATA FindData;	BOOL fWrite;	BOOL fContinue = TRUE;	DWORD dwWritten;	printf("makels Copyright (c) 1998 Valve L.L.C., %s/n", __DATE__ );	pszdir = (char *)argv[1];	if ((argc != 4) || (pszdir[0] == '/') || (pszdir[0] == '-'))	{		PrintUsage((char *)argv[0]);		exit(1);	}	pszdir = (char *)malloc(strlen((char *)argv[1]) + 7);	strcpy(pszdir, (char *)argv[1]);	strcat(pszdir, "//*.bmp");	pszWadName = (char *)malloc(strlen((char *)argv[2]) + 5);	strcpy(pszWadName, (char *)argv[2]);	strcat(pszWadName, ".WAD");	pszScriptName = (char *)malloc(strlen((char *)argv[3]));	strcpy(pszScriptName, (char *)argv[3]);	hScriptFile = CreateFile(pszScriptName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 			FILE_ATTRIBUTE_NORMAL, NULL);	if (hScriptFile == INVALID_HANDLE_VALUE)	{		printf("/n---------- ERROR ------------------/n");		printf(" Could not open the script file: %s/n", pszScriptName);		Beep(800,500);		exit(EXIT_FAILURE);	}	sprintf(szBuf, "$DEST    /"%s/"/r/n/r/n", pszWadName);	fWrite = WriteFile(hScriptFile, szBuf, strlen(szBuf), &dwWritten, NULL);	if (!fWrite || (dwWritten != strlen(szBuf)))	{write_error:		printf("/n---------- ERROR ------------------/n");		printf(" Could not write to the script file: %s/n", pszScriptName);		Beep(800,500);		CloseHandle(hScriptFile);		exit(EXIT_FAILURE);	}			hFile = FindFirstFile(pszdir, &FindData);	if (hFile != INVALID_HANDLE_VALUE)	{		while (fContinue)		{			if (!(FindData.dwFileAttributes &					(FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN)))			{				char szShort[MAX_PATH];				// ignore N_ and F_ files				strcpy(szShort, FindData.cFileName);				strupr(szShort);				if ((szShort[1] == '_') && ((szShort[0] == 'N') || (szShort[0] == 'F')))				{					printf("Skipping %s./n", FindData.cFileName);				} else {									if ( nFiles >= nMaxFiles )					{						nMaxFiles += 1000;						ppszFiles = (char **)realloc( ppszFiles, nMaxFiles * sizeof(*ppszFiles) );						if ( !ppszFiles )						{							printf("/n---------- ERROR ------------------/n");							printf(" Could not realloc more filename pointer storage/n");							Beep(800,500);							exit(EXIT_FAILURE);						}					}					ppszFiles[nFiles++] = strdup( szShort );				}			}			fContinue = FindNextFile(hFile, &FindData);		}		}	if (nFiles > 0)	{//.........这里部分代码省略.........
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:101,


示例14: WindowProcedure

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){    static struct    {        int nota;        int lugar;        //int largo;    }notas[NOTA_MAX];    static int largo=100;    static int pos=0;    switch (message)                  /* handle the messages */    {        case WM_KEYDOWN:            if(pos<NOTA_MAX-1)            switch(wParam)            {                case 96:                    Beep(SIg, largo);                    notas[pos].nota=SIg;                    notas[pos].lugar=72;                    pos++;                    break;                case 97:                    Beep(DO, largo);                    notas[pos].nota=DO;                    notas[pos].lugar=66;                    pos++;                    break;                case 98:                    Beep(RE, largo);                    notas[pos].nota=RE;                    notas[pos].lugar=60;                    pos++;                    break;                case 99:                    Beep(MI, largo);                    notas[pos].nota=MI;                    notas[pos].lugar=54;                    pos++;                    break;                case 100:                    Beep(FA, largo);                    notas[pos].nota=FA;                    notas[pos].lugar=48;                    pos++;                    break;                case 101:                    Beep(SOL, largo);                    notas[pos].nota=SOL;                    notas[pos].lugar=42;                    pos++;                    break;                case 102:                    Beep(LA, largo);                    notas[pos].nota=LA;                    notas[pos].lugar=36;                    pos++;                    break;                case 103:                    Beep(SI, largo);                    notas[pos].nota=SI;                    notas[pos].lugar=30;                    pos++;                    break;                case 104:                    Beep(DOa, largo);                    notas[pos].nota=DOa;                    notas[pos].lugar=24;                    pos++;                    break;                case 105:                    Beep(REa, largo);                    notas[pos].nota=REa;                    notas[pos].lugar=18;                    pos++;                    break;            }            //MessageBox(0,0,0,0);            //UpdateWindow(hwnd);            break;        case WM_PAINT:            PAINTSTRUCT ps;            HDC hDC;            hDC = BeginPaint(hwnd, &ps);            for(int i=0;i<pos;i++)                Ellipse(hDC, 25+i*15, notas[i].lugar, 37+i*15, notas[i].lugar+12);            hacerlinea(hDC, 0, 12, 625, 12);            hacerlinea(hDC, 0, 24, 625, 24);            hacerlinea(hDC, 0, 36, 625, 36);            hacerlinea(hDC, 0, 48, 625, 48);            hacerlinea(hDC, 0, 60, 625, 60);            hacerlinea(hDC, 10, 10, 10, 62);            EndPaint(hwnd, &ps);//.........这里部分代码省略.........
开发者ID:0aps,项目名称:Legacy-Code,代码行数:101,


示例15: setCDKFselect

/* * This function sets the information inside the file selector. */void setCDKFselect (CDKFSELECT *fselect, char *directory, chtype fieldAttrib, chtype filler, chtype highlight, char *dirAttribute, char *fileAttribute, char *linkAttribute, char *sockAttribute, boolean Box GCC_UNUSED){   /* Declare local variables. */   CDKSCROLL *fscroll	= fselect->scrollField;   CDKENTRY *fentry	= fselect->entryField;   char *tempDir	= 0;   char *mesg[10], newDirectory[2000], temp[100];   int ret;   /* Keep the info sent to us. */   fselect->fieldAttribute	= fieldAttrib;   fselect->fillerCharacter	= filler;   fselect->highlight		= highlight;   strcpy (newDirectory, directory);   /* Set the attributes of the entry field/scrolling list. */   setCDKEntryFillerChar (fentry, filler);   setCDKScrollHighlight (fscroll, highlight);   /* Only do the directory stuff if the directory is not null. */   if (directory != 0)   {      /* Try to expand the directory if it starts with a ~ */      if (directory[0] == '~')      {	 tempDir = expandFilename (directory);	 if (tempDir != 0)	 {	    strcpy (newDirectory, tempDir);	    freeChar (tempDir);	 }      }      /* Change directories. */      ret = chdir (newDirectory);      if (ret != 0)      {	 /* Beep at them. */	 Beep();	 /* Couldn't get into the directory, pop up a little message. */	 sprintf (temp, "<C>Could not change into %s", newDirectory);	 mesg[0] = copyChar (temp);#ifdef HAVE_STRERROR	 sprintf (temp, "<C></U>%s", strerror(errno));	 mesg[1] = copyChar (temp);#else	 sprintf (temp, "<C></U>Unknown reason.");	 mesg[1] = copyChar (temp);#endif	 mesg[2] = " ";	 mesg[3] = "<C>Press Any Key To Continue.";	 /* Pop Up a message. */	 popupLabel (ScreenOf(fselect), mesg, 4);	 /* Clean up some memory. */	 freeCharList (mesg, 4);	 /* Get out of here. */	 eraseCDKFselect (fselect);	 drawCDKFselect (fselect, ObjOf(fselect)->box);	 return;      }   }   /*    * If the information coming in is the same as the information    * that is already there, there is no need to destroy it.    */   if (fselect->pwd != directory)   {      setPWD(fselect);   }   if (fselect->fileAttribute != fileAttribute)   {      /* Remove the old pointer and set the new value. */      freeChar (fselect->fileAttribute);      fselect->fileAttribute = copyChar (fileAttribute);   }   if (fselect->dirAttribute != dirAttribute)   {      /* Remove the old pointer and set the new value. */      freeChar (fselect->dirAttribute);      fselect->dirAttribute = copyChar (dirAttribute);   }   if (fselect->linkAttribute != linkAttribute)   {      /* Remove the old pointer and set the new value. */      freeChar (fselect->linkAttribute);      fselect->linkAttribute = copyChar (linkAttribute);   }   if (fselect->sockAttribute != sockAttribute)   {      /* Remove the old pointer and set the new value. *///.........这里部分代码省略.........
开发者ID:dyne,项目名称:MuSE,代码行数:101,


示例16: one_word

void one_word(){    ////fn void one_word()    ////brief Corectarea un cuvant introdus.    ///    ///Implementarea corectarii a unui cuvant introdus de la tastatura.    char word[50]; // cuvantul care va fi verificat    List sim_words ;  // lista cuvintelor asemanatoare cu cuvantul citit// golirea bufferului    fflush(stdin);    char ch;    while ((ch = getchar()) != '/n' && ch != EOF)        continue;    system("cls");    printf("/n/t/tOne word function: /n/n");   while( 1 ){        //repeat while ESC isn't pressed        tryAgain:        system("cls");        printf("/n/tPlease enter the word:  ");        gets(word);        if(word[strlen(word)-1]=='/n')            word[strlen(word)-1]='/0';        if(strlen(word)<=2)            goto tryAgain;            // if the word is incorrect            if(list_search(&dict_lex, word)==NULL){                Beep(20,200);                find_sim_words(&sim_words, word, strlen(word), dict_lex.head, dict_lex.tail);                if(sim_words.head==NULL){                    ClearSelectAreea();                    Beep(90,200);                    GotoXY(3,3);                    printf("The word /"%s/" is incorrect and there are no word like him!/n",word);                    getchar();                    return;                }                else{                    Beep(70,200);                    List_Node * newTail = malloc(sizeof(List_Node));                    newTail->word = malloc(sizeof(char)*strlen(word)+1);                    strcpy(newTail->word,word);                    list_insert(&sim_words,newTail);                    Select_correct_word(word, &sim_words);                    free_list(&sim_words);                    return;                }            }            else{                ClearSelectAreea();                GotoXY(3,3);                printf("The word /"%s/" is correct!/n",word);                return;            }    }}
开发者ID:dumitrubogdanmihai,项目名称:levenshtein-project,代码行数:65,


示例17: CommandChoice

//.........这里部分代码省略.........                ConErrResPrintf(STRING_CHOICE_ERROR_OPTION, arg[i]);                freep (arg);                return 1;            }        }    }    /* print text */    if (lpText)        ConOutPrintf (_T("%s"), lpText);    /* print options */    if (bNoPrompt == FALSE)    {        ConOutPrintf (_T("[%c"), lpOptions[0]);        for (i = 1; (unsigned)i < _tcslen (lpOptions); i++)            ConOutPrintf (_T(",%c"), lpOptions[i]);        ConOutPrintf (_T("]?"));    }    ConInFlush ();    if(!bTimeout)    {        while (TRUE)        {            ConInKey (&ir);            val = IsKeyInString (lpOptions,#ifdef _UNICODE                                 ir.Event.KeyEvent.uChar.UnicodeChar,#else                                 ir.Event.KeyEvent.uChar.AsciiChar,#endif                                 bCaseSensitive);            if (val >= 0)            {                ConOutPrintf (_T("%c/n"), lpOptions[val]);                nErrorLevel = val + 1;                break;            }            Beep (440, 50);        }        freep (arg);        TRACE ("ErrorLevel: %d/n", nErrorLevel);        return 0;    }    clk = GetTickCount ();    amount = nTimeout*1000;loop:    GCret = GetCharacterTimeout (&Ch, amount - (GetTickCount () - clk));    switch (GCret)    {    case GC_TIMEOUT:        TRACE ("GC_TIMEOUT/n");        TRACE ("elapsed %d msecs/n", GetTickCount () - clk);        break;    case GC_NOKEY:        TRACE ("GC_NOKEY/n");        TRACE ("elapsed %d msecs/n", GetTickCount () - clk);        goto loop;    case GC_KEYREAD:        TRACE ("GC_KEYREAD/n");        TRACE ("elapsed %d msecs/n", GetTickCount () - clk);        TRACE ("read %c", Ch);        if ((val=IsKeyInString(lpOptions,Ch,bCaseSensitive))==-1)        {            Beep (440, 50);            goto loop;        }        cDefault=Ch;        break;    }    TRACE ("exiting wait loop after %d msecs/n",           GetTickCount () - clk);    val = IsKeyInString (lpOptions, cDefault, bCaseSensitive);    ConOutPrintf (_T("%c/n"), lpOptions[val]);    nErrorLevel = val + 1;    freep (arg);    TRACE ("ErrorLevel: %d/n", nErrorLevel);    return 0;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:101,


示例18: Beep

void Metak::zvuk_metka(){    Beep(5000,10);}
开发者ID:StojkeKiller,项目名称:zumm,代码行数:4,


示例19: Gripe

void Gripe(void){   Beep();   printf(bspace);}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:5,


示例20: Beep

void __fastcall TForm1::Button4Click(TObject *Sender){	Beep(Edit4->Text.ToInt(),200);}
开发者ID:whoisjohngalt,项目名称:MicrophoneSpectrum,代码行数:5,


示例21: Plugin_017

boolean Plugin_017(byte function, struct NodoEventStruct *event, char *string)  {  boolean success=false;    int x;    switch(function)    {        case PLUGIN_INIT:      {      for(x=0;x<WIRED_PORTS;x++)        pinMode(PIN_WIRED_OUT_1+x,INPUT); // definieer Arduino pin's voor Wired-Out      }    case PLUGIN_EVENT_IN:      {      if(event->Type     == NODO_TYPE_EVENT &&          event->Command  == EVENT_USEREVENT &&         event->Par1     == 255 &&         event->Par2     == 255)        {        switch(event->Port)          {          case VALUE_SOURCE_IR:            bitWrite(HW_Config,HW_IR_TX,true);            break;          case VALUE_SOURCE_RF:            bitWrite(HW_Config,HW_RF_TX,true);            break;          }        }                }    case PLUGIN_ONCE_A_SECOND:      {      if(Active)        {        switch(HWSecCounter++)          {          case 1:            HWSendTestEvent(VALUE_SOURCE_RF);            break;          case 5:            HWSendTestEvent(VALUE_SOURCE_IR);            break;          case 7:            HWSendTestEvent(VALUE_SOURCE_I2C);            break;          case 8:            {                        CheckWiredLines();                      ShowTestResults();            if(HW_ConfigCheck)              {              if(HW_Config==HW_ConfigCheck)                {                for(x=0;x<=4;x++)                  {                  Beep(2500,25);                  delay(100);                  }                Serial.println(F("NodoTest: HWConfig is correct!"));                }              else                {                Beep(500,1000);                Serial.println(F("NodoTest: HWConfig is NOT correct!"));                }              }            Active=false;            }          }        }      break;      }          case PLUGIN_COMMAND:      {      Beep(1000,250);      Settings.TransmitIR=VALUE_ON;      Settings.TransmitRF=VALUE_ON;      Settings.RawSignalReceive=VALUE_OFF;          HWSecCounter=0;      for(x=0;x<WIRED_PORTS;x++)        {        Settings.WiredInputPullUp[x]=VALUE_ON;        pinMode(A0+PIN_WIRED_IN_1+x,INPUT_PULLUP);        }      HW_ConfigCheck=event->Par2;      Active=true;      Serial.println(F("NodoTest: Running...(please wait a few seconds)/n"));      Beep(1000,50);      success=true;//.........这里部分代码省略.........
开发者ID:pcastel,项目名称:Nodo-Core,代码行数:101,


示例22: SetConsoleCursorPosition

ICRESULT SkeeBall::WiiMoteLoop(void*){    // let's load a couple of samples:    wiimote_sample sine_sample, daisy_sample;    // simple callback example (we use polling for almost everything here):    remote.ChangedCallback		= on_state_change;    //  notify us only when something related to the extension changes    remote.CallbackTriggerFlags = (state_change_flags)( EXTENSION_CHANGED |                                  MOTIONPLUS_CHANGED);reconnect:    COORD pos = { 0, 6 };    SetConsoleCursorPosition(console, pos);    // try to connect the first available wiimote in the system    //  (available means 'installed, and currently Bluetooth-connected'):    COLWHITE;    _tprintf(_T("  Looking for a Wiimote     "));    static const TCHAR* wait_str[] = { _T(".  "), _T(".. "), _T("...") };    unsigned count = 0;    while(!remote.Connect(wiimote::FIRST_AVAILABLE)) {        _tprintf(_T("/b/b/b/b%s "), wait_str[count%3]);        count++;#ifdef USE_BEEPS_AND_DELAYS        Beep(500, 30);        Sleep(1000);#endif    }    wiimote = true;    // connected - light all LEDs    remote.SetLEDs(0x0f);    BRIGHT_CYAN;    _tprintf(_T("/b/b/b/b... connected!"));    if(remote.IsBalanceBoard()) {        BRIGHT_WHITE;        _tprintf(_T("  (Balance Board)"));    }#ifdef USE_BEEPS_AND_DELAYS    Beep(1000, 300);    Sleep(2000);#endif    COORD cursor_pos = { 0, 6 };    // ask the wiimote to report everything (using the 'non-continous updates'    //  default mode - updates will be frequent anyway due to the acceleration/IR    //  values changing):    // note1: you don't need to set a report type for Balance Board - the library    //         takes care of it (there is only one).    // note2: for wiimotes, the report mode that includes the extension data    //		   unfortunately only reports the 'BASIC' IR info (ie. no dot sizes) -    //		   so let's choose the best mode based on the extension status (we also    //		   toggle modes as needed in the callback above):    if(!remote.IsBalanceBoard())    {        if(remote.bExtension)            remote.SetReportType(wiimote::IN_BUTTONS_ACCEL_IR_EXT); // no IR dots        else            remote.SetReportType(wiimote::IN_BUTTONS_ACCEL_IR);		//    IR dots    }    // (stuff for animations)    DWORD	 last_rumble_time = timeGetTime(); // for rumble text animation    DWORD    last_led_time    = timeGetTime(); // for led         animation    bool	 rumble_text	  = true;    unsigned lit_led          = 0;    // display the wiimote state data until 'Home' is pressed:    bool caliubrate_atrest_once = true;    while(playing)// && !GetAsyncKeyState(VK_ESCAPE))    {        // the wiimote state needs to be refreshed for each pass        while(remote.RefreshState() == NO_CHANGE)            Sleep(1); // // don't hog the CPU if nothing changed        cursor_pos.Y = 8;        SetConsoleCursorPosition(console, cursor_pos);        // did we loose the connection?        if(remote.ConnectionLost())        {            BRIGHT_RED;            _tprintf(                _T("   *** connection lost! ***                                          /n")                BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE                BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE                BLANK_LINE BLANK_LINE BLANK_LINE);            Beep(100, 1000);            Sleep(2000);            COORD pos = { 0, 6 };            SetConsoleCursorPosition(console, pos);            _tprintf(BLANK_LINE BLANK_LINE BLANK_LINE);            goto reconnect;//.........这里部分代码省略.........
开发者ID:binofet,项目名称:ice,代码行数:101,


示例23: _ttoi

void COutputTabView::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult) {	//CAIPIEditView notification modified message    g_bNotificationModified = false; 			NM_LISTVIEW* pNMListView = (NM_LISTVIEW*) pNMHDR;	int nSelected = pNMListView->iItem;			CString strItemLine = m_listCtrl2.GetItemText(nSelected, 1);	CString strItemPos = m_listCtrl2.GetItemText(nSelected, 2);	CString strFilePath = m_listCtrl2.GetItemText(nSelected, 4);     int iLine = _ttoi(strItemLine);	unsigned int iPos = _ttoi(strItemPos);					if ( pNMListView->uNewState & LVIS_SELECTED)	{				if( strFilePath != _T(" - ") )		{					CAIPIApp* pApp = (CAIPIApp*)AfxGetApp();			BOOL alreadyOpen = pApp->SetDocumentView(strFilePath);						//if document is not already open then open it			if( alreadyOpen == FALSE )			{				pApp->m_pAIPIEditorDocTemplate->OpenDocumentFile(strFilePath);				if( pApp == NULL )				{					CMainFrame* pMainFrame = (CMainFrame*)::AfxGetMainWnd();					pMainFrame->m_wndOutputTabView.AddMsg1(_T("ERROR: The file  (") + strFilePath + _T(")   could not be linked. Check if the file is not corrupted."));					return;				}			}			else			{								//MessageBox(strItem);				CMDIFrameWnd* pFrame = (CMDIFrameWnd*)::AfxGetApp()->m_pMainWnd;				CMDIChildWnd* pChild = (CMDIChildWnd*) pFrame->MDIGetActive();					CScintillaView* pView = (CScintillaView*) pChild->GetActiveView();				ASSERT(pView);				CScintillaCtrl& rCtrl = pView->GetCtrl();						// Reset Scintilla Markers 				rCtrl.MarkerDeleteAll(0);				// Initilaize error markers				rCtrl.MarkerDefine(0, SC_MARK_SHORTARROW);				rCtrl.MarkerSetFore(0, RGB( 0, 0, 255 ));				rCtrl.MarkerSetBack(0, RGB( 0, 0, 255 ));						// Set error marker to proper line				rCtrl.GotoLine(iLine -1 );				rCtrl.MarkerAdd((iLine - 1), 0);				//Set the cursor position in the GUI				rCtrl.SetFocus();				rCtrl.SetSel(iPos, iPos + 1);			}		}			}			*pResult;	Beep(iPos, 100);	g_bNotificationModified = true;	}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:75,


示例24: TRACE

BOOL Progress::Update(INT32 CurrentCount,BOOL FreqEscChecks){#if DEBUG_OUTPUTTRACE( _T("Progress::Update ActiveDisplays = %d CurrentCount = %d FinalCount=%d/n"),ActiveDisplays,CurrentCount, FinalCount);#endif	// --- If no active progress display is on, then return immediately	if (ActiveDisplays <= 0)	{		ActiveDisplays = 0;		return(TRUE);	}	// --- If the job has been cancelled, then return FALSE to indicate user intervention	if (JobCancelled)		return(FALSE);	// If FreqEscChecks is TRUE, ensure we check the escape key, no matter what percentage is displayed		if (FreqEscChecks)	{		// Has the user cancelled the job via the Escape key?		if (KeyPress::IsEscapePressed())		{			JobCancelled = TRUE;			Beep();			return(FALSE);		}	}	// --- If the startup delay (if any) has not expired, we do nothing just yet	if (JobDelayed && !StartTime.Elapsed(STARTDELAY))		return(TRUE);	// --- Check that the parameter passed in was vaguely sensible	ERROR3IF(CurrentCount < 0, "Progress::Update called with out of range parameter");	// --- If we haven't yet shown the hourglass cursor, do it now	if (!HourglassShown)	{#if DELAY_THREAD		ThreadAlive = FALSE;		// Stop the delay thread (if any) because it's not needed now#endif		BeginBusyCursor();		HourglassShown = TRUE;	}	// --- Calculate the new percentage to display. This is limited to lie between	// the last displayed percentage and 99 inclusive.	INT32 NewPercent = CurrentPercent;	if (FinalCount > 0)	{		NewPercent = (100 * CurrentCount) / FinalCount;		if (NewPercent > 99)			NewPercent = 99;				if (NewPercent < CurrentPercent)			NewPercent = CurrentPercent;	}	// --- Now, update the percentage display if it has changed, or if it is a while since	// our last update. NOTE: Updates occur periodically for (a) checking the escape key state	// occasionally, so we can be called often without a huge performance hit, and (b) to 	// update frames of our animated hourglass pointer.	if (NewPercent > CurrentPercent)	{		// If FreqEscChecks is FALSE, we only check the escape key when the percentage increases		if (!FreqEscChecks)		{			// Has the user cancelled the job via the Escape key?			if (KeyPress::IsEscapePressed())			{				JobCancelled = TRUE;				Beep();				return(FALSE);			}		}		// (Create if necessary) and update the progress bar, if it is needed		if (DisplayBar && FinalCount > 0)		{			if (StatusLine::Get())			{				StatusLine::Get()->ShowProgress(TRUE, &JobDescription);				StatusLine::Get()->SetPercent(NewPercent);			}		}		// Remember the last displayed percentage		CurrentPercent = NewPercent;	}	return(TRUE);}
开发者ID:vata,项目名称:xarino,代码行数:95,


示例25: AddToBuffer

// need to copy from s to BufVOID AddToBuffer(LPCTSTR s){    if (FormatChanged) {        if (NowFormat.BackColor != BufFormat.BackColor ||                NowFormat.ForeColor != BufFormat.ForeColor ||                NowFormat.Bold      != BufFormat.Bold      ||                NowFormat.Underline != BufFormat.Underline ||                NowFormat.Italic    != BufFormat.Italic    )        {            FlushBuffer(TRUE);            BufFormat = NowFormat;        }        FormatChanged = FALSE;    }    if (InEscBuf) {        for (; *s != 0; s++) {            if (*s == TEXT('m')) {                Format f = NowFormat;                if (ParseEscapeCode(&f)) {                    FormatChanged = TRUE;                    NowFormat = f;                }                InEscBuf = FALSE;                AddToBuffer(s+1);                return;            } else if ((*s >= TEXT('0') && *s <= TEXT('9')) ||                       (*s == TEXT(';')) || (*s == TEXT('['))) {                EscBuf[EscBufPos++] = *s;                EscBufPos = min(EscBufPos, MAX_ESC_BUFSIZE);            } else {                InEscBuf = FALSE;                AddToBuffer(EscBuf);                break;            }        }    }    for (; *s != TEXT('/0'); s++) {        if (*s == TEXT('/b')) {            if (BufPos == 0) {                OutputPos--;            } else                BufPos--;        } else if (*s == TEXT('/07')) {            Beep( 750, 150 );        } else if (*s == TEXT('/033')) {            InEscBuf = TRUE;            EscBufPos = 0;            AddToBuffer(s+1);            return;        } else {            if (BufLen >= BufSize)                FlushBuffer(TRUE);            Buf[BufPos++] = *s;            BufLen = max(BufLen, BufPos);        }    }    EnsureTimer();}
开发者ID:ElfridaDwi,项目名称:winghci,代码行数:62,


示例26: MSVCRT__beep

/********************************************************************* *		_beep ([email
C++ BegLogLine函数代码示例
C++ BecomeExplosion1函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。