static public void  ScreenShow(IntPtr ScPar)
        {
            int    l2 = Marshal.SizeOf(ScPar);
            object kk = Marshal.PtrToStructure(ScPar, typeof(TrposxImport.ScreenParams));

            TrposxImport.ScreenParams tr = (TrposxImport.ScreenParams)kk;
            Marshal.StructureToPtr(tr, ScPar, true);
            ScreenParamsOut ScOut = ScreenParamsConvert(tr);

            Utils.ToCardLog("ScreenShow IDЖ " + ScOut.screenID + " AllStrs " + ScOut.AllStrs);
            if (tr.screenID == 3)
            {
                QFromTrposxForm TrPosXMessageForm = new QFromTrposxForm(ScOut.pTitle, ScOut.AllStrs);
                TrPosXMessageForm.button1.Text    = ScOut.pButton0;
                TrPosXMessageForm.button2.Text    = ScOut.pButton1;
                TrPosXMessageForm.button1.Visible = true;
                TrPosXMessageForm.button2.Visible = true;
                TrPosXMessageForm.button3.Visible = false;
                //TrPosXMessageForm.Init("Операция на терминале пластиковых карт.", "");
                //TrPosXMessageForm.button1.Click += new EventHandler(button1_Click);
                //TrPosXMessageForm.button2.Click += new EventHandler(button2_Click);

                //TrPosXClass.RunOperationAsinc(inStr);
                TrPosXMessageForm.TopMost = true;
                TrPosXMessageForm.ShowDialog();
                if (TrPosXMessageForm.Answ)
                {
                    //Marshal.WriteInt32( tr.eventKey, 0x30);
                    TrposxImport.SetEventKey(0x30);
                }
                else
                {
                    TrposxImport.SetEventKey(0x31);
                    //Marshal.WriteInt32(tr.eventKey, 0x31);
                }
                TrPosXMessageForm.Dispose();
            }
            else
            {
                ShowScreenVoid(ScOut, tr.maxInp == 0);
            }

            if (tr.screenID == 5)
            {
                Thread.Sleep(2000);
            }

            //Thread.CurrentThread.Join();
            //return 0;
        }
        static private ScreenParamsOut ScreenParamsConvert(TrposxImport.ScreenParams tr)
        {
            ScreenParamsOut mScreenParamsOut = new ScreenParamsOut();

            mScreenParamsOut.format   = (int)tr.format;
            mScreenParamsOut.pButton0 = GetStrFromPtr(tr.pButton0);
            mScreenParamsOut.pButton1 = GetStrFromPtr(tr.pButton1);
            mScreenParamsOut.pInitStr = GetStrFromPtr(tr.pInitStr);
            mScreenParamsOut.pStr     = new List <string>();
            for (int i = 0; i < 10; i++)
            {
                string nn = GetStrFromPtr(tr.pStr[i]);
                mScreenParamsOut.pStr.Add(nn);
                mScreenParamsOut.AllStrs += nn + Environment.NewLine;
            }


            mScreenParamsOut.pTitle   = GetStrFromPtr(tr.pTitle);
            mScreenParamsOut.pInitStr = GetStrFromPtr(tr.pInitStr);
            mScreenParamsOut.screenID = tr.screenID;

            return(mScreenParamsOut);
        }