Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need to get the list of applications working
Message
From
14/11/2001 14:39:42
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00426736
Message ID:
00581716
Views:
31
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
Map
View

Click here to load this message in the networking platform