Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the windows handle of an application
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00841131
Message ID:
00841171
Views:
33
>>>>>Hi all,
>>>>>
>>>>>Is the _vfp.hWnd the top-level window handle of a VFP application that can be seen from another VFP application? I use User32.IsWindow(hWnd_) but it returns 0, meaning: the window does not exist.
>>>>>
>>>>>Comments and feedback highly appreciated. TIA.
>>>>
>>>>The _VFP.hWnd is the window handle for the frame. I get back 1 when calling IsWindow with the _VFP.hWnd.
>>>
>>>My test is as follows:
>>>
>>>run myApp.exe from DOS.
>>>from within myApp.exe I strtofile(_vfp.Hwnd)
>>>
>>>from a VFP command window
>>>?IsWindow(theHwndValue) && returns 0
>>>
>>
>>I think that the problem may be in using STRTOFILE(). Try this
>>* In myApp.exe
>>= STRTOFILE(TRANSFORM(_VFP.hWnd), 'myhwnd.txt')
>>* In the command window
>>hWind = VAL(FILETOSTR('myhwnd.txt'))
>>? IsWindow(hWnd)
>
>yep, i did almost identical to your sample. I still get a zero. I even used the actual hWnd value in the IsWindow() and still returned zero.

Sorry, I'm clueless as to what the problem could be. I hate to say it, but I tested the above code I posted from the command window and it worked fine for both the _VFP and _SCREEN hWnd properties.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform