Hi,
I dont know why is invalid =(
The strange thing is that in another function of the same class dont crash, the only difference is that this class is a afx msg function.
I cant use the standard GetForegroundWindow, the compiler dont allow me.
Thanks for attention =)