| View previous topic :: View next topic |
| Author |
Message |
testMunky
Joined: 16 Jan 2008 Posts: 6 Location: Hants, UK
|
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 257
|
Posted: Wed Jan 16, 2008 6:42 pm Post subject: |
|
You can block input from mouse and keyboard by calling the WinAPI function BlockInput(bool). Just be sure to call the function from the same thread that runs the automation script, otherwise the automated clicks and keyboard events may also be blocked.
To use this method in C#, include the following definition in your class:
Code: click into code to enlarge
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern bool BlockInput(bool block);
Another problem with the BlockInput function is that it sometimes seems to block Ranorex.Element access and actions, too. That's why this functionality is not included in Ranorex by default. So, if your script blocks on a specific line, just enable the input before that line and disable it afterwards again.
Regards,
Alex
Ranorex Support Team |
|
| Back to top |
|
 |
|