Hi Reza,
The simplest way to find out which keyboard layout is active, would be to call GetKeyboardLayout API function (or GetAsyncKeyState) every second using a Timer. That should not slow down an application too much.
By the way, user can choose some other combination of keys, not ALT+SHIFT, to switch between keyboard layouts.
* * *
As for monitoring the keyboard state, API functions like WaitForSingleObject normally should be called in separate threads, which is not an option for VFP. The SetWindowsHookEx is not an option either because of callback procedures.
* * *
I will check other options and will let you know if I find anything.