Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SHAutoComplete
Message
 
À
22/06/2001 09:39:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00522398
Message ID:
00522410
Vues:
10
>Anyone know if it's possible to get IE style auto complete functionality with VFP forms?
>
>I've added an MS Forms 2.0 Textbox to a form. Using VFP6/SP3. IE5.5 installed. The form Init is:-
>
>******************************************************************
>DECLARE INTEGER CoInitialize IN OLE32
>
>CoInitialize() && Not sure if this call is needed. MSDN says it is, other resources beg to differ
>
>DECLARE INTEGER SHAutoComplete IN SHLWAPI ;
> INTEGER hWnd, ;
> INTEGER dwFlags
>
>DECLARE INTEGER FindWindowEx IN WIN32API ;
> INTEGER hWnd, ;
> INTEGER hWnd2, ;
> STRING @lpClass, ;
> STRING @lnpName
>
>SET LIBRARY TO foxtools.fll ADDITIVE
>
>LOCAL lnHwnd, lcClass, lnControlHandle
>
>lnHwnd = _WhTohWnd(_WFindTitl(This.Caption))
>lcClass = "F3 Server 60000000"
>
>lnControlHandle = FindWindowEx(lnHwnd, 0, @lcClass, 0)
>
>SHAutoComplete(lnControlHandle, 0)
>******************************************************************
>
>When I run the form the textbox doesn't autocomplete like IE5 but using Mr Tasker's excellent SpyFoxFox utility I get an Auto-SuggestDropdown window appearing in the list so something is going on but not the desired result.
>
>Anyone managed to use this successfully in VFP?
>
>Thanks

Paul,

First, thanks for the kind words about SpyFoxFox.

Second, while I haven't tried this function, I do have a couple of ideas about things you might want to look at.

I'd look at the value returned by SHAutoComplete. If it's not S_OK (0) there's a problem.

I'd also make sure that I was getting a non-zero value for the control's window handle. In the code above, I can say that if it's implemented in an SDI form (top-level), it doesn't work because of differences in the window's construction between top-levels and other types of VFP forms.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform