Information générale
Catégorie:
Fonctions Windows API
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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement