     case 185:        // prolog_path constant
      Buda1[Return]=TT_STR;
      Buda2[Return]=sv_StStore;
      strcpy((LPSTR)(StringStore+sv_StStore),make_short(ProgramPath));
      sv_StStore+=my_strlen(ProgramPath);
      StringStore[sv_StStore-1]=0;
      if (sv_StStore>=STRING_STORE && correct_STR_ST() )
        goto FULL;
      return(1);
     case 186:        // windows_path constant
      Buda1[Return]=TT_STR;
      Buda2[Return]=sv_StStore;
      GetWindowsDirectory(string3,MAX_PATH);
      i=ChangeCharset(M64_ch, ch_set, (BYTE *)string3, StringStore+sv_StStore, &k, default_char);
      if ((sv_StStore+=i+1)>=STRING_STORE && correct_STR_ST() )
        goto FULL;
      return(1);
     case 187:        // this_program_path constant
      Buda1[Return]=TT_STR;
      Buda2[Return]=sv_StStore;
      strcpy((LPSTR)string2, make_short(namef));
      for (i=strlen((LPSTR)string2); string2[--i]!='\\' && i!=0; );
      string2[i]=0;
      strcpy((LPSTR)(StringStore+sv_StStore),string2);
      sv_StStore+=strlen(string2)+1;
      if (sv_StStore>=STRING_STORE && correct_STR_ST() )
        goto FULL;
      return(1);
     case 188:        // this_program_name constant
      Buda1[Return]=TT_STR;
      Buda2[Return]=sv_StStore;
      strcpy((LPSTR)string2, make_short(namef));
      for (i=strlen((LPSTR)string2); string2[--i]!='\\' && i!=0; );
      strcpy((LPSTR)(StringStore+sv_StStore),string2+i+1);
      sv_StStore+=strlen(string2+i);
      if (sv_StStore>=STRING_STORE && correct_STR_ST() )
        goto FULL;
      return(1);
     case 163:        // get_handle
      if (Buda1[Arguments]==TT_OBJ)
      {
        CHECK_TYPE(0,C_S_WIN)
        Buda2[Return]=(DWORD)((CWnd*)ObjectStore[Buda2[Arguments]+2])->m_hWnd;
      }
      else if (Buda1[Arguments]==TT_LINK && pMainWindow)
        Buda2[Return]=(DWORD)pMainWindow->m_hWnd;
      else
        return(0);
      Buda1[Return]=TT_INT;
      return(1);
     case 153:        // set_current_directory
      if (Buda1[Arguments]==TT_STR)
      {
        if(SetCurrentDirectory(make_long(StringStore+Buda2[Arguments])))
          return(1);
      }
      else // Buda1[Arguments]==TT_LINK
      {
        my_strcpy((LPTSTR)string3, namef);
        for (i=my_strlen((LPTSTR)string3); string3[--i]!='\\' && i!=0; );
        string3[i]=0;
        if(SetCurrentDirectory((LPTSTR)string3))
          return(1);
      }
      MitiText("Runtime Error: Cannot set current directory.\r\n", &cf_red);
      goto E13;
     case 154:        // get_current_directory
      Buda1[Return]=TT_STR;
      Buda2[Return]=sv_StStore;
      GetCurrentDirectory(MAX_PATH,string3);
      i=ChangeCharset(M64_ch, ch_set, (BYTE *)string3, StringStore+sv_StStore, &k, default_char);
      if ((sv_StStore+=i+1)>=STRING_STORE && correct_STR_ST() )
        goto FULL;
      return(1);
     case 155:        // create_directory
      if(CreateDirectory(make_long(StringStore+Buda2[Arguments]),NULL))
        return(1);
      MitiText("Runtime Error: Cannot create a directory.\r\n", &cf_red);
      goto E13;
     case 156:        // remove_directory
      if(RemoveDirectory(make_long(StringStore+Buda2[Arguments])))
        return(1);
      MitiText("Runtime Error: Cannot remove a directory.\r\n", &cf_red);
      goto E13;
     case 157:        // delete_file
      //@@@
      if(DeleteFileA((LPSTR)(StringStore+Buda2[Arguments])))
        return(1);
      MitiText("Runtime Error: Cannot delete a file.\r\n", &cf_red);
      goto E13;
     case 201:        // copy_file
      if(CopyFile(make_long(StringStore+Buda2[Arguments]),
                   make_long(StringStore+Buda2[Arguments+1]), Buda2[Arguments+2]))
        return(1);
      MitiText("Runtime Error: Cannot copy a file.\r\n", &cf_red);
      goto E13;
     case 202:        // move_file
      //i=(Buda2[Arguments+2]!=0)?MOVEFILE_REPLACE_EXISTING:0;
      if(MoveFile(make_long(StringStore+Buda2[Arguments]),
                     make_long(StringStore+Buda2[Arguments+1])))
        return(1);
      MitiText("Runtime Error: Cannot move a file.\r\n", &cf_red);
      goto E13;
     case 158:        // set_active_window
      CHECK_TYPE(0,C_S_WIN_Main)
      if (ObjectStore[Buda2[Arguments]+2]) // ? do we need to check this
      {
        pMain_Frame=((C_FrameWnd*)ObjectStore[Buda2[Arguments]+2]);
        return(1);
      }
      else
        return(0);
     case 5:                       // Trace
      Trace=1;
      pMainFrame->SetWindowText(_T("StrProlog is TRACING."));
      return(1);
     case 8:                       // Beep
      MessageBeep(0);
      return(1);
     case 71:                       // Beep(S)
      switch (Buda1[Arguments])
      {
       case 0:
        i=0;
        break;
       case 65:  // ? SystemQuestion 
        i=MB_ICONQUESTION;
        break;
       case 40:  // d SystemDefault
        i=MB_OK;
        break;
       case 80:  // ! SystemExclamation
        i=MB_ICONEXCLAMATION;
        break;
       case 45:  // i SystemAsterisk
        i=MB_ICONASTERISK;
        break;
       case 55:  // s SystemHand
        i=MB_ICONHAND;
        break;
       case TT_STR:
          PlaySound(make_long(StringStore+Buda2[Arguments]), NULL, SND_SYNC); 
        return(1);
       default: // Standard beep using the computer speaker
        i=0xFFFFFFFF;
      }
      MessageBeep(i);
      return(1);
     case 14:        // Message box
     case 15:        // message box Yes - no
      switch (Buda1[Arguments+2])
      {
       case 65:  // ?
        i=MB_ICONQUESTION;
        break;
       case 80:  // !
        i=MB_ICONEXCLAMATION;
        break;
       case 45:  // i
        i=MB_ICONINFORMATION;
        break;
       case 55:  // s
        i=MB_ICONSTOP;
        break;
       default:
        i=0;
      }
      {
      CWnd* pWinTemp=(pMain_Frame)?pMain_Frame:(CWnd*)pMainFrame;
      if (p_line==14)
      {
#ifdef UNICODE
        DWORD my_k;
        ChangeCharset(ch_set, 64, StringStore+Buda2[Arguments], (BYTE *)string2, &my_k, default_char);
        MessageBox(pWinTemp->m_hWnd, make_long(StringStore+Buda2[Arguments+1]),
                              (wchar_t *)string2, i | MB_OK);
#else
        MessageBox(pWinTemp->m_hWnd, make_long(StringStore+Buda2[Arguments+1]),
                              (LPSTR)(StringStore+Buda2[Arguments]), i | MB_OK);
#endif
        return(1);  
      }
      else
      {
#ifdef UNICODE
        DWORD my_k;
        ChangeCharset(ch_set, 64, StringStore+Buda2[Arguments], (BYTE *)string2, &my_k, default_char);
        j=MessageBox(pWinTemp->m_hWnd, make_long(StringStore+Buda2[Arguments+1]),
                           (wchar_t *)string2, i | MB_YESNO);
#else
        j=MessageBox(pWinTemp->m_hWnd, make_long(StringStore+Buda2[Arguments+1]),
                           (LPSTR)(StringStore+Buda2[Arguments]), i | MB_YESNO);
#endif
        if (IDYES==j)
          return(1);
        else
          return(0);
      }
      }//for
     case 171:                       // play_sound
      if (Buda1[Arguments+1]==TT_INT)
        k=1000*Buda2[Arguments+1];
      else if (Buda1[Arguments+1]==TT_FLOAT)
        k=(int)(1000 * (*(float*)&(Buda2[Arguments+1])) );
      Beep(Buda2[Arguments], k);
      return(1);
     case 198:       // draw_point
     case 199:       // draw_bitmap
      {
        HDC hDC, hMem;
        
        if (pMain_DC)
          hDC=pMain_DC->m_hDC;
        else if (pMain_Frame)
          hDC=GetDC(pMain_Frame->m_hWnd);
        else
          return(0);
        if (p_line==198)  // draw_point
        {
          if (Buda1[Arguments+2]==TT_LINK)
          {
            DWORD color=GetPixel(hDC, Buda2[Arguments], Buda2[Arguments+1]);
            if (color==CLR_INVALID)
              return(0);
            Buda1[Buda2[Arguments+2]]=TT_INT;
            Buda2[Buda2[Arguments+2]]=color;
            WILL_CLEAN(Buda2[Arguments+2]);
          }
          else if (Buda1[Arguments+2]==TT_INT)
            SetPixel(hDC, Buda2[Arguments], Buda2[Arguments+1], Buda2[Arguments+2]);
          else
            return(0);
          return(1);
        }   // draw_bitmap
        CHECK_TYPE(2,CLASS_SYSTEM_BITMAP)
        hMem=CreateCompatibleDC(hDC);
        i=ObjectStore[Buda2[Arguments+2]+4];
        j=ObjectStore[Buda2[Arguments+2]+5];
        if (Buda1[Arguments+3]==TT_LINK)
        {
          if (ObjectStore[Buda2[Arguments+2]+3]==0)
          {
            SelectObject(hMem, (HBITMAP)ObjectStore[Buda2[Arguments+2]+2]);
            BitBlt(hDC, Buda2[Arguments], Buda2[Arguments+1], i, j, hMem, 0, 0, SRCCOPY);
          }
          else
          {
            SelectObject(hMem, (HBITMAP)ObjectStore[Buda2[Arguments+2]+3]);
            BitBlt(hDC, Buda2[Arguments], Buda2[Arguments+1], i, j, hMem, 0, 0, SRCAND);
            SelectObject(hMem, (HBITMAP)ObjectStore[Buda2[Arguments+2]+2]);
            BitBlt(hDC, Buda2[Arguments], Buda2[Arguments+1], i, j, hMem, 0, 0, SRCPAINT);
          }
        }
        else
        {
          float fl;
          if (Buda1[Arguments+3]==TT_FLOAT)
          {
            fl=*(float*)&(Buda2[Arguments+3]);
            m=(int)fl;
          }
          else //if (Buda1[Arguments+3]==TT_INT)
          {
            fl=(float)(int)(Buda2[Arguments+3]);
            m=Buda2[Arguments+3];
          }
          if (Buda1[Arguments+4]==TT_LINK)
          {
            m=(int)(i*fl);
            n=(int)(j*fl);
          }
          else
            n=Buda2[Arguments+4];
          if (ObjectStore[Buda2[Arguments+2]+3]==0)
          {
            SelectObject(hMem, (HBITMAP)ObjectStore[Buda2[Arguments+2]+2]);
            //k=GetDeviceCaps(hDC, RC_STRETCHBLT); 
            //k=GetDeviceCaps(hMem, RC_STRETCHBLT); 
            //SetStretchBltMode(hMem, COLORONCOLOR); 
            if (StretchBlt(hDC, Buda2[Arguments], Buda2[Arguments+1],m,n,hMem,i,j,0,0,SRCCOPY)==0)
            {
              DWORD theerr = GetLastError();
              FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL,theerr,0,string3,L_BUFER,NULL);
              MitiText(make_utf8(string3));
            }
          }
          else
          {
            SelectObject(hMem, (HBITMAP)ObjectStore[Buda2[Arguments+2]+3]);
            StretchBlt(hDC, Buda2[Arguments], Buda2[Arguments+1],m,n,hMem,i,j,0,0,SRCAND);
            SelectObject(hMem, (HBITMAP)ObjectStore[Buda2[Arguments+2]+2]);
            StretchBlt(hDC, Buda2[Arguments], Buda2[Arguments+1],m,n,hMem,i,j,0,0,SRCPAINT);
          }
        }
        DeleteDC(hMem);
        return(1);
      }
     case 17:        // Polygon
     case 130:       // RoundRect
     case 131:       // Chord
     case 132:       // Pie
     case 133:       // Arc
     case 18:        // PolyBezier
     case 16:        // Line
     case 128:       // Ellipse
     case 129:       // Rectangle
        {
          HDC hDC;
          
          if (pMain_DC)
            hDC=pMain_DC->m_hDC;
          else if (pMain_Frame)
            hDC=GetDC(pMain_Frame->m_hWnd);
          else
            return(0);
          SelectObject(hDC, hPen);
          if (p_line>=16 && p_line<=18)
          {
            if (p_line==16)
            {
              DWORD *Temp=(LPDWORD)ObjectStore[Buda2[Arguments]+4];
              MoveToEx(hDC, Temp[0], Temp[1], NULL);
              for (i=2; i<ObjectStore[Buda2[Arguments]+2]; i+=2)
                LineTo(hDC, Temp[i], Temp[i+1]);
            }
            else if (p_line==17)
            {
              SelectObject(hDC, hBrush);
              Polygon(hDC, (POINT*)ObjectStore[Buda2[Arguments]+4], ObjectStore[Buda2[Arguments]+2]/2);
            }
            else
              PolyBezier(hDC, (POINT*)ObjectStore[Buda2[Arguments]+4], ObjectStore[Buda2[Arguments]+2]/2);
            if (ObjectStore[Buda2[Arguments]+6]&HALF) // free the list
            {
              DWORD old;
              if ((old=i=j=the_free_list)!=M1)
                for ( ; ObjectStore[i+3]<ObjectStore[Buda2[Arguments]+3] && (j=ObjectStore[i+6])!=M1; old=i, i=j);
              if (the_free_list==j)
                the_free_list=Buda2[Arguments];
              else
                ObjectStore[old+6]=Buda2[Arguments];
              //ObjectStore[Buda2[Arguments]]=CLASS_FREE_LIST;
              ObjectStore[Buda2[Arguments]+6]=j;
            }
          }
          else
          {
            SelectObject(hDC, hBrush);
            if (p_line==128)
              Ellipse(hDC, Buda2[Arguments], Buda2[Arguments+1], Buda2[Arguments+2], Buda2[Arguments+3]);
            else if (p_line==129)
              Rectangle(hDC, Buda2[Arguments], Buda2[Arguments+1], Buda2[Arguments+2], Buda2[Arguments+3]);
            else if (p_line==130)
              RoundRect(hDC, Buda2[Arguments], Buda2[Arguments+1], Buda2[Arguments+2], Buda2[Arguments+3], Buda2[Arguments+4], Buda2[Arguments+5]);
            else if (p_line==131)
              Chord(hDC, Buda2[Arguments], Buda2[Arguments+1], Buda2[Arguments+2], Buda2[Arguments+3], Buda2[Arguments+4], Buda2[Arguments+5], Buda2[Arguments+6], Buda2[Arguments+7]);
            else if (p_line==132)
              Pie(hDC, Buda2[Arguments], Buda2[Arguments+1], Buda2[Arguments+2], Buda2[Arguments+3], Buda2[Arguments+4], Buda2[Arguments+5], Buda2[Arguments+6], Buda2[Arguments+7]);
            else
              Arc(hDC, Buda2[Arguments], Buda2[Arguments+1], Buda2[Arguments+2], Buda2[Arguments+3], Buda2[Arguments+4], Buda2[Arguments+5], Buda2[Arguments+6], Buda2[Arguments+7]);
          }
          if (pMain_DC==NULL)
            ReleaseDC(pMain_Frame->m_hWnd, hDC);
        }
        return(1);
     case 19:        // Pen
      if (Buda1[Arguments]==TT_OBJ)        // Object pen
      {
        CHECK_TYPE(0,CLASS_SYSTEM_PEN)
        hPen=(HPEN)ObjectStore[Buda2[Arguments]+2];
        return(1);
      }
      else if (Buda1[Arguments]==TT_LINK)
      {
        LOGPEN logPen;

        if (Buda1[Arguments+1]==TT_INT)
        {
          j=Buda2[Arguments+1];
          GetObject(hPen, sizeof(LOGPEN), &logPen);
          Buda1[Buda2[Arguments]]=TT_INT;
          i=Buda2[Buda2[Arguments]]=logPen.lopnWidth.x;
          WILL_CLEAN(Buda2[Arguments]);
        }
        else if (Return==M1)// (Buda1[Arguments+1]==TT_LINK)
        {
          GetObject(hPen, sizeof(LOGPEN), &logPen);
          Buda1[Buda2[Arguments]]=Buda1[Buda2[Arguments+1]]=TT_INT;
          Buda2[Buda2[Arguments]]=logPen.lopnWidth.x;
          Buda2[Buda2[Arguments+1]]=logPen.lopnColor;
          WILL_CLEAN(Buda2[Arguments]);
          WILL_CLEAN(Buda2[Arguments+1]);
          return(1);
        }
        else
          return(0);
      }
      else // (Buda1[Arguments]==TT_INT)
      {
        if (Buda1[Arguments+1]==TT_LINK)
        {
          LOGPEN logPen;

          i=Buda2[Arguments];
          GetObject(hPen, sizeof(LOGPEN), &logPen);
          Buda1[Buda2[Arguments+1]]=TT_INT;
          j=Buda2[Buda2[Arguments+1]]=logPen.lopnColor;
          WILL_CLEAN(Buda2[Arguments+1]);
        }
        else // (Buda1[Arguments+1]==TT_INT)
        {
          i=Buda2[Arguments];
          j=Buda2[Arguments+1];
        }
      }
      if (i)
        hPen=CreatePen(PS_INSIDEFRAME, i, j);
      else
        hPen=CreatePen(PS_NULL, 0, 0);
      if (Return==M1)
      {
        DeleteObject(hSavePen);
        hSavePen=hPen;
      }
      else
      {
        Buda1[Return]=TT_OBJ;
        Buda2[Return]=ObjectStore_br;
        ObjectStore[ObjectStore_br+2]=(DWORD)hPen;
        ObjectStore[ObjectStore_br+1]=M1;  // object name
        ObjectStore[ObjectStore_br]=CLASS_SYSTEM_PEN;
        if ((ObjectStore_br+=3)>=OBJ_STORE && correct_OBJ_ST() )
          goto FULL2;
      }
      return(1);    
     case 74:        // brush(C, Type)
      if (Buda1[Arguments]==TT_OBJ)        // Object brush
      {
        CHECK_TYPE(0,CLASS_SYSTEM_BRUSH)
        hBrush=(HBRUSH)ObjectStore[Buda2[Arguments]+2];
        return(1);
      }
      else if (Buda1[Arguments]==TT_STR)        // brush(Bitmap)
      {
        hBrush=CreatePatternBrush((HBITMAP)LoadImage(NULL, 
            make_long(StringStore+Buda2[Arguments]), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE));
        goto E_brush;
      }
      else if ( Buda2[Arguments]>0xffffff ) //Buda1[Arguments]==TT_INT
        return(0);
      switch(Buda1[Arguments+1])
      {
       case 44:  // h   Horizontal
       case 73:  // (-) Horizontal
        hBrush=CreateHatchBrush(HS_HORIZONTAL, Buda2[Arguments]);
        break;
       case 58:  // v Vertical 
       case 80:  // ! Vertical
        hBrush=CreateHatchBrush(HS_VERTICAL, Buda2[Arguments]);
        break;
       case 60:  // x Diagcross 
        hBrush=CreateHatchBrush(HS_DIAGCROSS, Buda2[Arguments]);
        break;
       case 63:  // (\)
        hBrush=CreateHatchBrush(HS_FDIAGONAL, Buda2[Arguments]);
        break;
       case 72:  // (+) Cross 
        hBrush=CreateHatchBrush(HS_CROSS, Buda2[Arguments]);
        break;
       case 74:  // (/)
        hBrush=CreateHatchBrush(HS_BDIAGONAL, Buda2[Arguments]);
        break;
       default:  // TT_LINK
        hBrush=CreateSolidBrush(Buda2[Arguments]);
      }
E_brush:if (Return==M1)
      {
        DeleteObject(hSaveBrush);
        hSaveBrush=hBrush;
      }
      else
      {
        Buda1[Return]=TT_OBJ;
        Buda2[Return]=ObjectStore_br;
        ObjectStore[ObjectStore_br+2]=(DWORD)hBrush;  // indentifier ?==ObjectStore_br
        ObjectStore[ObjectStore_br+1]=M1;  // object name
        ObjectStore[ObjectStore_br]=CLASS_SYSTEM_BRUSH;
        if ((ObjectStore_br+=3)>=OBJ_STORE && correct_OBJ_ST() )
          goto FULL2;
      }
      return(1);
     case 75:        // window Brush color(W, C, Type)
      if (Buda1[Arguments+1]==TT_STR) // color(W, Bitmap)
      {
        if (Buda1[Arguments]==TT_OBJ)
        {
          i=Buda2[Arguments];
          if (i>=ObjectStore_br)
            return(0);
        }
        else if (pMainWindow && pMainWindow!=pMain_Frame)
          i=pMainWindow->GetDlgCtrlID();
        else if (pMain_Frame)
          i=pMain_Frame->m_Number;
        else
          return(0);
        if (ObjectStore[i+6]!=(DWORD)hbrGreen)  
          DeleteObject((HBRUSH)ObjectStore[i+6]);
        ObjectStore[i+6]=(long)CreatePatternBrush((HBITMAP)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments+1]), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE));
        return(1);
      }
     case 34:        // window Text color
     case 35:        // window bacK color
      if (Buda1[Arguments+1]==TT_INT && Buda2[Arguments+1]>0xffffff) 
        return(0);  
      if (Buda1[Arguments]==TT_OBJ)
      {
        i=Buda2[Arguments];
        if (i>=ObjectStore_br)
          return(0);
      }
      else if (pMainWindow && pMainWindow!=pMain_Frame)
        i=pMainWindow->GetDlgCtrlID();
      else if (pMain_Frame)
        i=pMain_Frame->m_Number;
      else
        return(0);
      if (p_line==75)// window Brush color
      {
        if (ObjectStore[i+6]!=(DWORD)hbrGreen)  
          DeleteObject((HBRUSH)ObjectStore[i+6]);
        if (Buda1[Arguments+1]!=TT_INT)
        {
          ObjectStore[i+6]=(DWORD)hbrGreen;
          return(1);
        }
        switch(Buda1[Arguments+2])
        {
         case 44:  // h   Horizotal
         case 73:  // (-) Horizotal
          ObjectStore[i+6]=(long)CreateHatchBrush(HS_HORIZONTAL, Buda2[Arguments+1]);
          break;
         case 58:  // v   Vertical 
         case 80:  // ! Vertical
          ObjectStore[i+6]=(long)CreateHatchBrush(HS_VERTICAL, Buda2[Arguments+1]);
          break;
         case 60:  // x Diagcross 
          ObjectStore[i+6]=(long)CreateHatchBrush(HS_DIAGCROSS, Buda2[Arguments+1]);
          break;
         case 63:  // (\)
          ObjectStore[i+6]=(long)CreateHatchBrush(HS_FDIAGONAL, Buda2[Arguments+1]);
          break;
         case 72:  // (+) Cross 
          ObjectStore[i+6]=(long)CreateHatchBrush(HS_CROSS, Buda2[Arguments+1]);
          break;
         case 74:  // (/)
          ObjectStore[i+6]=(long)CreateHatchBrush(HS_BDIAGONAL, Buda2[Arguments+1]);
          break;
         default:  // TT_LINK
          ObjectStore[i+6]=(long)CreateSolidBrush(Buda2[Arguments+1]);
        }
      }
      else if (SUBTYPE(ObjectStore[i],C_S_WIN_Edit))
      {
        if (p_line==34)
        {
          CHARFORMAT cf;
          if (Buda1[Arguments+1]==TT_INT)
            cf.crTextColor=ObjectStore[i+4]=Buda2[Arguments+1];
          else
            cf.crTextColor=ObjectStore[i+4]=RGB(0, 0, 0);
          cf.dwMask=CFM_COLOR;
          cf.dwEffects=0; // not CFE_AUTOCOLOR
          ((CRichEditCtrl*)ObjectStore[i+2])->SetDefaultCharFormat(cf);
        }
        else if (Buda1[Arguments+1]==TT_INT)
        {
          ((CRichEditCtrl*)ObjectStore[i+2])->SetBackgroundColor(FALSE, Buda2[Arguments+1]);
          ObjectStore[i+5]=Buda2[Arguments+1];
        }
        else
        {
          ((CRichEditCtrl*)ObjectStore[i+2])->SetBackgroundColor(TRUE, 0);
          ObjectStore[i+5]=GetSysColor(COLOR_WINDOW);
        }
      }
      else if (SUBTYPE(ObjectStore[i],C_S_WIN_ListBox))
      {
        if (p_line==34)
        {
          if (Buda1[Arguments+1]==TT_INT)
            ObjectStore[i+4]=Buda2[Arguments+1];
          else
            ObjectStore[i+4]=RGB(0, 0, 0);
          ((CListCtrl*)ObjectStore[i+2])->SetTextColor(ObjectStore[i+4]);
        }
        else 
        {
          if (Buda1[Arguments+1]==TT_INT)
            ObjectStore[i+5]=Buda2[Arguments+1];
          else
            ObjectStore[i+5]=GetSysColor(COLOR_WINDOW);
          ((CListCtrl*)ObjectStore[i+2])->SetBkColor(ObjectStore[i+5]);
          ((CListCtrl*)ObjectStore[i+2])->SetTextBkColor(ObjectStore[i+5]);
        }
      }
      else if (p_line==34)
      {
        ObjectStore[i+4]=(Buda1[Arguments+1]==TT_INT)?Buda2[Arguments+1]:RGB(0, 0, 0);
        if (pMain_DC)
          SetTextColor(pMain_DC->m_hDC, ObjectStore[i+4]);
      }
      else
      {
        ObjectStore[i+5]=(Buda1[Arguments+1]==TT_INT)?Buda2[Arguments+1]:GetSysColor(COLOR_WINDOW);
        if (pMain_DC)
          SetBkColor(pMain_DC->m_hDC, ObjectStore[i+5]);
      }
      return(1);
     case 159:        // Font
      if (Buda1[Arguments]==TT_OBJ)        // Object font
      {
        CHECK_TYPE(0,CLASS_SYSTEM_FONT)
        hFont=(HFONT)ObjectStore[Buda2[Arguments]+2];
        return(1);
      }
      hFont=CreateFont( 
              (Buda1[Arguments+1]==TT_INT)?Buda2[Arguments+1]:0,
              (Buda1[Arguments]==TT_INT)?Buda2[Arguments]:0,
              0,0,0,0,0,0,0,0,0,0,0,
              (Buda1[Arguments+2]==TT_STR)? make_long(StringStore+Buda2[Arguments+2]):NULL );
      if (Return==M1)
      {
        if (hSaveFont)
          DeleteObject(hSaveFont);
        hSaveFont=hFont;
      }
      else
      {
        Buda1[Return]=TT_OBJ;
        Buda2[Return]=ObjectStore_br;
        ObjectStore[ObjectStore_br+2]=(DWORD)hFont;
        ObjectStore[ObjectStore_br+1]=M1;  // object name
        ObjectStore[ObjectStore_br]=CLASS_SYSTEM_FONT;
        if ((ObjectStore_br+=3)>=OBJ_STORE && correct_OBJ_ST() )
          goto FULL2;
      }
      return(1);    
     case 160:        // font_mask
      {
        CHARFORMAT *cf;

        cf=(CHARFORMAT*)(ObjectStore+ObjectStore_br+2);
        if (Buda1[Arguments]==Definition[DF_DEFAULT])
        {
          cf->dwMask=cf_black.dwMask;
          cf->crTextColor=cf_black.crTextColor;
          my_strcpy(cf->szFaceName, cf_black.szFaceName);
          cf->yHeight=cf_black.yHeight;
          cf->yOffset=cf_black.yOffset;
          cf->dwEffects=cf_black.dwEffects;
        }
        else if (Buda1[Arguments]==TT_OBJ)
        {
          CHARFORMAT *cf2;

          CHECK_TYPE(0,CLASS_SYSTEM_FONTMASK)
          cf2=(CHARFORMAT*)(ObjectStore+Buda2[Arguments]+2);
          cf->dwMask=cf2->dwMask;
          cf->crTextColor=cf2->crTextColor;
          my_strcpy(cf->szFaceName, cf2->szFaceName);
          cf->yHeight=cf2->yHeight;
          if (cf->yHeight <190) cf->yHeight=190; //plamen test
          cf->yOffset=cf2->yOffset;
          cf->dwEffects=cf2->dwEffects;
        }
        else
          cf->dwMask=0;
        cf->cbSize=sizeof(CHARFORMAT); //?
        if (Buda1[Arguments+1]==TT_INT)
        {
          cf->crTextColor=Buda2[Arguments+1];
          cf->dwMask|=CFM_COLOR;
        }
        if (Buda1[Arguments+2]==TT_STR && strlen((LPSTR)(StringStore+Buda2[Arguments+2]))<LF_FACESIZE)
        {
          my_strcpy(cf->szFaceName, make_long(StringStore+Buda2[Arguments+2]));
          cf->dwMask|=CFM_FACE;
        }
        if (Buda1[Arguments+3]==TT_INT)
        {
          cf->yHeight=20*Buda2[Arguments+3];
          if (cf->yHeight <190) cf->yHeight=190; //plamen test
          cf->dwMask|=CFM_SIZE;
        }
        else if (Buda1[Arguments+3]==TT_FLOAT)
        {
          cf->yHeight=(int)(20* *(float*)&(Buda2[Arguments+3]));
          if (cf->yHeight <190) cf->yHeight=190; //plamen test
          cf->dwMask|=CFM_SIZE;
        }
        if (Buda1[Arguments+4]==TT_INT)
        {
          cf->yOffset=20*Buda2[Arguments+4];
          cf->dwMask|=CFM_OFFSET;
        }
        else if (Buda1[Arguments+4]==TT_FLOAT)
        {
          cf->yOffset=(int)(20* *(float*)&(Buda2[Arguments+4]));
          cf->dwMask|=CFM_OFFSET;
        }
        if (Buda1[Arguments+5]!=TT_LINK)
        {
          if (Buda1[Arguments+5]==Definition[DF_BOLD])
            cf->dwEffects|=CFE_BOLD;
          else
            cf->dwEffects&=CFE_BOLD^M1;
          cf->dwMask|=CFM_BOLD;
        }
        if (Buda1[Arguments+6]!=TT_LINK)
        {
          if (Buda1[Arguments+6]==Definition[DF_ITALIC])
            cf->dwEffects|=CFE_ITALIC;
          else
            cf->dwEffects&=CFE_ITALIC^M1;
          cf->dwMask|=CFM_ITALIC;
        }
        if (Buda1[Arguments+7]!=TT_LINK)
        {
          if (Buda1[Arguments+7]==Definition[DF_UNDERLINE])
            cf->dwEffects|=CFE_UNDERLINE;
          else
            cf->dwEffects&=CFE_UNDERLINE^M1;
          cf->dwMask|=CFM_UNDERLINE;
        }
        Buda1[Return]=TT_OBJ;
        Buda2[Return]=ObjectStore_br;
        ObjectStore[ObjectStore_br+1]=M1;  // object name
        ObjectStore[ObjectStore_br]=CLASS_SYSTEM_FONTMASK;
        if ((ObjectStore_br+=3+sizeof(CHARFORMAT)/4)>=OBJ_STORE && correct_OBJ_ST() )
          goto FULL2;
      }
      return(1);    
     case 161:        // set_default
      if (SUBTYPE(ObjectStore[Buda2[Arguments]],CLASS_SYSTEM_PEN))
        hPen=(HPEN)ObjectStore[Buda2[Arguments]+2];
      else if (SUBTYPE(ObjectStore[Buda2[Arguments]],CLASS_SYSTEM_BRUSH))
        hBrush=(HBRUSH)ObjectStore[Buda2[Arguments]+2];
      else if (SUBTYPE(ObjectStore[Buda2[Arguments]],CLASS_SYSTEM_FONT))
        hFont=(HFONT)ObjectStore[Buda2[Arguments]+2];
      else if (SUBTYPE(ObjectStore[Buda2[Arguments]],CLASS_SYSTEM_FONTMASK))
        pFontMask=(CHARFORMAT*)(ObjectStore+Buda2[Arguments]+2);
      else
      {
        error_func3(Arguments,p_line,0,CLASS_SYSTEM_PEN,HALF|CLASS_SYSTEM_FONT);
        return(0);
      }
      return(1);
     case 197:        // bitmap_image
      {
        BITMAP bm;
        CBitmap* pBitmap;
        if ((ObjectStore[ObjectStore_br+2]=(DWORD)(HBITMAP)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments]), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE))==NULL)
        {
          MitiText("Cannot open the bitmap file:\r\n", &cf_red);
          MitiText((LPSTR)(StringStore+Buda2[Arguments])); MitiText("\r\n");
          return(0);
        }
        pBitmap=pBitmap->FromHandle((HBITMAP)ObjectStore[ObjectStore_br+2]);
        pBitmap->GetBitmap(&bm);
        if (Buda1[Arguments+1]==TT_STR)
        {
          if ((ObjectStore[ObjectStore_br+3]=(DWORD)(HBITMAP)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments+1]), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE))==NULL)
          {
            MitiText("Cannot open the bitmap file for the mask:\r\n", &cf_red);
            MitiText((LPSTR)(StringStore+Buda2[Arguments+1])); MitiText("\r\n");
            return(0);
          }
        }
        else
          ObjectStore[ObjectStore_br+3]=0;
        Buda1[Return]=TT_OBJ;
        Buda2[Return]=ObjectStore_br;
        ObjectStore[ObjectStore_br+4]=bm.bmWidth;
        ObjectStore[ObjectStore_br+5]=bm.bmHeight;
        ObjectStore[ObjectStore_br+1]=M1;  // object name
        ObjectStore[ObjectStore_br]=CLASS_SYSTEM_BITMAP;
        if ((ObjectStore_br+=6)>=OBJ_STORE && correct_OBJ_ST() )
          goto FULL2;
      }
      return(1);    
     case 30:        // Size
     case 31:        // Position
     case 408:       // client
      {
      CWnd *pWindow;
      if (Buda1[Arguments]==TT_OBJ)
      {
        CHECK_TYPE(0,C_S_WIN)
        if (ObjectStore[Buda2[Arguments]+2])  // ? do we need to check this
          pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2]);
        else
          return 0;
      }
      else if ((pWindow=(pMainWindow==NULL)?pMain_Frame:pMainWindow)==NULL)
        return 0;
      if (p_line==408)    // client
      {
        WINDOWINFO wi;
        
        if (pWindow->GetWindowInfo(&wi)==0)
          return 0;
        Buda1[Buda2[Arguments+1]]=Buda1[Buda2[Arguments+2]]=Buda1[Buda2[Arguments+3]]=Buda1[Buda2[Arguments+4]]=TT_INT;
        Buda2[Buda2[Arguments+1]]=wi.rcClient.left;
        Buda2[Buda2[Arguments+2]]=wi.rcClient.top;
        Buda2[Buda2[Arguments+3]]=wi.rcClient.right;
        Buda2[Buda2[Arguments+4]]=wi.rcClient.bottom;
        WILL_CLEAN(Buda2[Arguments+1]);
        WILL_CLEAN(Buda2[Arguments+2]);
        WILL_CLEAN(Buda2[Arguments+3]);
        WILL_CLEAN(Buda2[Arguments+4]);
        return 1;
      }
      if (Buda1[Arguments+1]==TT_INT)
      { 
        if (Buda1[Arguments+2]!=TT_INT || pWindow==NULL)
          return(0);
        if (p_line==31)    // Position
          pWindow->SetWindowPos(0, Buda2[Arguments+1], Buda2[Arguments+2], 0, 0, SWP_NOSIZE | SWP_NOZORDER);
        else
          pWindow->SetWindowPos(0, 0, 0, Buda2[Arguments+1], Buda2[Arguments+2], SWP_NOMOVE | SWP_NOZORDER);
      }
      else if (Buda1[Arguments+1]!=TT_LINK || Buda1[Arguments+2]!=TT_LINK || pWindow==NULL)
        return(0);
      else
      {
        RECT TempRect;

        Buda1[Buda2[Arguments+1]]=Buda1[Buda2[Arguments+2]]=TT_INT;
        WILL_CLEAN(Buda2[Arguments+1]);
        WILL_CLEAN(Buda2[Arguments+2]);
        pWindow->GetWindowRect (&TempRect);
        if (p_line==31)   // Position
        {
          POINT Point;

          Point.x=TempRect.left;
          Point.y=TempRect.top;
          if (pWindow->GetParent()!=NULL)
            MapWindowPoints(NULL, pWindow->GetParent()->m_hWnd, &Point, 1);
          Buda2[Buda2[Arguments+1]]=Point.x;
          Buda2[Buda2[Arguments+2]]=Point.y;
        }
        else
        {
          Buda2[Buda2[Arguments+1]]=TempRect.right-TempRect.left;
          Buda2[Buda2[Arguments+2]]=TempRect.bottom-TempRect.top;
        }
      }
      }//for def
      return(1);
     case 176:        // enable_window
      if (Buda1[Arguments]==TT_LINK)
        ((CWnd*)pMainWindow)->EnableWindow(Buda2[Arguments+1]);
      else
      {
        CHECK_TYPE(0,C_S_WIN)
        ((CWnd*)ObjectStore[Buda2[Arguments]+2])->EnableWindow(Buda2[Arguments+1]);
      }
      return(1);
     case 139:        // Set Check
      if (Buda1[Arguments]==TT_LINK)
        ((CButton*)pMainWindow)->SetCheck(Buda2[Arguments+1]);
      else
      {
        CHECK_TYPE(0,C_S_WIN_CheckBox)
        ((CButton*)ObjectStore[Buda2[Arguments]+2])->SetCheck(Buda2[Arguments+1]);
      }
      return(1);
     case 140:        // Get Check
      Buda1[Return]=TT_INT;
      if (Buda1[Arguments]==TT_LINK)
        Buda2[Return]=((CButton*)pMainWindow)->GetCheck();
      else
      {
        CHECK_TYPE(0,C_S_WIN_CheckBox)
        Buda2[Return]=((CButton*)ObjectStore[Buda2[Arguments]+2])->GetCheck();
      }
      return(1);
     case 141:        // Set Timer
      if (Buda1[Arguments+1]==TT_FLOAT)
        k=(int)(*(float*)&(Buda2[Arguments+1])*1000);
      else // (Buda1[Arguments+1]==TT_INT)
        k=Buda2[Arguments+1]*1000;
      if (Buda1[Arguments]==TT_LINK)
      {
        if (pMainWindow==NULL)
        {
          MitiText("Cannot set timer. It has to be attached to a window.\r\n", &cf_red);
          return 0;
        }
        else
          i=pMainWindow->SetTimer( ObjectStore_br, k, NULL);
      }
      else
      {
        CHECK_TYPE(0,C_S_WIN_Main)
        i=((CWnd*)ObjectStore[Buda2[Arguments]+2])->SetTimer( ObjectStore_br, k, NULL);
      }
      if (i==0 || Buda1[Arguments+2]>=MEMORY_c256)
        return(0);
      Buda1[Return]=TT_OBJ;
      Buda2[Return]=ObjectStore_br;
      ObjectStore[ObjectStore_br+3]=Buda1[Arguments+2];  // function
      ObjectStore[ObjectStore_br+2]=i;  // indentifier ?==ObjectStore_br
      ObjectStore[ObjectStore_br+1]=M1;  // object name
      ObjectStore[ObjectStore_br]=CLASS_SYSTEM_TIMER;
      if ((ObjectStore_br+=4)>=OBJ_STORE && correct_OBJ_ST() )
        goto FULL2;
      return(1);
     case 142:        // Kill Timer
      CHECK_TYPE(1,CLASS_SYSTEM_TIMER)
      if (Buda1[Arguments]!=TT_OBJ)
        i=pMainWindow->KillTimer( ObjectStore[Buda2[Arguments+1]+2]);
      else
        i=((CWnd*)ObjectStore[Buda2[Arguments]+2])->KillTimer(ObjectStore[Buda2[Arguments+1]+2]);
      if (i==0)
        return(0);
      return(1);
     case 144:        // add_text
      {
        CRichEditCtrl *Temp;
  
        if (Buda1[Arguments]!=TT_OBJ)
          Temp=(CRichEditCtrl*)pMainWindow;
        else
          Temp=(CRichEditCtrl*)ObjectStore[Buda2[Arguments]+2];
        Temp->GetTextLength();
        Temp->SetSel(-1,-1);
        if (Buda1[Arguments+2]==TT_OBJ)
        {
          CHECK_TYPE(2,CLASS_SYSTEM_FONTMASK)
          Temp->SetSelectionCharFormat(*(CHARFORMAT*)(ObjectStore+Buda2[Arguments+2]+2));
        }
        {
        char* pText = (LPSTR)(StringStore+Buda2[Arguments+1]);
        EDITSTREAM es;
        es.dwCookie = (DWORD)&pText;
        es.pfnCallback = StreamInCallbackEd; 
        Temp->StreamIn((CP_UTF8 << 16) | SF_USECODEPAGE | SF_TEXT | SFF_SELECTION, es);
        }
      }
      return(1);
     case 33:        // Get Window Text (get_text) // from X get text
      Buda1[Return]=TT_STR;
      if (Buda1[Arguments]==TT_LINK)
        pMainWindow->GetWindowText(string3, L_BUFER);
      else if (SUBTYPE(ObjectStore[Buda2[Arguments]],C_S_WIN_Edit))
      {
        Buda2[Return]=sv_StStore;
        {
          CRichEditCtrl *Temp=(CRichEditCtrl*)ObjectStore[Buda2[Arguments]+2];
          EDITSTREAM es;
          es.pfnCallback = MyStreamOutCallback; 
          Temp->StreamOut((CP_UTF8 << 16) | SF_USECODEPAGE | SF_TEXT, es);
        }
        if (Buda2[Return]==sv_StStore)
          Buda2[Return]=0;
        else
          StringStore[sv_StStore++]=0;
        return(1);
      }
      else
      {
        CHECK_TYPE(0,C_S_WIN)
        ((CWnd*)ObjectStore[Buda2[Arguments]+2])->GetWindowText(string3, L_BUFER);
      }
      i=ChangeCharset(M64_ch, ch_set, (BYTE *)string3, StringStore+sv_StStore, &k, default_char);
      if (i)
      {
        Buda2[Return]=sv_StStore;
        if ((sv_StStore+=i+1)>=STRING_STORE && correct_STR_ST() )
          goto FULL;
      }
      else
        Buda2[Return]=0;
      return(1);
     case 32:        // Set Window Name (set_text) // to Y set text X
      if (Buda1[Arguments+1]==TT_LINK)
        pMainWindow->SetWindowText(make_long(StringStore+Buda2[Arguments]));
      else if (SUBTYPE(ObjectStore[Buda2[Arguments+1]],C_S_WIN_Edit))
      {
        ChangeCharset(ch_set, 0, StringStore+Buda2[Arguments], (BYTE *)string2, &k, default_char);
        CRichEditCtrl *Temp=(CRichEditCtrl*)ObjectStore[Buda2[Arguments+1]+2];
        char* pText = string2;
        EDITSTREAM es;
        es.dwCookie = (DWORD)&pText;
        es.pfnCallback = StreamInCallbackEd; 
        Temp->StreamIn((CP_UTF8 << 16) | SF_USECODEPAGE | SF_TEXT, es);
      }
      else
      {
        CHECK_TYPE(1,C_S_WIN)
        ((CWnd*)ObjectStore[Buda2[Arguments+1]+2])->SetWindowText(make_long(StringStore+Buda2[Arguments]));
      }
      return(1);
     case 165:        // set_selection
     case 166:        // get_selection
     case 167:        // get_selected_text
     case 168:        // change_selected_text
     case 169:        // format_selected_text
     case 204:        // position_to_line_number
      {
        CRichEditCtrl *Temp;
  
        if (Buda1[Arguments]!=TT_OBJ)
          Temp=(CRichEditCtrl*)pMainWindow;
        else
        {
          CHECK_TYPE(0,C_S_WIN_Edit)
          Temp=(CRichEditCtrl*)ObjectStore[Buda2[Arguments]+2];
        }
        switch(p_line)
        {
         case 165:        // set_selection
          if (Buda1[Arguments+1]==TT_INT)
            i=Buda2[Arguments+1];
          else if (Buda1[Arguments+1]==Definition[DF_END])
            i=-1;
          else
            return(0);
          if (Buda1[Arguments+2]==TT_INT)
            j=Buda2[Arguments+2];
          else if (Buda1[Arguments+2]==Definition[DF_END])
            j=-1;
          else
            return(0);
          Temp->SetSel(i,j);
          return(1);
         case 166:        // get_selection
          Temp->GetSel((long &)i,(long &)j);
          Buda1[Buda2[Arguments+1]]=Buda1[Buda2[Arguments+2]]=TT_INT;
          Buda2[Buda2[Arguments+1]]=i;
          Buda2[Buda2[Arguments+2]]=j;
          WILL_CLEAN(Buda2[Arguments+1]);
          WILL_CLEAN(Buda2[Arguments+2]);
          return(1);
         case 167:        // get_selected_text
          Buda1[Return]=TT_STR;
          Buda2[Return]=sv_StStore;
          {
            EDITSTREAM es;
            es.pfnCallback = MyStreamOutCallback; 
            Temp->StreamOut((CP_UTF8 << 16) | SF_USECODEPAGE | SF_TEXT | SFF_SELECTION, es);
          }
          if (Buda2[Return]==sv_StStore)
            Buda2[Return]=0;
          else
            StringStore[sv_StStore++]=0;
          return(1);
         case 168:        // change_selected_text
          {
          ChangeCharset(ch_set, 0, StringStore+Buda2[Arguments+1], (BYTE *)string2, &k, default_char);
          char* pText = string2;
          EDITSTREAM es;
          es.dwCookie = (DWORD)&pText;
          es.pfnCallback = StreamInCallbackEd; 
          Temp->StreamIn((CP_UTF8 << 16) | SF_USECODEPAGE | SF_TEXT | SFF_SELECTION, es);
          }
          return(1);
         case 169:        // format_selected_text
          CHECK_TYPE(1,CLASS_SYSTEM_FONTMASK)
          Temp->SetSelectionCharFormat(*(CHARFORMAT*)(ObjectStore+Buda2[Arguments+1]+2));
          return(1);
         case 204:        // position_to_line_number
          if (Buda1[Arguments+2]==TT_INT && Buda1[Arguments+3]==TT_INT)
          {
            if (Buda1[Arguments+1]==TT_INT)
            {
              if (Buda2[Arguments+2]!=(DWORD)(Temp->LineFromChar(Buda2[Arguments+1]))
                || Buda2[Arguments+3]!=Buda2[Arguments+1]-Temp->LineIndex(Buda2[Arguments+2]))
                return(0);
            }
            else
            {
              Buda1[Buda2[Arguments+1]]=TT_INT;
              if ((i=Temp->LineIndex(Buda2[Arguments+2]))==M1)
                return(0);
              if ((j=Temp->LineIndex(Buda2[Arguments+2]+1))==M1)
                j=Temp->GetTextLength()+1;
              Buda2[Buda2[Arguments+1]]=(i+Buda2[Arguments+3]<j)?i+Buda2[Arguments+3]:j-1;
              WILL_CLEAN(Buda2[Arguments+1]);
            }
          }
          else if (Buda1[Arguments+2]==TT_LINK && Buda1[Arguments+3]==TT_LINK)
          {
            if (Buda1[Arguments+1]==TT_INT)
            {
              Buda1[Buda2[Arguments+2]]=Buda1[Buda2[Arguments+3]]=TT_INT;
              Buda2[Buda2[Arguments+2]]=Temp->LineFromChar(Buda2[Arguments+1]);
              if ((i=Temp->GetTextLength())<Buda2[Arguments+1])
                Buda2[Buda2[Arguments+3]]=i-Temp->LineIndex(Buda2[Buda2[Arguments+2]]);
              else
                Buda2[Buda2[Arguments+3]]=Buda2[Arguments+1]-Temp->LineIndex(Buda2[Buda2[Arguments+2]]);
              WILL_CLEAN(Buda2[Arguments+2]);
              WILL_CLEAN(Buda2[Arguments+3]);
            }
            else
            {
              MitiText("Runtime Error:\r\n", &cf_red);
              MitiText("The Position and Line arguments of position_to_line_number\r\ncannot be both variables.\r\n");
              return(0);
            }
          }
          else
          {
            MitiText("Runtime Error:\r\n", &cf_red);
            MitiText("The Line and Column arguments of position_to_line_number\r\nhave to be both integers or both variables.\r\n");
            return(0);
          }
          return(1);
        }
      }
     case 191:        // cut_in_edit
      if (Buda1[Arguments]!=TT_OBJ)
        ((CRichEditCtrl*)pMainWindow)->Cut();
      else
        ((CRichEditCtrl*)ObjectStore[Buda2[Arguments]+2])->Cut();
      return(1);
     case 192:        // copy_in_edit
      if (Buda1[Arguments]!=TT_OBJ)
        ((CRichEditCtrl*)pMainWindow)->Copy();
      else
        ((CRichEditCtrl*)ObjectStore[Buda2[Arguments]+2])->Copy();
      return(1);
     case 193:        // paste_in_edit
      if (Buda1[Arguments]!=TT_OBJ)
        ((CRichEditCtrl*)pMainWindow)->PasteSpecial(CF_TEXT);
      else
        ((CRichEditCtrl*)ObjectStore[Buda2[Arguments]+2])->PasteSpecial(CF_TEXT);
      return(1);
     case 226:        // insert_tree_item
      {
      CTreeCtrl *Temp;
      HTREEITEM Parent, InsertAfter;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CTreeCtrl*)pMainWindow;
      else
        Temp=(CTreeCtrl*)ObjectStore[Buda2[Arguments]+2];
      i=TVIF_TEXT | TVIF_PARAM;
      if (Buda1[Arguments+5]==TT_INT)
        i|=TVIF_IMAGE;
      if (Buda1[Arguments+6]==TT_INT)
        i|=TVIF_SELECTEDIMAGE;
      Parent=(Buda1[Arguments+2]==TT_INT)?(HTREEITEM)Buda2[Arguments+2]:TVI_ROOT;
      if (Buda1[Arguments+3]==TT_INT)
        InsertAfter=(HTREEITEM)Buda2[Arguments+3];
      else if (Buda1[Arguments+3]==Definition[DF_FIRST])
        InsertAfter=TVI_FIRST;
      else if (Buda1[Arguments+3]==Definition[DF_LAST])
        InsertAfter=TVI_LAST;
      else
        InsertAfter=TVI_SORT;
      j=(DWORD)Temp->InsertItem(
         i, make_long(StringStore+Buda2[Arguments+4]), Buda2[Arguments+5], Buda2[Arguments+6], 
            0,0,Buda2[Arguments+4], Parent, InsertAfter);
      if (j==0)
        return(0);
      Buda1[Buda2[Arguments+1]]=TT_INT;
      Buda2[Buda2[Arguments+1]]=j;
      WILL_CLEAN(Buda2[Arguments+1]);
      }
      return(1);
     case 227:        // set_tree_icons
      {
        HICON hIcon;
        CImageList *pImgList=new CImageList;

        pImgList->Create(16,16,ILC_COLOR4 | ILC_MASK,3,0);
        for(i=0;i<3;i++)
        {
          hIcon=(HICON)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments+i+1]), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
          pImgList->Add(hIcon);
        }
        if (Buda1[Arguments]!=TT_OBJ)
          ((CTreeCtrl*)pMainWindow)->SetImageList(pImgList, TVSIL_NORMAL);
        else
          ((CTreeCtrl*)ObjectStore[Buda2[Arguments]+2])->SetImageList(pImgList, TVSIL_NORMAL);
      }
      return(1);
     case 228:        // get_tree_length
      if (Buda1[Arguments]!=TT_OBJ)
        i=((CTreeCtrl*)pMainWindow)->GetCount();
      else
        i=((CTreeCtrl*)ObjectStore[Buda2[Arguments]+2])->GetCount();
      Buda1[Return]=TT_INT;
      Buda2[Return]=i;
      return(1);
     case 231:        // get_tree_item
      {
      CTreeCtrl *Temp;
      TV_ITEM Item;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CTreeCtrl*)pMainWindow;
      else
        Temp=(CTreeCtrl*)ObjectStore[Buda2[Arguments]+2];
      Item.mask=TVIF_HANDLE | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
      Item.hItem=(HTREEITEM)Buda2[Arguments+1];
      if (!(Temp->GetItem(&Item)))
        return(0);
      Buda1[Buda2[Arguments+2]]=TT_STR;
      Buda2[Buda2[Arguments+2]]=Item.lParam;
      WILL_CLEAN(Buda2[Arguments+2]);
      Buda1[Buda2[Arguments+3]]=TT_INT;
      Buda2[Buda2[Arguments+3]]=Item.iImage;
      WILL_CLEAN(Buda2[Arguments+3]);
      Buda1[Buda2[Arguments+4]]=TT_INT;
      Buda2[Buda2[Arguments+4]]=Item.iSelectedImage;
      WILL_CLEAN(Buda2[Arguments+4]);
      return(1);
      }
     case 232:        // set_tree_item
      {
      CTreeCtrl *Temp;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CTreeCtrl*)pMainWindow;
      else
        Temp=(CTreeCtrl*)ObjectStore[Buda2[Arguments]+2];
      i=0;
      if (Buda1[Arguments+2]==TT_STR)
        i|=TVIF_TEXT | TVIF_PARAM;
      if (Buda1[Arguments+3]==TT_INT)
        i|=TVIF_IMAGE;
      if (Buda1[Arguments+4]==TT_INT)
        i|=TVIF_SELECTEDIMAGE;
      if (Temp->SetItem( (HTREEITEM)Buda2[Arguments+1], i,
          make_long(StringStore+Buda2[Arguments+2]), Buda2[Arguments+3], Buda2[Arguments+4], 
            0,0,Buda2[Arguments+2]))
        return(1);
      return(0);
      }
     case 233:        // get_tree_selected
      if (Buda1[Arguments]!=TT_OBJ)
        Buda2[Return]=(DWORD)((CTreeCtrl*)pMainWindow)->GetSelectedItem();
      else
        Buda2[Return]=(DWORD)((CTreeCtrl*)ObjectStore[Buda2[Arguments]+2])->GetSelectedItem();
      if (Buda2[Return]==0)
        return(0);
      Buda1[Return]=TT_INT;
      return(1);
     case 234:        // delete_tree_item
      if (Buda1[Arguments]!=TT_OBJ)
        ((CTreeCtrl*)pMainWindow)->DeleteItem((HTREEITEM)Buda2[Arguments+1]);
      else
        ((CTreeCtrl*)ObjectStore[Buda2[Arguments]+2])->DeleteItem((HTREEITEM)Buda2[Arguments+1]);
      return(1);
     case 235:        // clean_the_tree
      if (Buda1[Arguments]!=TT_OBJ)
        ((CTreeCtrl*)pMainWindow)->DeleteAllItems();
      else
        ((CTreeCtrl*)ObjectStore[Buda2[Arguments]+2])->DeleteAllItems();
      return(1);
     case 236:        // tree_parent
      {
      CTreeCtrl *Temp;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CTreeCtrl*)pMainWindow;
      else
        Temp=(CTreeCtrl*)ObjectStore[Buda2[Arguments]+2];
      Buda2[Return]=(DWORD)Temp->GetParentItem((HTREEITEM)Buda2[Arguments+1]);
      if (Buda2[Return]==0)
        Buda1[Return]=Definition[DF_ROOT];
      else
        Buda1[Return]=TT_INT;
      }
      return(1);
     case 237:        // tree_child
      {
      CTreeCtrl *Temp;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CTreeCtrl*)pMainWindow;
      else
        Temp=(CTreeCtrl*)ObjectStore[Buda2[Arguments]+2];
      if (Buda1[Arguments+1]==TT_INT)
        Buda2[Return]=(DWORD)Temp->GetChildItem((HTREEITEM)Buda2[Arguments+1]);
      else
        Buda2[Return]=(DWORD)Temp->GetRootItem();
      if (Buda2[Return]==0)
        return(0);
      Buda1[Return]=TT_INT;
      }
      return(1);
     case 238:        // tree_next_brother
      {
      CTreeCtrl *Temp;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CTreeCtrl*)pMainWindow;
      else
        Temp=(CTreeCtrl*)ObjectStore[Buda2[Arguments]+2];
      Buda2[Return]=(DWORD)Temp->GetNextSiblingItem((HTREEITEM)Buda2[Arguments+1]);
      if (Buda2[Return]==0)
        return(0);
      Buda1[Return]=TT_INT;
      }
      return(1);
     case 145:        // insert_list_item
      {
      CListCtrl *Temp;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CListCtrl*)pMainWindow;
      else
        Temp=(CListCtrl*)ObjectStore[Buda2[Arguments]+2];
      i=(Buda1[Arguments+1]!=TT_INT)?Temp->GetItemCount():Buda2[Arguments+1]; //Definition[DF_END]
      if (Buda1[Arguments+3]==TT_INT)
        Temp->InsertItem( i, make_long(StringStore+Buda2[Arguments+2]), Buda2[Arguments+3]);
      else
        Temp->InsertItem( i, make_long(StringStore+Buda2[Arguments+2]));
      Temp->SetItemData( i, Buda2[Arguments+2]);
      }
      return(1);
     case 146:        // get_list_text
      if (Buda1[Arguments]!=TT_OBJ)
        i=((CListCtrl*)pMainWindow)->GetItemData(Buda2[Arguments+1]);
      else
        i=((CListCtrl*)ObjectStore[Buda2[Arguments]+2])->GetItemData(Buda2[Arguments+1]);
      Buda1[Return]=TT_STR;
      Buda2[Return]=i;
      return(1);
     case 224:        // get_list_length
      if (Buda1[Arguments]!=TT_OBJ)
        i=((CListCtrl*)pMainWindow)->GetItemCount();
      else
        i=((CListCtrl*)ObjectStore[Buda2[Arguments]+2])->GetItemCount();
      Buda1[Return]=TT_INT;
      Buda2[Return]=i;
      return(1);
     case 147:        // get_list_selected
      if (Buda1[Arguments]!=TT_OBJ)
        Buda2[Return]=((CListCtrl*)pMainWindow)->GetNextItem(-1, LVNI_SELECTED);
      else
        Buda2[Return]=((CListCtrl*)ObjectStore[Buda2[Arguments]+2])->GetNextItem(-1, LVNI_ALL | LVNI_SELECTED);
      if (Buda2[Return]==M1)
        return(0);
      Buda1[Return]=TT_INT;
      return(1);
     case 208:        // delete_list_item
      if (Buda1[Arguments]!=TT_OBJ)
        ((CListCtrl*)pMainWindow)->DeleteItem(Buda2[Arguments+1]);
      else
        ((CListCtrl*)ObjectStore[Buda2[Arguments]+2])->DeleteItem(Buda2[Arguments+1]);
      return(1);
     case 150:        // clean_the_list
      if (Buda1[Arguments]!=TT_OBJ)
        ((CListCtrl*)pMainWindow)->DeleteAllItems();
      else
        ((CListCtrl*)ObjectStore[Buda2[Arguments]+2])->DeleteAllItems();
      return(1);
     case 210:        // set_list_icons
      {
        HICON hIcon;
        CImageList *pImgList=new CImageList;

        if (Buda1[Arguments+1]==55)
        {
          pImgList->Create(16,16,ILC_COLOR4 | ILC_MASK,3,0);
          k=LVSIL_SMALL;
        }
        else
        {
          pImgList->Create(32,32,ILC_COLOR4 | ILC_MASK,3,0);
          k=LVSIL_NORMAL;
        }
        for(i=0;i<3;i++)
        {
          hIcon=(HICON)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments+i+2]), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
          pImgList->Add(hIcon);
        }
        if (Buda1[Arguments]!=TT_OBJ)
          ((CListCtrl*)pMainWindow)->SetImageList( pImgList, k);
        else
          ((CListCtrl*)ObjectStore[Buda2[Arguments]+2])->SetImageList( pImgList, k);
      }
      return(1);
     case 211:        // add_list_column
      {
      CListCtrl *Temp;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CListCtrl*)pMainWindow;
      else
        Temp=(CListCtrl*)ObjectStore[Buda2[Arguments]+2];
      i=(Buda1[Arguments+1]!=TT_INT)?Temp->GetItemCount():Buda2[Arguments+1]; //Definition[DF_END]
      
      Temp->InsertColumn( i, make_long(StringStore+Buda2[Arguments+2]), LVCFMT_LEFT, Buda2[Arguments+3], -1 );
      }
      return(1);
     case 271:        // set_list_label
      {
      CListCtrl *Temp;

      if (Buda1[Arguments]!=TT_OBJ)
        Temp=(CListCtrl*)pMainWindow;
      else
        Temp=(CListCtrl*)ObjectStore[Buda2[Arguments]+2];
      Temp->SetItemText( Buda2[Arguments+1], Buda2[Arguments+2], make_long(StringStore+Buda2[Arguments+3]) );
      if (Buda2[Arguments+2]==0) // main
        Temp->SetItemData( Buda2[Arguments+1], Buda2[Arguments+3]);
      }
      return(1);
     case 209:        // change_style
      if (Buda1[Arguments]!=TT_OBJ)
      {
        i=GetWindowLong(((CWnd*)pMainWindow)->m_hWnd, GWL_STYLE);
        SetWindowLong(((CWnd*)pMainWindow)->m_hWnd, GWL_STYLE,
          ((i^Buda2[Arguments+1])&(Buda2[Arguments+2]^M1))|Buda2[Arguments+3]);
      }
      else
      {
        i=GetWindowLong(((CWnd*)ObjectStore[Buda2[Arguments]+2])->m_hWnd, GWL_STYLE);
        SetWindowLong(((CWnd*)ObjectStore[Buda2[Arguments]+2])->m_hWnd, GWL_STYLE,
          ((i^Buda2[Arguments+1])&(Buda2[Arguments+2]^M1))|Buda2[Arguments+3]);
      }
      return(1);
     case 152:        // modify_menu
     {
      HMENU hTempMenu;
      MENUITEMINFO MenuItemInfo;
      
      if (Buda1[Arguments]==TT_OBJ)
      {
        if (SUBTYPE(ObjectStore[Buda2[Arguments]],CLASS_SYSTEM_MENU))
          hTempMenu=(HMENU)ObjectStore[Buda2[Arguments]+2];
        else if (SUBTYPE(ObjectStore[Buda2[Arguments]],C_S_WIN_Main))
          hTempMenu=((C_FrameWnd *)ObjectStore[Buda2[Arguments]+2])->GetMenu()->m_hMenu;
        else
        {
          error_func3(Arguments,p_line,0,CLASS_SYSTEM_MENU,C_S_WIN_Main);
          return(0);
        }
      }
      else
        hTempMenu=MainMenu;
      if (hTempMenu==NULL)
        return(0);
      i=MF_BYPOSITION;
      MenuItemInfo.cbSize=sizeof(MENUITEMINFO); // ?
      MenuItemInfo.fMask=0;
      if (Buda1[Arguments+3]==TT_STR)
      {
        MenuItemInfo.fMask|=MIIM_TYPE;
        MenuItemInfo.fType=MFT_STRING;
        MenuItemInfo.dwTypeData=make_long(StringStore+Buda2[Arguments+3]);
        MenuItemInfo.cch=my_strlen(make_long(StringStore+Buda2[Arguments+3]));
      }
      if (Buda1[Arguments+2]!=TT_LINK)
      {
        if (Buda1[Arguments+2]==Definition[DF_RIGHT])   // rightjustify
          MenuItemInfo.fType|=MFT_RIGHTJUSTIFY;
        else
        {
          MenuItemInfo.fMask|=MIIM_STATE;
          if (Buda1[Arguments+2]==Definition[DF_NORMAL])       // normal
            MenuItemInfo.fState=MFS_ENABLED; 
          else if (Buda1[Arguments+2]==Definition[DF_CHECKED]) // checked
            MenuItemInfo.fState=MFS_ENABLED | MF_CHECKED; 
          else if (Buda1[Arguments+2]==Definition[DF_GRAYED])  // grayed
            MenuItemInfo.fState=MF_GRAYED;
          else   
            return(0);
        }
      }
      SetMenuItemInfo( hTempMenu, Buda2[Arguments+1]-1, TRUE, &MenuItemInfo);
      return(1);
     }
     case 190:        // draw_menu_bar
      if (Buda1[Arguments]==TT_OBJ)
      {
        CHECK_TYPE(0,C_S_WIN_Main)
        DrawMenuBar( ((CWnd*)ObjectStore[Buda2[Arguments]+2])->m_hWnd);
      }
      else
        DrawMenuBar( ((pMainWindow==NULL)?pMain_Frame:pMainWindow)->m_hWnd);
      return(1);
     case 177:        // first_child
      {
      CWnd *pWindow;
      Buda1[Return]=TT_OBJ;
      if (Buda1[Arguments]==TT_OBJ)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2])->GetWindow(GW_CHILD);
      else
        pWindow=((pMainWindow==NULL)?pMain_Frame:pMainWindow)->GetWindow(GW_CHILD);
      if (pWindow==NULL)
      {
        Buda2[Return]=0;
        return(1);
      }
      if (pWindow->IsKindOf(RUNTIME_CLASS(C_FrameWnd)))
        Buda2[Return]=(DWORD)((C_FrameWnd*)pWindow)->m_Number;
      else
        Buda2[Return]=(DWORD)pWindow->GetDlgCtrlID();
      return(1);
      }//for def
     case 178:        // last_child
      {
      CWnd *pWindow;
      Buda1[Return]=TT_OBJ;
      if (Buda1[Arguments]==TT_OBJ)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2])->GetWindow(GW_CHILD)->GetWindow(GW_HWNDLAST);
      else
        pWindow=((pMainWindow==NULL)?pMain_Frame:pMainWindow)->GetWindow(GW_CHILD)->GetWindow(GW_HWNDLAST);
      if (pWindow==NULL)
      {
        Buda2[Return]=0;
        return(1);
      }
      if (pWindow->IsKindOf(RUNTIME_CLASS(C_FrameWnd)))
        Buda2[Return]=(DWORD)((C_FrameWnd*)pWindow)->m_Number;
      else
        Buda2[Return]=(DWORD)pWindow->GetDlgCtrlID();
      return(1);
      }//for def
     case 179:        // next_child
      {
      CWnd *pWindow;
      Buda1[Return]=TT_OBJ;
      if (Buda1[Arguments]==TT_OBJ)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2])->GetWindow(GW_HWNDNEXT);
      else
        pWindow=((pMainWindow==NULL)?pMain_Frame:pMainWindow)->GetWindow(GW_HWNDNEXT);
      if (pWindow==NULL)
      {
        Buda2[Return]=0;
        return(1);
      }
      if (pWindow->IsKindOf(RUNTIME_CLASS(C_FrameWnd)))
        Buda2[Return]=(DWORD)((C_FrameWnd*)pWindow)->m_Number;
      else
        Buda2[Return]=(DWORD)pWindow->GetDlgCtrlID();
      return(1);
      }//for def
     case 180:        // previous_child
      {
      CWnd *pWindow;
      Buda1[Return]=TT_OBJ;
      if (Buda1[Arguments]==TT_OBJ)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2])->GetWindow(GW_HWNDPREV);
      else
        pWindow=((pMainWindow==NULL)?pMain_Frame:pMainWindow)->GetWindow(GW_HWNDPREV);
      if (pWindow==NULL)
      {
        Buda2[Return]=0;
        return(1);
      }
      if (pWindow->IsKindOf(RUNTIME_CLASS(C_FrameWnd)))
        Buda2[Return]=(DWORD)((C_FrameWnd*)pWindow)->m_Number;
      else
        Buda2[Return]=(DWORD)pWindow->GetDlgCtrlID();
      return(1);
      }//for def
     case 181:        // active_child
      {
      CWnd *pWindow;
      Buda1[Return]=TT_OBJ;
      if (Buda1[Arguments]==TT_OBJ)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2])->GetFocus();
      else
        pWindow=((pMainWindow==NULL)?pMain_Frame:pMainWindow)->GetFocus();
      if (pWindow==NULL)
      {
        Buda2[Return]=0;
        return(1);
      }
      if (pWindow->IsKindOf(RUNTIME_CLASS(C_FrameWnd)))
        Buda2[Return]=(DWORD)((C_FrameWnd*)pWindow)->m_Number;
      else
        Buda2[Return]=(DWORD)pWindow->GetDlgCtrlID();
      return(1);
      }//for def
     case 205:        // set_focus
      if (Buda1[Arguments]==TT_OBJ)
        ((CWnd*)ObjectStore[Buda2[Arguments]+2])->SetFocus();
      else
        ((pMainWindow==NULL)?pMain_Frame:pMainWindow)->SetFocus();
      return(1);
     case 194:        // child_from_point
      {
      CWnd *pWindow;
      POINT Point;

      Buda1[Return]=TT_OBJ;
      Point.x=Buda2[Arguments+1];
      Point.y=Buda2[Arguments+2];
      if (Buda1[Arguments]==TT_OBJ)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2])->ChildWindowFromPoint(Point);
      else
        pWindow=((pMainWindow==NULL)?pMain_Frame:pMainWindow)->ChildWindowFromPoint(Point);
      if (pWindow==NULL)
      {
        Buda2[Return]=0;
        return(1);
      }
      if (pWindow->IsKindOf(RUNTIME_CLASS(C_FrameWnd)))
        Buda2[Return]=(DWORD)((C_FrameWnd*)pWindow)->m_Number;
      else
        Buda2[Return]=(DWORD)pWindow->GetDlgCtrlID();
      return(1);
      }//for def
     case 37:        // parent window
      {
      CWnd *pWindow;
      Buda1[Return]=TT_OBJ;
      if (Buda1[Arguments]==TT_OBJ)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2])->GetParent();
      else
        pWindow=((pMainWindow==NULL)?pMain_Frame:pMainWindow)->GetParent();
      if (pWindow==NULL)
      {
        Buda2[Return]=0;
        return(1);
      }
      if (pWindow->IsKindOf(RUNTIME_CLASS(C_FrameWnd)))
        Buda2[Return]=(DWORD)((C_FrameWnd*)pWindow)->m_Number;
      else
        Buda2[Return]=(DWORD)pWindow->GetDlgCtrlID();
      return(1);
      }//for def
     case 39:        // Update window
      if (Buda1[Arguments]==TT_OBJ)
      {
        if (ObjectStore[Buda2[Arguments]+2])
          ((CWnd*)ObjectStore[Buda2[Arguments]+2])->InvalidateRect(NULL, TRUE);
      }
      else if (pMain_Frame) 
        pMain_Frame->InvalidateRect(NULL, TRUE);
      return(1);
     case 396:        // Scroll window
      {
      CWnd *pWindow;
      if (Buda1[Arguments]==TT_OBJ)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2]);
      else
        pWindow=((pMainWindow==NULL)?pMain_Frame:pMainWindow);
      if (pWindow==NULL)
      {
        Buda2[Return]=0;
        return(1);
      }
      pWindow->ScrollWindow(Buda2[Arguments+1], Buda2[Arguments+2]);
      if (Buda1[Arguments+3]!=TT_INT || Buda2[Arguments+3])
        pWindow->UpdateWindow();
      return(1);
      }
     case 397:        // paint_rect
      if(G_rectPaint.IsRectEmpty())
        return(0);
      if (Buda1[Arguments]==TT_INT && Buda1[Arguments+1]==TT_INT && Buda1[Arguments+2]==TT_INT && Buda1[Arguments+3]==TT_INT)
      {
        if (G_rgnPaint.RectInRegion(&CRect((int)Buda2[Arguments], (int)Buda2[Arguments+1], (int)Buda2[Arguments+2], (int)Buda2[Arguments+3])))
          return(1);
        else
          return(0);
      }
      else if (Buda1[Arguments]==TT_LINK && Buda1[Arguments+1]==TT_LINK && Buda1[Arguments+2]==TT_LINK && Buda1[Arguments+3]==TT_LINK)
      {
        for( i=0; i<4; Buda1[Buda2[Arguments+i++]]=TT_INT);
        Buda2[Buda2[Arguments]]  =G_rectPaint.left; 
        Buda2[Buda2[Arguments+1]]=G_rectPaint.top; 
        Buda2[Buda2[Arguments+2]]=G_rectPaint.right; 
        Buda2[Buda2[Arguments+3]]=G_rectPaint.bottom; 
        WILL_CLEAN(Buda2[Arguments]);
        WILL_CLEAN(Buda2[Arguments+1]);
        WILL_CLEAN(Buda2[Arguments+2]);
        WILL_CLEAN(Buda2[Arguments+3]);
      } 
      else
      {
        MitiText("Error: All arguments of paint_rect have to be integers\r\n or all of them have to be variables.\r\n", &cf_red);
        return(0);
      }
      return(1);
     case 398:        // message_flags
      Buda1[Return]=TT_INT;
      Buda2[Return]=G_FlagsMes;
      return(1);
     case 399:        // message_flags
      j=Buda1[Arguments];
      if (j==Definition[DF_LEFT])
        i=G_FlagsMes&1; // MK_LBUTTON
      else if (j==Definition[DF_RIGHT])
        i=G_FlagsMes&2; // MK_RBUTTON
      else if (j==Definition[DF_SHIFT])
        i=G_FlagsMes&4; // MK_SHIFT
      else if (j==Definition[DF_CTRL])
        i=G_FlagsMes&8; // MK_CONTROL
      else if (j==Definition[DF_MIDDLE])
        i=G_FlagsMes&0x10; // MK_MBUTTON
      else if (j==Definition[DF_ALT])
        i=G_FlagsMes&0x2000; // Alt  // not working
      else if (j==Definition[DF_FUNCTION])
        i=G_FlagsMes&0x100; // function key 
      else if (j==Definition[DF_BEFORE])
        i=G_FlagsMes&0x4000; // Previous key state 
      else if (j==Definition[DF_STATE])
        i= ~(G_FlagsMes&0x8000); // Transition state
      else
      {
        MitiText("Error: You specified a wrong flag in \"message_flags\" predicate.\r\n", &cf_red);
        return(0);
      } 
      if (i)
        return(1);
      else
        return(0);
     case 40:        // Press button
      {
        POINT Point;
        CWnd*  pWindowMain;
        CWnd*  pWindow;

        if (Buda1[Arguments]==TT_OBJ)
        {
          if (ObjectStore[Buda2[Arguments]+2])
            pWindowMain=((CWnd*)ObjectStore[Buda2[Arguments]+2]);
          else
            return 0;
        }
        else if (pMain_Frame)
          pWindowMain=pMain_Frame;
        else
          return 0;
        Point.x=Buda2[Arguments+1];
        Point.y=Buda2[Arguments+2];
        pWindow=pWindowMain->ChildWindowFromPoint(Point);
        if (pWindow)
        {
          if (pWindow->IsKindOf(RUNTIME_CLASS(CButton)))
          {
            //status_fl|=4; // maybe we do not need this
            pWindowMain->SendMessage(WM_COMMAND,
                               (WPARAM)pWindow->GetDlgCtrlID(), (LPARAM)pWindow->m_hWnd);
            //status_fl&=M1^4;
          }
        }
        return(1);
      }
     case 195:        // get_clipboard_data
      {
      DWORD ch_set2=Buda2[Arguments];
      k=0;
      
      if (ch_set2>CHAR_SETS)
      {
        MitiText("Error: No such charset.\r\n", &cf_red);
        return(0);
      }
      if (ch_set2==0)
        ch_set2=(ch_set?ch_set:2);
      if (OpenClipboard(NULL)==0)
      {
        // handle the error
E8:     MitiText("Runtime Error: Cannot read from the clipboard.\r\n", &cf_red);
E12:    CloseClipboard(); 
E13:    DWORD theerr = GetLastError();
        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL,theerr,0,string3,L_BUFER,NULL);
        MitiText(make_utf8(string3));
        return(0);
      }
      MY_HANDLE hTemp=GetClipboardData(CF_UNICODETEXT);
      j=sv_StStore;
      if (hTemp!=NULL)
      {
        BYTE *Str=(BYTE *)GlobalLock(hTemp);
        DWORD str_len=wcslen((wchar_t *)Str);
        if (ch_set==0)
          str_len=6*str_len;
        if ((sv_StStore+=str_len)>=STRING_STORE && correct_STR_ST() )
          goto FULL;
        i=ChangeCharset(64, ch_set, Str, StringStore+j, &k, default_char, str_len+1); // +1?
        sv_StStore=j+i+1;
        GlobalUnlock(hTemp);
      }
      if (hTemp==NULL || k>0)
      {
        hTemp=GetClipboardData(CF_TEXT);
        if (hTemp!=NULL)
        {
          BYTE *Str=(BYTE *)GlobalLock(hTemp);
          DWORD str_len=strlen((LPSTR)Str);
          if (ch_set==0)
            str_len=3*str_len;
          if ((sv_StStore+=str_len)>=STRING_STORE && correct_STR_ST() )
            goto FULL;
          i=ChangeCharset(ch_set2, ch_set, Str, StringStore+j, &k, default_char, str_len+1);
          sv_StStore=j+i+1;
          GlobalUnlock(hTemp);
        }
        else if (k==0)
        {
          sv_StStore=j;
          goto E8;
        }
      }
      CloseClipboard();
      Buda1[Return]=TT_STR;
      if (i)
      {
        Buda2[Return]=j;
        sv_StStore=j+i+1;
      }
      else
      {
        sv_StStore=j;
        Buda2[Return]=0;
      }
      return(1);
      }//for def
     case 196:        // set_clipboard_data
      {
      DWORD ch_set2=Buda2[Arguments+1];
      DWORD str_len=strlen((LPSTR)(StringStore+Buda2[Arguments]));
      
      if (ch_set2>CHAR_SETS)
      {
        MitiText("Error: No such charset.\r\n", &cf_red);
        return(0);
      }
      if (ch_set2==0)
        ch_set2=(ch_set?ch_set:2);
      if (OpenClipboard(NULL)==0 || EmptyClipboard()==0)
      {
        // handle the error
E9:     MitiText("Runtime Error: Cannot write in the clipboard.\r\n", &cf_red);
        goto E12;
      }
      MY_HANDLE hTemp=GlobalAlloc(GMEM_MOVEABLE, 2*str_len+2);
      ChangeCharset(ch_set, 64, StringStore+Buda2[Arguments], (BYTE *)GlobalLock(hTemp), &k, default_char, 2*str_len);
      GlobalUnlock(hTemp);
      if (SetClipboardData(CF_UNICODETEXT, hTemp)==NULL)
        goto E9;
      MY_HANDLE hTemp2=GlobalAlloc(GMEM_MOVEABLE, str_len+1);
      ChangeCharset(ch_set, ch_set2, StringStore+Buda2[Arguments], (BYTE *)GlobalLock(hTemp2), &k, default_char, str_len);
      GlobalUnlock(hTemp2);
      if (SetClipboardData(CF_TEXT, hTemp2)==NULL)
        goto E9;
      CloseClipboard();
      GlobalFree(hTemp);
      GlobalFree(hTemp2);
      return(1);
      }//for def
     case 41:        // Select file
      {
        OPENFILENAME of;

        memset(&of, '\0', sizeof(OPENFILENAME));
        of.lStructSize  = sizeof(OPENFILENAME);
        CWnd* pWinTemp=(pMain_Frame)?(CWnd*)pMain_Frame:(CWnd*)pMainFrame;
        of.hwndOwner    = pWinTemp->m_hWnd;       // NULL
#ifdef UNICODE
        _TCHAR string4[1024];
        _TCHAR string5[512];
        if (Buda1[Arguments+2]==TT_STR)
        {
          ChangeCharset(ch_set, 64, StringStore+Buda2[Arguments+2], (BYTE *)string3, &k, default_char);
          for(i=p=0, n=my_strlen(string3); i<n; i++)
            if (string3[i]=='0' && i && string3[i-1]=='\\')
              string4[p-1]=0;
            else
              string4[p++]=string3[i];
          string4[p]=string4[p+1]=0;
          of.lpstrFilter  =string4;
#else
        if (Buda1[Arguments+2]==TT_STR)
        {
          strcpy(string2, (LPSTR)(StringStore+Buda2[Arguments+2]));
          for(i=p=0, n=strlen((LPSTR)string2); i<n; i++)
            if (string2[i]=='0' && i && string2[i-1]=='\\')
              string2[p-1]=0;
            else
              string2[p++]=string2[i];
          string2[p]=string2[p+1]=0;
          of.lpstrFilter  =string2;
#endif
        }
        else
          of.lpstrFilter  = _T("All Files (*.*)\0*.*\0");
        of.lpstrCustomFilter = NULL;
        of.nFilterIndex = 1;
        of.nMaxFile     = L_BUFER;
        of.lpstrInitialDir = NULL;
        if (Buda1[Arguments+1]==TT_STR)
        {
#ifdef UNICODE
          ChangeCharset(ch_set, 64, StringStore+Buda2[Arguments+1], (BYTE *)string5, &k, default_char);
          of.lpstrTitle   = string5;
#else
          of.lpstrTitle   = make_long(StringStore+Buda2[Arguments+1]);
#endif
        }
        else
          of.lpstrTitle   = NULL;
        string3[0]=0;
        of.lpstrFile    = string3;
        of.Flags        = OFN_HIDEREADONLY|OFN_FILEMUSTEXIST;
        of.lpstrDefExt  = NULL;

        if (Buda1[Arguments]==51)           // o
        {
          if(!GetOpenFileName(&of))
            return(0);
        }
        else if (Buda1[Arguments]!=55 || !GetSaveFileName(&of)) // s
          return(0);
        Buda1[Return]=TT_STR;
        i=ChangeCharset(M64_ch, ch_set, (BYTE *)string3, StringStore+sv_StStore, &k, default_char);
        Buda2[Return]=sv_StStore;
        if (i)
        {
          if ((sv_StStore+=i+1)>=STRING_STORE && correct_STR_ST() )
            goto FULL;
        }
        else
          Buda2[Return]=0;
        return(1);  
      }
     case 53:        // Cursor
     {
     LPTSTR i;
     
      switch (Buda1[Arguments])
      {
       case 65:  // ? Standard arrow and small hourglass 
        i=IDC_APPSTARTING;
        break;
       case 39:  // c Crosshair
        i=IDC_CROSS;
        break;
       case 44:  // h Hand
        i=IDC_HAND;
        break;
       case 56:  // t Text I-beam
        i=IDC_IBEAM;
        break;
       case 51:  // o Slashed circle
        i=IDC_NO;
        break;
       case 60:  // x Four-pointed arrow
        i=IDC_SIZEALL;
        break;
       case 50:  // n Double-pointed arrow pointing northeast and southwest
        i=IDC_SIZENESW;
        break;
       case 40:  // d Double-pointed arrow pointing north and south
        i=IDC_SIZENS;
        break;
       case 57:  // u Double-pointed arrow pointing northwest and southeast
        i=IDC_SIZENWSE;
        break;
       case 80:  // ! Double-pointed arrow pointing west and east
        i=IDC_SIZEWE;
        break;
       case 58:  // v Vertical arrow
        i=IDC_UPARROW;
        break;
       case 59:  // w Hourglass
        i=IDC_WAIT;
        break;
       default:
        i=IDC_ARROW; // Standard arrow
      }
      SetCursor(LoadCursor(NULL, i));
      return(1);
     }
     case 60:        // system_color
      if (Buda1[Arguments]==Definition[DF_WINDOW])  // window
        Buda2[Return]=GetSysColor(COLOR_WINDOW);
      else if (Buda1[Arguments]==Definition[DF_MENU])  // menu
        Buda2[Return]=GetSysColor(COLOR_MENU);
      else if (Buda1[Arguments]==Definition[DF_DIALOG])  // dialog
        Buda2[Return]=GetSysColor(COLOR_3DFACE);
      else
        return(0);
      Buda1[Return]=TT_INT;
      return(1);
	   case 386:         // embed_server
      NOT_FOR_LIGHT
   //case 174:         // bitmap_button
     case 138:         // check box
     case 173:         // radio button
     case 175:         // group_box
   //case 176:         // tool_tip
     case 143:         // List Box
     case 225:         // Tree Box
     case 242:         // window
     case 243:         // dialog
     case 244:         // button
     case 245:         // static
     case 246:         // edit
     case 247:         // bitmap
     case 248:         // icon
     case 249:         // animate
     case 250:         // menu
     {
      CWnd* OldWindow;
      HMENU OldMenu;
      DWORD flag;

      if (Buda1[Arguments+2]>=MEMORY_c256
                               || (Buda1[Arguments+2]<TT_START && Buda1[Arguments+2]>TT_LINK))
      {
        MitiText("Runtime Error: The name of message function is bad.\r\n", &cf_red);        
        return(0);
      }
      OldMenu=MainMenu;
      if (Buda1[Arguments+1]==TT_OBJ)
        pMainWindow=(CWnd*)ObjectStore[Buda2[Arguments+1]+2];
      t=(Buda1[Arguments+4]==TT_INT)?Buda2[Arguments+4]:30;
      m=(Buda1[Arguments+5]==TT_INT)?Buda2[Arguments+5]:30;
      n=(Buda1[Arguments+6]==TT_INT)?Buda2[Arguments+6]:200;
      k=(Buda1[Arguments+7]==TT_INT)?Buda2[Arguments+7]:100;
      ObjectStore[ObjectStore_br+1]=M1;  // object name
      if (Buda1[Arguments+2]==TT_LINK)
        ObjectStore[ObjectStore_br+3]=Definition[DF_FALSE];
      else
        ObjectStore[ObjectStore_br+3]=Buda1[Arguments+2];// ms_function;
      ObjectStore[ObjectStore_br+4]=RGB(0, 0, 0);              // text color
      ObjectStore[ObjectStore_br+5]=GetSysColor(COLOR_WINDOW); // backgraund text color
      ObjectStore[ObjectStore_br+6]= (DWORD)((p_line==242 && Buda1[Arguments+10]==TT_INT)?
         CreateSolidBrush(Buda2[Arguments+10]):hbrGreen);      // window brush
      flag=0; // not dialog
      switch (p_line)  // window
      {
       case 242:
        {
        HICON hIcon;
        HCURSOR hCursor;
        if (Buda1[Arguments+8]==TT_STR)
          hIcon=((HICON)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments+8]), IMAGE_ICON, 0, 0, LR_LOADFROMFILE));
        else
          switch(Buda1[Arguments+8])
          {
           case 65:  // ? SystemQuestion 
            hIcon=theApp.LoadStandardIcon(IDI_QUESTION);
            break;
           case 37:  // a AplicationDefault
            hIcon=theApp.LoadStandardIcon(IDI_APPLICATION);
            break;
           case 50:  // n no icon
            hIcon=NULL;
            break;
           case 80:  // ! SystemExclamation
            hIcon=theApp.LoadStandardIcon(IDI_EXCLAMATION);
            break;
           case 45:  // i SystemAsterisk
            hIcon=theApp.LoadStandardIcon(IDI_ASTERISK);
            break;
           case 55:  // s SystemHand
            hIcon=theApp.LoadStandardIcon(IDI_HAND);
            break;
           default: // Standard Prolog Icon
            hIcon=theApp.LoadIcon(IDR_ProjectTYPE);
          }
        if (Buda1[Arguments+9]==TT_STR)
          hCursor=((HCURSOR)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments+9]), IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE));
        else
          switch(Buda1[Arguments+9])
          {
           case 65:  // ? Standard arrow and small hourglass 
            hCursor=theApp.LoadStandardCursor(IDC_APPSTARTING);
            break;
           case 39:  // c Crosshair
            hCursor=theApp.LoadStandardCursor(IDC_CROSS);
            break;
           case 44:  // h Hand
            hCursor=theApp.LoadStandardCursor(IDC_HAND);
            break;
           case 56:  // t Text I-beam
            hCursor=theApp.LoadStandardCursor(IDC_IBEAM);
            break;
           case 51:  // o Slashed circle
            hCursor=theApp.LoadStandardCursor(IDC_NO);
            break;
           case 60:  // x Four-pointed arrow
            hCursor=theApp.LoadStandardCursor(IDC_SIZEALL);
            break;
           case 50:  // n Double-pointed arrow pointing northeast and southwest
            hCursor=theApp.LoadStandardCursor(IDC_SIZENESW);
            break;
           case 40:  // d Double-pointed arrow pointing north and south
            hCursor=theApp.LoadStandardCursor(IDC_SIZENS);
            break;
           case 57:  // u Double-pointed arrow pointing northwest and southeast
            hCursor=theApp.LoadStandardCursor(IDC_SIZENWSE);
            break;
           case 80:  // ! Double-pointed arrow pointing west and east
            hCursor=theApp.LoadStandardCursor(IDC_SIZEWE);
            break;
           case 58:  // v Vertical arrow
            hCursor=theApp.LoadStandardCursor(IDC_UPARROW);
            break;
           case 59:  // w Hourglass
            hCursor=theApp.LoadStandardCursor(IDC_WAIT);
            break;
           default:
            hCursor=theApp.LoadStandardCursor(IDC_ARROW); // Standard arrow
          }
        flag=1;
        Wait++;
        pMainWindow=pMain_Frame=new C_FrameWnd;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="Program";
#if PLUG_IN
        if ()
          pMain_Frame->Attach();
        else
#endif // PLUG_IN
        pMain_Frame->m_Number=ObjectStore_br;
        pMain_Frame->m_bDialog=FALSE;
        ObjectStore[ObjectStore_br]=C_S_WIN_Main;
        ObjectStore[ObjectStore_br+2]=(long)pMain_Frame;
        
        pMain_Frame->Create( AfxRegisterWndClass( 0,   // CS_DBLCLKS
          hCursor,
          (HBRUSH)ObjectStore[ObjectStore_br+6],
          hIcon ),
          WinName, WS_OVERLAPPEDWINDOW | WS_POPUP
          | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
          rect, NULL, NULL, 0, NULL );
        }
        break;
       case 243:  // dialog
        {
        flag=2;
        pMainWindow=pMain_Frame=new C_FrameWnd;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="Dialog";
        pMain_Frame->Create( AfxRegisterWndClass( CS_DBLCLKS, theApp.LoadStandardCursor(IDC_ARROW),
          (HBRUSH)ObjectStore[ObjectStore_br+6], theApp.LoadIcon(IDI_DIALOG) ),
          WinName, WS_OVERLAPPEDWINDOW | WS_POPUP
          | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
          rect, NULL, NULL, 0, NULL );
        pMain_Frame->m_Number=ObjectStore_br;
        pMain_Frame->m_bDialog=TRUE;
        ObjectStore[ObjectStore_br]=C_S_WIN_Dialog;
        ObjectStore[ObjectStore_br+2]=(long)pMain_Frame;
        break;
        }
//Plamen test
		    case 386:  // embed_server
		    {
			    if (Buda1[Arguments+8]==TT_OBJ) 
			    {
			      CHECK_TYPE(8,CLASS_SYSTEM_ActiveX)
			      p=Buda2[Arguments+8];
            ObjectStore[p+4]=RGB(0, 0, 0);              // text color
            ObjectStore[p+5]=GetSysColor(COLOR_WINDOW); // backgraund text color
            ObjectStore[p+6]=(DWORD)hbrGreen;      // window brush
			    }
          else if (Buda1[Arguments+8]==TT_STR)
          {
            p=ObjectStore_br;
            if (open_server(Arguments+8)==0)
              return(0);
            ObjectStore[p+3]=Definition[DF_FALSE];
          }
          else
			    {
				    MitiText("no COM server.\r\n"); 
				    break;
			    }
          if (Buda1[Arguments+2]!=TT_LINK)
          {
	          if (ObjectStore[p+3]==Definition[DF_FALSE])
	            oComEvtClient.AttachEvents(p,((COleDispatchDriver*)ObjectStore[p+7])->m_lpDispatch); // attach events
            ObjectStore[p+3]=Buda1[Arguments+2];// ms_function;
          }
          if (Buda1[Arguments+9]==TT_STR)
            ObjectStore[p+8]=Buda2[Arguments+9];// Connection Point

			    COleDispatchDriver* Disp = (COleDispatchDriver*)ObjectStore[p+7]; 
			    CRect rect(t, m, t+n, m+k);
			    pMainWindow = new CWnd;

			    CAxWindow2* pAxWnd = new CAxWindow2();
			    pAxWnd->Create(pMain_Frame->m_hWnd, rect, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER, 0, p);
			    pAxWnd->AttachControl(Disp->m_lpDispatch, NULL);

			    ObjectStore[p]=C_S_WIN_Embedded;
			    if (pMainWindow->Attach(pAxWnd->m_hWnd) == 0)
			      MitiText("Failed to attach ActiveX.\r\n", &cf_red);
			    ObjectStore[p+2]=(long)pMainWindow;
		    }
		    break;
//end plam test
       case 244:  // button
        {
        pMainWindow=new CButton;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="Button";
        ((CButton*)pMainWindow)->Create( WinName, WS_CHILD | WS_VISIBLE | WS_TABSTOP,
          rect, pMain_Frame, ObjectStore_br);
        ObjectStore[ObjectStore_br]=C_S_WIN_Button;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 174:  // bitmap_button
        {
        pMainWindow=new CBitmapButton;
        CRect rect(t, m, t+n, m+k);
        ((CBitmapButton*)pMainWindow)->Create( _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP
          | BS_OWNERDRAW, rect, pMain_Frame, ObjectStore_br);
        if (Buda1[Arguments+3]==TT_STR)
          ((CBitmapButton*)pMainWindow)->LoadBitmaps(make_long(StringStore+Buda2[Arguments+3])); 
        else
          ((CBitmapButton*)pMainWindow)->LoadBitmaps(MAKEINTRESOURCE(IDB_BITMAP)); 
        ObjectStore[ObjectStore_br]=C_S_WIN_Button;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 138:         // check box
        {
        pMainWindow=new CButton;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="Check Box";
        ((CButton*)pMainWindow)->Create( WinName, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_3STATE, //BS_CHECKBOX
          rect, pMain_Frame, ObjectStore_br);
        ObjectStore[ObjectStore_br]=C_S_WIN_CheckBox;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 173:         // radio button
        {
        pMainWindow=new CButton;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="Radio Button";
        ((CButton*)pMainWindow)->Create( WinName, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_RADIOBUTTON,
          rect, pMain_Frame, ObjectStore_br);
        ObjectStore[ObjectStore_br]=C_S_WIN_CheckBox;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 175:         // group_box
        {
        pMainWindow=new CButton;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="";
        ((CButton*)pMainWindow)->Create( WinName, WS_CHILD | WS_VISIBLE | WS_TABSTOP
         | BS_GROUPBOX, rect, pMain_Frame, ObjectStore_br);
        ObjectStore[ObjectStore_br]=C_S_WIN_Static;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 176:         // tool_tip
        {
        pMainWindow=new CToolTipCtrl ;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="Tool Tip";
        ((CToolTipCtrl *)pMainWindow)->Create(pMain_Frame, TTS_ALWAYSTIP | WS_POPUP | WS_EX_TOOLWINDOW);
        if (n==M1 || k==M1)
          ((CToolTipCtrl *)pMainWindow)->AddTool(pMain_Frame, WinName);
        else
          ((CToolTipCtrl *)pMainWindow)->AddTool(pMain_Frame, WinName, &rect, ObjectStore_br);
        pMain_Frame->EnableToolTips(TRUE);
        ((CToolTipCtrl *)pMainWindow)->Activate(TRUE);
        ObjectStore[ObjectStore_br]=C_S_WIN_CheckBox;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 245:  // static
        {
        pMainWindow=new CStatic;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="Static";
        ((CStatic*)pMainWindow)->Create( WinName, WS_CHILD | WS_VISIBLE | SS_CENTER,
          rect, pMain_Frame, ObjectStore_br);
        ObjectStore[ObjectStore_br]=C_S_WIN_Static;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 246:  // edit
        {
        pMainWindow=new CRichEditCtrl;
        CRect rect(t, m, t+n, m+k);
        if (Buda1[Arguments+8]==TT_INT)
        {
          i=(Buda2[Arguments+8]&1)?WS_BORDER:0;
          if (Buda2[Arguments+8]&2)
            i|=ES_MULTILINE | WS_VSCROLL;
          if (Buda2[Arguments+8]&4)
            i|=ES_READONLY;
        }
        else
          i=WS_BORDER;
        ((CRichEditCtrl*)pMainWindow)->Create(i | WS_CHILD | WS_VISIBLE | WS_TABSTOP,
          rect, pMain_Frame, ObjectStore_br);
        if (Buda1[Arguments+3]==TT_STR)
          pMainWindow->SetWindowText(make_long(StringStore+Buda2[Arguments+3]));
        ObjectStore[ObjectStore_br]=C_S_WIN_Edit;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        ObjectStore[ObjectStore_br+4]=M1;
        }
        break;
       case 143:         // List Box
        {
        pMainWindow=new CListCtrl;
        CRect rect(t, m, t+n, m+k);
        CString WinName;
        if (Buda1[Arguments+3]==TT_STR)
          WinName=make_long(StringStore+Buda2[Arguments+3]);
        else
          WinName="Column 0";
        ((CListCtrl*)pMainWindow)->Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER
          | LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | WS_VSCROLL, rect, pMain_Frame, ObjectStore_br);
        ((CListCtrl*)pMainWindow)->InsertColumn( 0, WinName, LVCFMT_LEFT, n-20, -1 );
        /*if (Buda1[Arguments+11]==TT_OBJ)
        {
          DWORD *Temp=(LPDWORD)ObjectStore[Buda2[Arguments+11]+4];
          for (i=0; i<ObjectStore[Buda2[Arguments+11]+2]; i++)
            ((CListCtrl*)pMainWindow)->InsertItem( -1, (LPSTR)(StringStore+Temp[i]));
          if (ObjectStore[Buda2[Arguments+11]+6]&HALF) // free the list
          {
            DWORD old;
            if ((old=i=j=the_free_list)!=M1)
              for ( ; ObjectStore[i+3]<ObjectStore[Buda2[Arguments+11]+3] && (j=ObjectStore[i+6])!=M1; old=i, i=j);
            if (the_free_list==j)
              the_free_list=Buda2[Arguments+11];
            else
              ObjectStore[old+6]=Buda2[Arguments+11];
            //ObjectStore[Buda2[Arguments+11]]=CLASS_FREE_LIST;
            ObjectStore[Buda2[Arguments+11]+6]=j;
          }
        } */
        ObjectStore[ObjectStore_br]=C_S_WIN_ListBox;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 225:         // Tree Box
        {
        pMainWindow=new CTreeCtrl;
        CRect rect(t, m, t+n, m+k);
        ((CTreeCtrl*)pMainWindow)->Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER
          | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS| WS_VSCROLL,
            rect, pMain_Frame, ObjectStore_br);
        ObjectStore[ObjectStore_br]=C_S_WIN_TreeBox;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 247:  // bitmap
        {
        pMainWindow=new CStatic;
        CRect rect(t, m, t+n, m+k);
        ((CStatic*)pMainWindow)->Create(_T(""), WS_CHILD | WS_VISIBLE | SS_BITMAP,
          rect, pMain_Frame, ObjectStore_br);
        if (Buda1[Arguments+3]==TT_STR)
          ((CStatic*)pMainWindow)->SetBitmap((HBITMAP)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments+3]), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE));
        else
          ((CStatic*)pMainWindow)->SetBitmap((HBITMAP)LoadImage(theApp.m_hInstance, 
              MAKEINTRESOURCE(IDB_BITMAP), IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT));
        ObjectStore[ObjectStore_br]=C_S_WIN_Bitmap;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 248:  // icon
        {
        pMainWindow=new CStatic;
        CRect rect(t, m, t+n, m+k);
        ((CStatic*)pMainWindow)->Create(_T(""), WS_CHILD | WS_VISIBLE | SS_ICON,
          rect, pMain_Frame, ObjectStore_br);
        if (Buda1[Arguments+3]==TT_STR)
          ((CStatic*)pMainWindow)->SetIcon((HICON)LoadImage(NULL, 
              make_long(StringStore+Buda2[Arguments+3]), IMAGE_ICON, 0, 0, LR_LOADFROMFILE));
        else
          ((CStatic*)pMainWindow)->SetIcon((HICON)LoadImage(theApp.m_hInstance, 
              MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 0, 0, NULL));
        ObjectStore[ObjectStore_br]=C_S_WIN_Icon;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;

        }
        break;
       case 249:  // animate
        {
        flag=3;
        pMainWindow=new CAnimateCtrl;
        CRect rect(t, m, t+n, m+k);
        ((CAnimateCtrl*)pMainWindow)->Create(WS_CHILD | WS_VISIBLE | ACS_AUTOPLAY | ACS_TRANSPARENT, 
          rect, pMain_Frame, ObjectStore_br); //111
        if (Buda1[Arguments+3]==TT_STR)
          ((CAnimateCtrl*)pMainWindow)->Open(make_long(StringStore+Buda2[Arguments+3]));
        else
          ((CAnimateCtrl*)pMainWindow)->Open((UINT)NULL);
        //((CAnimateCtrl*)pMainWindow)->Play(0, M1, M1);
        ObjectStore[ObjectStore_br]=C_S_WIN_Animate;
        ObjectStore[ObjectStore_br+2]=(long)pMainWindow;
        }
        break;
       case 250:  // menu
        {
        if ((Buda1[Arguments+3]!=TT_STR && Buda1[Arguments+8]!=Definition[DF_SEPARATOR])// separator 
                               || pMain_Frame==NULL)
          return(0);
        ObjectStore[ObjectStore_br]=CLASS_SYSTEM_MENU;
        ObjectStore[ObjectStore_br+2]=NULL;
        if (MainMenu==NULL && pMain_Frame->GetMenu()==NULL)
        {
          CMenu TempMenu;
          TempMenu.CreateMenu();
          if (Buda1[Arguments+8]==Definition[DF_NORMAL])         // normal
            TempMenu.AppendMenu(MF_ENABLED | MF_STRING,
                              ObjectStore_br, make_long(StringStore+Buda2[Arguments+3]));
          else if (Buda1[Arguments+8]==Definition[DF_SEPARATOR])    // separator
            TempMenu.AppendMenu(MF_SEPARATOR);
          else if (Buda1[Arguments+8]==Definition[DF_POP_UP])     // pop_up
          {
            TempMenu.AppendMenu(MF_POPUP | MF_STRING,
                     (UINT)(MainMenu=CreateMenu()), make_long(StringStore+Buda2[Arguments+3]));
            ObjectStore[ObjectStore_br+2]=(long)MainMenu;
          }
          else
          {
            if (Buda1[Arguments+8]==Definition[DF_CHECKED])         // checked
              TempMenu.AppendMenu(MF_ENABLED | MF_STRING | MF_CHECKED,
                              ObjectStore_br, make_long(StringStore+Buda2[Arguments+3]));
            else if (Buda1[Arguments+8]==Definition[DF_GRAYED])         // grayed
              TempMenu.AppendMenu(MF_GRAYED | MF_STRING,
                              ObjectStore_br, make_long(StringStore+Buda2[Arguments+3]));
            else if (Buda1[Arguments+8]==Definition[DF_RIGHT])   // rightjustify
              TempMenu.AppendMenu(MF_ENABLED | MF_STRING | MF_RIGHTJUSTIFY,
                              ObjectStore_br, make_long(StringStore+Buda2[Arguments+3]));
          }
          pMain_Frame->SetMenu(&TempMenu);
          TempMenu.Detach();
        }
        else
        {
          HMENU hTempMenu=(MainMenu==NULL)?pMain_Frame->GetMenu()->m_hMenu:MainMenu;
          if (Buda1[Arguments+8]==Definition[DF_NORMAL])         // normal
            AppendMenu(hTempMenu, MF_ENABLED | MF_STRING,
                                 ObjectStore_br, make_long(StringStore+Buda2[Arguments+3]));
          else if (Buda1[Arguments+8]==Definition[DF_SEPARATOR])    // separator
            AppendMenu(hTempMenu, MF_SEPARATOR, 0, 0);
          else if (Buda1[Arguments+8]==Definition[DF_POP_UP])     // pop_up
          {
            AppendMenu(hTempMenu, MF_POPUP | MF_STRING,
                      (UINT)(MainMenu=CreateMenu()), make_long(StringStore+Buda2[Arguments+3]));
            ObjectStore[ObjectStore_br+2]=(long)MainMenu;
          }
          else
          {
            if (Buda1[Arguments+8]==Definition[DF_CHECKED])         // checked
              AppendMenu(hTempMenu, MF_ENABLED | MF_STRING | MF_CHECKED,
                                 ObjectStore_br, make_long(StringStore+Buda2[Arguments+3]));
            else if (Buda1[Arguments+8]==Definition[DF_GRAYED])         // grayed
              AppendMenu(hTempMenu, MF_GRAYED | MF_STRING,
                                 ObjectStore_br, make_long(StringStore+Buda2[Arguments+3]));
            else if (Buda1[Arguments+8]==Definition[DF_RIGHT])   // rightjustify
              AppendMenu(hTempMenu, MF_ENABLED | MF_STRING | MF_RIGHTJUSTIFY,
                                 ObjectStore_br, make_long(StringStore+Buda2[Arguments+3]));
          }
        }
        pMain_Frame->DrawMenuBar();
        }
      }
      for (j=Arguments; Buda1[j]==TT_LINK; j=Buda2[j]);
      Buda1[j]=TT_OBJ;
      if (p_line==386 && Buda1[Arguments+8]==TT_OBJ)
        Buda2[j]=Buda2[Arguments+8];
      else
      {
        Buda2[j]=ObjectStore_br;
        if ((ObjectStore_br+=ObjectStore[ObjectStore[ObjectStore_br]+2])>=OBJ_STORE && correct_OBJ_ST() )
          goto FULL2;
      }
      WILL_CLEAN(j);
      //Link[sv_subv++]=ObjectStore_br;
                  Ekler[++ekler_br]=4*FIRST_ROWS-4; // 9
                  Stack[stack_br+3]=ekler_br | QUARTER;
                  buda_br=a1+11; // for arguments
                  Link[sv_subv++]=my_gl;       
      a1=buda_br;
      Buda1[buda_br++]=ObjectStore[Buda2[j]+3];// ms_function;
      Buda1[buda_br++]=Definition[DF_INIT];                   // init
      OldWindow=pMainWindow;
      Stack[i=stack_br]|=HALF;
      Ekler[++ekler_br]=4; // 1
      Stack[stack_br+3]=ekler_br;
      my_gl2=1;
      j=call(2);
      Stack[i]&=HALFM;
      if (j>1)
        pMainFrame->PostMessage(WM_USER+1, j, 0); // OnEnd
      if (j==1)
        sv_subv--;
      pMainWindow=OldWindow;
      if (j>1)
      {
        ret_fl=j;
        return(6);
      }
      if (flag)
      {
        if (flag<3)
          pMain_Frame->SetForegroundWindow();
        pMainWindow->ShowWindow(SW_SHOWNORMAL);
        pMainWindow->UpdateWindow();
      }
      //ShowWindow(MainWindow, SW_SHOW);
      MainMenu=OldMenu;
      if (flag==2)
      {
        DWORD Wait_local;
        MSG msg;
       
        Wait_local=Wait_d++;
        pMainFrame->SetWindowText(_T("StrProlog is Waiting"));
        status_fl|=4;
        while (Wait_local<Wait_d && GetMessage (&msg, NULL, 0, 0))
        {
          if (Trace==4)
            Trace=1;
     //     if ( !TranslateMDISysAccel (((CFrameWnd*)theApp.m_pMainWnd)->GetActiveFrame()->m_hWnd, &msg) &&
     //        !TranslateAccelerator (theApp.m_pMainWnd->m_hWnd, hAccel, &msg))
          {
            TranslateMessage (&msg);
            DispatchMessage (&msg);
          }
        }
        status_fl&=M1^4;            // no wait
        if (Trace==2)
        {
          ret_fl=10;
          return(6);
        }
      }
      Stack[stack_br+3]|=QUARTER;  // No Cut!
      return(7);
     }
     case 72:  // text_out
      {
        HDC hDC;
        
        if (pMain_DC==NULL)
        {
          hDC=GetDC(pMain_Frame->m_hWnd);
          SetTextColor(hDC, ObjectStore[pMain_Frame->m_Number+4]);
          SetBkColor(hDC, ObjectStore[pMain_Frame->m_Number+5]);
          SetTextAlign(hDC, TA_UPDATECP);
        }
        else
          hDC=pMain_DC->m_hDC;
        if (hFont)
          SelectObject(hDC, hFont);
        if (Buda1[Arguments]==TT_INT && Buda1[Arguments+1]==TT_INT)
          MoveToEx(hDC, Buda2[Arguments], Buda2[Arguments+1], NULL);
        TextOut(hDC, 0, 0, make_long(StringStore+Buda2[Arguments+2]), 
                                my_strlen(make_long(StringStore+Buda2[Arguments+2])));
      }
      return(1);
     case 73:  // wait(T)
      if (Buda1[Arguments]==TT_INT)
        k=1000*Buda2[Arguments];
      else if (Buda1[Arguments]==TT_FLOAT)
        k=(int)(1000 * (*(float*)&(Buda2[Arguments])) );
      {
      CEvent eventNever;
      ::WaitForSingleObject(eventNever.m_hObject, k);
      }
      return(1);    
     case 77:  // select_color(W, S)
      {
      CWnd *pWindow;
      if (Buda1[Arguments+1]==TT_OBJ)
      {
        CHECK_TYPE(1,C_S_WIN_Main)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments+1]+2]);
      }
      else
        pWindow=(pMain_Frame)?pMain_Frame:(CWnd*)pMainFrame;
      CColorDialog dialog(0, 0, pWindow);
      dialog.m_cc.Flags = CC_FULLOPEN | CC_RGBINIT | CC_SHOWHELP | CC_ENABLEHOOK;//?hook
      if (Buda1[Arguments+2]==TT_INT)
        dialog.m_cc.rgbResult= Buda2[Arguments+2];
      else
        dialog.m_cc.rgbResult= RGB(255, 0, 0);
      if (dialog.DoModal()==IDOK)
      {
        Buda1[Buda2[Arguments]]=TT_INT;
        Buda2[Buda2[Arguments]]=dialog.m_cc.rgbResult;
        WILL_CLEAN(Buda2[Arguments]);
        return(1);    
      }
      return(0);    
      }//for
     case 170:  // select_font(W, S)
      {
      CWnd *pWindow;
      CFont font;
      if (Buda1[Arguments]==TT_OBJ)
      {
        CHECK_TYPE(0,C_S_WIN_Main)
        pWindow=((CWnd*)ObjectStore[Buda2[Arguments]+2]);
      }
      else
        pWindow=(pMain_Frame)?pMain_Frame:(CWnd*)pMainFrame;
      CFontDialog dialog(NULL, CF_EFFECTS | CF_SCREENFONTS, NULL, pWindow);
      if (Buda1[Buda2[Arguments+2]]==TT_INT)
        dialog.m_cf.rgbColors=Buda2[Buda2[Arguments+2]];
      if (Buda1[Buda2[Arguments+1]]==TT_OBJ)
      {
        if (!(SUBTYPE(ObjectStore[Buda2[Buda2[Arguments+1]]],CLASS_SYSTEM_FONT)))
        {
          error_func3(Arguments,p_line,1,CLASS_SYSTEM_FONT,0);
          return(0);
        }
        font.FromHandle((HFONT)(ObjectStore[Buda2[Buda2[Arguments+1]]+2]))->GetLogFont(dialog.m_cf.lpLogFont);
        dialog.m_cf.Flags|=CF_INITTOLOGFONTSTRUCT;
      }
      if (dialog.DoModal()==IDOK)
      {
        LOGFONT lf;
        dialog.GetCurrentFont(&lf);
        hFont=CreateFontIndirect(&lf);
        Buda1[Buda2[Arguments+2]]=TT_INT;
        Buda2[Buda2[Arguments+2]]=dialog.GetColor(); // no reconstruct after backtracking
        Buda1[Buda2[Arguments+1]]=TT_OBJ;
        Buda2[Buda2[Arguments+1]]=ObjectStore_br;
        ObjectStore[ObjectStore_br+2]=(DWORD)hFont;
        ObjectStore[ObjectStore_br+1]=M1;  // object name
        ObjectStore[ObjectStore_br]=CLASS_SYSTEM_FONT;
        if ((ObjectStore_br+=3)>=OBJ_STORE && correct_OBJ_ST() )
          goto FULL2;
        Buda1[Buda2[Arguments+3]]=TT_STR;
        Buda2[Buda2[Arguments+3]]=sv_StStore;
        i=ChangeCharset(M64_ch, ch_set, (BYTE *)(LPCTSTR)lf.lfFaceName, StringStore+sv_StStore, &k, default_char);
        if ((sv_StStore+=i+1)>=STRING_STORE && correct_STR_ST() )
          goto FULL;
        Buda1[Buda2[Arguments+4]]=TT_INT;
        Buda2[Buda2[Arguments+4]]=abs(lf.lfHeight);
        return(1);    
      }
      return(0);    
      }//for
     case 172: //shell_execute
       {
       _TCHAR *OpStr;
       if (Buda1[Arguments+1]==TT_STR) // str
         OpStr=make_long(StringStore+Buda2[Arguments+1]);
       else                         // var
         OpStr=NULL;
       if (32>=(int)(ShellExecute(NULL, OpStr, make_long(StringStore+Buda2[Arguments]), NULL, NULL, SW_SHOWNORMAL)))
         return(0);
       return(1);
       }
     case 82: //execute.file
       if (32>WinExec( (LPSTR)(StringStore+Buda2[Arguments]), SW_SHOW) )
         return(0);
       return(1);
