Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handle to Windows listed under Windows
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00587516
Message ID:
00587639
Views:
28
This message has been marked as a message which has helped to the initial question of the thread.
>_SCREEN.FORMS do not list code opened through MODIFY COMMAND.

Sorry, I misunderstood what you were doing.

What it would take would be a combination of Foxtools and the Windows API. I'd use _WhtoHwnd(_Wontop()) from Foxtools to get the window handle of the currently active window. Then use the API (GetParent() and GetWindow()) to iterate through the child Windows. I suppose one might be able to get away without GetParent(), but I'd probably use it just to be sure. The code would look something like this
#DEFINE GW_CHILD 5
#DEFINE GW_NEXT 2
lnhwnd = _WhTohWnd(_Wontop())
DECLARE INTEGER GetParent IN Win32API;
  INTEGER hWnd
DECLARE INTEGER GetWindow IN Win32API;
  INTEGER hwnd, INTEGER dflag
DECLARE INTEGER GetWindowText IN Win32API;
  INTEGER hwnd, STRING @lptstr, INTEGER cbmax
* Get the parent
lnparent = GetParent(lnhwnd)
* Get the first child
lnchild = GetWindow(lnparent, GW_CHILD)
DO WHILE lnchild > 0
  lcbuffer = SPACE(260)
  lnlength = GetWindowText(lnchild, @lcbuffer, 260)
  ? LEFT(lcbuffer, lnlength)
  lnchild = GetWindow(lnchild, GW_NEXT)
ENDDO
George

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

Click here to load this message in the networking platform