Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetFocus() keyboard cursor
Message
De
07/03/2009 13:23:51
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Divers
Thread ID:
01386339
Message ID:
01386435
Vues:
43
Hi Sergey,

It turns out Fox wouldn't give the form focus, because the WPF application was active and I was not using a top-level form. Setting it to a top-level form (or Desktop=.T.) fixes the cursor, but causes other problems. But, I'm making progress...

>Hi Joel,
>
>See if Using Carets can help.
>
>>I'm experimenting with embedding a Fox form inside of a WPF form. For the most part, I've got it working, but I having an issue with the keyboard focus. I can get focus to the VFP form, and I can type characters in a textbox, but there is no blinking keyboard cursor. Here is the C# code I'm using:
>>
>>
>>[DllImport("user32.dll")]
>>static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
>>[DllImport("user32.dll")]
>>static extern IntPtr SetFocus(IntPtr hWnd);
>>       
>>...
>>
>>SetParent(hWndFox, (IntPtr) hwndParent);
>>SetFocus(hWndFox);  // this works, but where's the keyboard cursor?
>>
>>
>>Can any of you WinAPI experts see what I'm missing?
>>
>>Thanks.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform