If your program calls SetForegroundWindow(), and then reaches the end of its timeslice and gets preempted; then the other program might call SetForegroundWindow before your program gets around to calling SendKeys().
With just two programs with two actions (SFW & SK) each, there are six possibilities for the ordering of those 4 actions:
A A A B B B A B B A A B B A B B A A B B A A B A
Only two will produce the desired result for both programs.
If so, what could one way be of fixing this,
The only sure way would be to wrap the two actions in a Critical Section.
This isn't (cannot easily be) available to Perl code.
In reply to Re: Is GUITest SetForegroundWindow/Sendkey thread safe?
by BrowserUk
in thread Is GUITest SetForegroundWindow/Sendkey thread safe?
by MPQC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |