public UInt32 SetCursorPos(int p)
        {
            StringBuilder Data = new StringBuilder(0);
            UInt32        rc   = (UInt32)p;
            UInt32        f    = HA_SET_CURSOR;
            UInt32        l    = 0;

            return(EhllapiFunc.hllapi(out f, Data, out l, out rc));
        }
        public UInt32 Wait()
        {
            StringBuilder Data = new StringBuilder(0);
            UInt32        rc   = 0;
            UInt32        f    = HA_WAIT;
            UInt32        l    = 0;
            UInt32        r    = EhllapiFunc.hllapi(out f, Data, out l, out rc);

            return(r);
        }
        public UInt32 ReadScreen(int position, int len, out string txt)
        {
            StringBuilder Data = new StringBuilder(3000);
            UInt32        rc   = (UInt32)position;
            UInt32        f    = HA_COPY_PS_TO_STR;
            UInt32        l    = (UInt32)len;
            UInt32        r    = EhllapiFunc.hllapi(out f, Data, out l, out rc);

            txt = Data.ToString();
            return(r);
        }
        public UInt32 SendStr(string cmd)
        {
            StringBuilder Data = new StringBuilder(cmd.Length);

            Data.Append(cmd);
            UInt32 rc = 0;
            UInt32 f  = HA_SENDKEY;
            UInt32 l  = (UInt32)cmd.Length;

            return(EhllapiFunc.hllapi(out f, Data, out l, out rc));
        }
        public UInt32 GetCursorPos(out int p)
        {
            StringBuilder Data = new StringBuilder(0);
            UInt32        rc   = 0;
            UInt32        f    = HA_QUERY_CURSOR_LOC;
            UInt32        l    = 0; //return position
            UInt32        r    = EhllapiFunc.hllapi(out f, Data, out l, out rc);

            p = (int)l;
            return(r);
        }
        public UInt32 Disconnect(string sessionID)
        {
            StringBuilder Data = new StringBuilder(4);

            Data.Append(sessionID);
            UInt32 rc = 0;
            UInt32 f  = HA_DISCONNECT_PS;
            UInt32 l  = 4;

            return(EhllapiFunc.hllapi(out f, Data, out l, out rc));
        }