用户授权
#include "apdefap.h"
int gscAction( void )
{
int i;
//char* ComputorName;
char* ServerName;
ServerName = GetTagChar("@ServerName");
SetTagChar("IPadr",ServerName);
//ComputorName = GetPropChar("HMI.Pdl","COMPUTORNAME","Text");
//printf("长=%d\r\n", strlen(ServerName));
for (i = 0; i < strlen(ServerName); i++) {
printf("i=%d:", i);
printf("%c\r\n", *(ServerName + i));
}
if(*(ServerName + 12)=='3' && *(ServerName + 13)=='8' && *(ServerName + 14)=='8')
{
printf("授权成功\r\n");
}
else
{
printf("授权失败\r\n");
//ExitWinCC(); //完全退出WINCC
DeactivateRTProject();//仅退出WINCC运行
}
return 0;
}
二次确认窗口
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
int xRet = MessageBox(NULL,"确定选择吗?","确认",MB_YESNO|MB_ICONQUESTION|MB_SYSTEMMODAL);
if ( xRet == IDYES )
{
int s=GetTagBit("sel"); //Return-Type: BOOL
if(s==1)