Hi Daniel,
I've got confused with the VFP version you marked your initial message with.
True, VFP6 does not have hWnd property. Still it's not the end of the road ))
When a VFP form is active -- i.e. it possesses the keyboard focus -- at least two API functions can return the window handle for the form. While VFP9 does this intrinsically.
API declarations:
DECLARE INTEGER GetFocus IN user32
DECLARE INTEGER GetActiveWindow IN user32
Usage (once declared):
hWnd = GetFocus()
hWnd = GetActiveWindow()
The value obtained through either call is exactly the one that would have been stored in ThisForm.hWnd. Again, and this is important, the form must have the keyboard focus when the API is called.