Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Active window
Message
 
 
Information générale
Forum:
Visual Basic
Catégorie:
Fonctions API de Windows
Titre:
Divers
Thread ID:
00392623
Message ID:
00393266
Vues:
18
>>If you have a background app, how can you tell what the has the current focus? ie MyBackground app is running and I want to see what the user is currently 'in' before my background app moves to the front/top.
>
>You can use the GetForegroundWindow and GetWindowText API calls. Sample:

>Private Declare Function GetForegroundWindow Lib "usre32" () As Long
>Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
> (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Sweet. GetForegroundWindow is just what the doctor ordered. Thanks! I had a 'focus' mindset when searching through the API's and got nowhere. thanks again!
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform