Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_SCREEN.hWnd, FindWindow() and MAINHWND()
Message
 
To
31/07/2001 21:18:12
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00537608
Message ID:
00538236
Views:
59
>>Looks fine. Tell me, however, are you just trying to get the window handle of the _SCREEN? If so, there may be a better (less code) way.
>
>I needed handles to Forms in _SCREEN.

Gerry,

You might want to ignore my previous. If you're using MainhWnd(), then you're using Foxtools. In order to get the window handle of a given form, all you need are the functions I mentioned in the other post: _WhTohWnd() and _WFindTitl(). You mentioned that you use an underscore in to indicate a custom property. In keeping with that, the following, in a form's Init event will store its window handle to h_window:
This.h_window = _WhTohWnd(_WFindTitl(This.Caption))
The only thing you need to be careful of are forms with the same caption. This will cause the wrong value to be store in occurrences of the form after the first one. If that's a possibility, then an API based solution might be required.
George

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

Click here to load this message in the networking platform