请教wicc中弹出的报警画面怎么做
最佳答案
同意1楼的说法,我来说详细点,你打开全局脚本C脚本编辑器
然后找到标准函数里的Alarm这个组里的GMsgFunction函数
把它改成下面这样
BOOL GMsgFunction( char* pszMsgData)
{
#pragma code("Winmm.dll")
void WINAPI PlaySoundA(char*pszSound,char*hmode,DWORD dwflay);
#pragma code()
MSG_RTDATA_STRUCT mRT;
memset( &mRT, 0, sizeof( MSG_RTDATA_STRUCT ) );
if( pszMsgData != NULL )
{
printf( "Meldung : %s \r\n", pszMsgData );
// Meldungsdaten einlesen
sscanf( pszMsgData, "%ld,%ld,%04d.%02d.%02d,%02d:%02d:%02d:%03d,%ld, %ld, %ld, %d,%d",
&mRT.dwMsgNr, // Meldungsnummer
&mRT.dwMsgState, // Status MSG_STATE_COME, .._GO, .._QUIT, .._QUIT_SYSTEM
&mRT.stMsgTime.wYear, // Tag
&mRT.stMsgTime.wMonth, // Monat
&mRT.stMsgTime.wDay, // Jahr
&mRT.stMsgTime.wHour, // Stunde
&mRT.stMsgTime.wMinute, // Minute
&mRT.stMsgTime.wSecond, // Sekunde
&mRT.stMsgTime.wMilliseconds, // Millisekunde
&mRT.dwTimeDiff, // Zeitdauer der anstehenden Meldung
&mRT.dwCounter, // Interner Meldungsz?hler
&mRT.dwFlags, // Flags( intern )
&mRT.wPValueUsed,
&mRT.wTextValueUsed );
// Prozesswerte lesen, falls gewünscht
}
if (mRT.dwMsgState==MSG_STATE_COME)
{
SetPictureName("背景画面","画面窗口名","报警弹出画面名称");
//或者在这里做一个MESSAGEBOX也可以,如下面的
//MessageBox(NULL,"有报警发生","alarm",MB_OK);
}
printf("Nr : %d, St: %x, %d-%d-%d %d:%d:%d.%d, Dur: %d, Cnt %d, Fl %d\r\n" ,
mRT.dwMsgNr, mRT.dwMsgState, mRT.stMsgTime.wDay, mRT.stMsgTime.wMonth, mRT.stMsgTime.wYear,
mRT.stMsgTime.wHour, mRT.stMsgTime.wMinute, mRT.stMsgTime.wSecond, mRT.stMsgTime.wMilliseconds, mRT.dwTimeDiff,
mRT.dwCounter, mRT.dwFlags ) ;
return( TRUE );
}
提问者对于答案的评价:
很祥细 谢谢
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc270982.html