Hi!
Red my message more accurately: "Than backward."
This means you need to to go forward from the current HWND, then backward.
Also, the window you mentioned could be a child window of some other window. There are several tools to browse the windows hierarchy. I do not remember the name of the tool from VC++ pack (mabe somebody jump in and tell). This toll can help you to tell for sure how to reach that window.
>Hi!
>I am using a loop with GetWindow and GW_HWNDNEXT, but the window I am looking for does not come up in the list. It is visible and I can see a title bar, but it doesn't get recognized by the GetWindow loop. What else could I do to find it? I need to wait until it is done with what it is doing before I can continue in my program.
>
>
>>Hi!
>>
>> You cannot use EnumWindows in VFP with VFP functions, because VFP function code is not processor code, just a internal code for interpretation.
>> Use GetWindow with GW_HWNDNEXT flag to loop through windows. Loop until it returns 0 (zero) forward from current window (GetActiveWindow function). Than backward. You will have all windows enumerated by such way. Don;t use GetTopWindow/GetNextWindow for that because these works with visible windows only.
>>
>>>What is wrong here
>>>
>>>Thanks
>>>
>>> DECLARE INTEGER GetWindow IN win32api ;
>>> INTEGER ncurr_window_handle, ;
>>> INTEGER ndirection
>>>
>>> DECLARE INTEGER GetWindowText IN win32api ;
>>> INTEGER n_win_handle, ;
>>> STRING @ cwindow_title, ;
>>> INTEGER ntitle_length
>>>
>>> DECLARE INTEGER EnumWindows IN win32api ;
>>> INTEGER lpEnumFunc, ;
>>> INTEGER lparam
>>>
>>> ret = EnumWindows(EnumWindowsProc(), 0)
>>>
>>>
>>>FUNCTION EnumWindowsProc(hwnd, lParam)
>>> ? hwnd
>>> buffer = SPACE(255)
>>> cWinCap = GetWindowText(hwnd, buffer, LEN(buffer))
>>> RETURN 1
>>>ENDFUNC
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.