public override void StartPlaybackWithExistingFile(string filePath)
        {
            KBMActionRecorderLinq tmpKbmActionRecorder = new KBMActionRecorderLinq(filePath);
            KBMSimulator kbmSimulator = new KBMSimulator();

            object[] actions = tmpKbmActionRecorder.GetDatas();

            Thread.Sleep(1000);

            foreach (var item in actions)
            {
                if (item is Win32API.MouseEvent)
                {
                    kbmSimulator.Simulate(((Win32API.MouseEvent)item).dwFlags, ((Win32API.MouseEvent)item).pt.x, ((Win32API.MouseEvent)item).pt.y, 0, UIntPtr.Zero);
                    Thread.Sleep(((Win32API.MouseEvent)item).delayTime);
                }
                else if (item is Win32API.KeyEvent)
                {
                    kbmSimulator.Simulate(((Win32API.KeyEvent)item).bVk, ((Win32API.KeyEvent)item).vScan, ((Win32API.KeyEvent)item).dwFlags, ((Win32API.KeyEvent)item).dwExtraInfo);
                    Thread.Sleep(((Win32API.KeyEvent)item).delayTime);
                }
            }
        }
Exemple #2
0
 public KBMActionStrategy(IntPtr hookedInstance)
 {
     kbmHOOK = new KBMLLHook(hookedInstance);
     kbmActionRecorder = new KBMActionRecorderLinq();
     kbmSimulator = new KBMSimulator();
 }