General information
Category:
Windows API functions
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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only