>I tryed a program with code below. and I did not see effect when I jumped to another applications as MS Word.
>
>
>&&main program
>CLEAR MEMORY
replace this:
oScreenMethods = CREATEOBJECT("sm")
with this:
_SCREEN.NewObject("oScreenMethods","sm")
>DO FORM tam && testform
>READ EVENTS
>***********************
>PROCEDURE screenmethods.prg &&include in the main program
>DEFINE CLASS sm AS CUSTOM
> sm = _SCREEN
> FUNCTION sm.LOSTFOCUS
> WAIT WINDOW "LostFocus"
> ENDFUNC
>
> FUNCTION sm.GOTFOCUS
> WAIT WINDOW "GotFocus"
> ENDFUNC
FUNCTION sm.Resize
WAIT WINDOW "Resize" NOWAIT
ENDFUNC
>ENDDEFINE
Hmm, my machine at work seemed to work fine with Excel and VFP7, but my machine at home doesn't work for _SCREEN.GotFocus, LostFocus. Not sure what the difference is between the two environments. If you use the CREATEOBJECT(), the events don't seem to fire at all. With _SCREEN.NewObject(), they do within VFP. I had previously not tried all the events, but I had tried KeyPress, Resize, MouseMove, etc., and those worked fine, but still mainly within a VFP environment, not a VFP and other applications. I honestly don't know why my machine at work handles this fine, but mine at home does not. The only difference that I can think of is at work, I have Office XP, while at home I have Office 2000.