Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining if a window is a VFP editor window
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01451683
Message ID:
01451741
Views:
53
>>Is there a foolproof way of determining if a window (given either it's hWnd or WHandle) is a VFP code editor window? I've been using _EdGetEnv (and checking for a return value of 0) but it seems to fail under various circumstances (that is, _EdGetEnv seems to throw an exception). I thought about using the Win32 GetClassName() call but I don't see anything that differentiates something like the Property window from the editor Window (it seems some windows DO return a slightly different result, though).
>
>I guess that _EdGetEnv throws exeption on noe-editor windows, right?
>Why don't you wrap calls to _EdGetEnv in TRY...ENDTRY?

This is in an FLL. Actually, it occurred to me last night that the reason that this may have been failing was that I was calling _EdGetEnv with an invalid WHandle. I assumed VFP would always pass me a valid one, but it can't in every scenario depending on what is selected. I tried out the idea this morning and (at least in the few scenarios I could cause it to fail in the past) it seems to have fixed it. Crossing my fingers...
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform