예제 #1
0
        /// <summary>
        /// 资源加载完成
        /// </summary>
        public void LoadComplete()
        {
            SystemDllHelper.AttachThreadInput(curID, foreID, 1);
            SystemDllHelper.ShowWindow(curWindowIntPtr, 3);
            SystemDllHelper.SetWindowPos(curWindowIntPtr, -1, 0, 0, 0, 0, 1 | 2);
            SystemDllHelper.SetWindowPos(curWindowIntPtr, -2, 0, 0, 0, 0, 1 | 2);
            bool max = SystemDllHelper.SetForegroundWindow(curWindowIntPtr);

            SystemDllHelper.AttachThreadInput(curID, foreID, 0);
        }
예제 #2
0
        private void Start()
        {
            experiment      = new ExperimentWindowsManager();
            curWindowIntPtr = SystemDllHelper.GetForegroundWindow();
            connection      = new ServerConnection();

            controllerEventPool = new EventPool(connection.messageDistribution);
            ProcessHelper process = new ProcessHelper();

            controllerEventPool.GetEvent <ConnectEvent>().AddReceiveEvent(OnConnectEvent);
            controllerEventPool.GetEvent <ExperimentReceiptEvent>().AddReceiveEvent(OnExpRec);

            connection.Connect("127.0.0.1", 8888);
        }
예제 #3
0
 private void Awake()
 {
     curWindowIntPtr = SystemDllHelper.GetActiveWindow();
     curID           = SystemDllHelper.GetCurrentThreadId();
     foreID          = SystemDllHelper.GetWindowThreadProcessId(curWindowIntPtr, default(IntPtr));
 }
예제 #4
0
 /// <summary>
 /// 选择实验启动,如果实验已连接,直接发送实验信息,否则在连接回调事件中等待发送
 /// </summary>
 public void SelectExpInfo(int i = 0)
 {
     experiment.Select(i);
     SystemDllHelper.SetForegroundWindow(curWindowIntPtr);
     SendExpInfo();
 }
예제 #5
0
 /// <summary>
 /// 实验结束后
 /// </summary>
 /// <param name="proto"></param>
 private void OnExpRec(int sender, IMessage proto)
 {
     //该窗口置顶
     SystemDllHelper.SetForegroundWindow(curWindowIntPtr);
 }