Exit C scripts run WINCC screen

     Add WINCC graphics editor of a button, the button object properties - press the left button to select C action action program, I hope when the screen is running, click on this button, you can - Events - button - mouse exit WINCC run screen.
     C its exit button script is this:
     to exit the current project click, and closed wincc explorer.
     If you just want to quit, do not close the wincc explorer (out of operation, but also edit) then remove ExitWinCC (); phrase can be.

. 1 #include " apdefap.h " 
2  void The OnLButtonDown ( char * lpszPictureName, char * lpszObjectName, char * lpszPropertyName, UINT nFlags, int X, int Y)
 . 3  {
 . 4 the HWND HWND = NULL;
 . 5  int iRet;
 . 6 HWND the FindWindow = ( NULL, " WinCC - Runtime - " );
 7 iRet = MessageBox (hwnd, " whether to exit the system? " , " attention " , MB_YESNO | MB_ICONQUESTION | MB_SYSTEMMODAL);
 8 if (iRet==IDYES)
 9 {
10  {DeactivateRTProject ();  
11   ExitWinCC() ;}
12 }
13 else
14 {  printf("chose NObutton ");}
15 }

 

Guess you like

Origin www.cnblogs.com/1500SCL/p/12317038.html