用WinCC创建Windows对话框

西门子wincc脚本

#include “apdefap.h”
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{

int iRet = 0;

HWND WindowClassHandle_PDLRT = NULL;
WindowClassHandle_PDLRT = FindWindow (“PDLRTisAliveAndWaitsForYou”,NULL);

if(WindowClassHandle_PDLRT)
{
iRet = MessageBox(WindowClassHandle_PDLRT, “The message text!”, “Title”, MB_YESNOCANCEL|MB_ICONEXCLAMATION|MB_SETFOREGROUND|MB_SYSTEMMODAL);
switch (iRet){
case IDYES:
printf (“#I101: lpszObjectName=”%s" - MessageBox() iRet=%d (Button “YES”) \r\n",lpszObjectName, iRet);
break;
case IDNO:
printf (“#I102: lpszObjectName=”%s" - MessageBox() iRet=%d (Button “NO”) \r\n",lpszObjectName, iRet);
break;
case IDCANCEL:
printf (“#I103: lpszObjectName=”%s" - MessageBox() iRet=%d (Button “CANCEL”) \r\n",lpszObjectName, iRet);
break;
default:
printf (“#I100: lpszObjectName=”%s" - MessageBox() iRet=%d (Error!) \r\n",lpszObjectName, iRet);
break;
}
}
else
printf (“PDLRT-Handle not found\r\n”);
}

你可能感兴趣的:(windows,wincc,西门子)