Accueil > Forum > > > > Application active
Application active
mardi 30 juillet 2002 à 21:01:24 |
Application active

ypelissier
|
Bonjour, J'aimerai pouvoir connaitre l'application qui à le focus dans windows ? Merci Yann
|
|
mardi 30 juillet 2002 à 22:58:09 |
Re : Application active

Charlie
|
Y'a un API de window qui fait ca.... voici la description... Mais il reste qu'il ne te retourne que le Handle!!!
Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
The GetActiveWindow function retrieves the window handle to the active window associated with the thread that calls the function.
If the function succeeds, the return value is the handle to the active window associated with the thread that calls the function. If the calling thread does not have an active window, the return value is NULL.
Exemple...
'This Project needs '- two timers, interval=100 '- a button
'in general section Private Type POINTAPI x As Long y As Long End Type
Private Declare Function GetActiveWindow Lib "user32" () As Long Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function Ellipse Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Sub Form_Load() Timer1.Interval = 100 Timer1.Enabled = True Timer2.Interval = 100 Timer2.Enabled = True Command1.Caption = "Draw Text" End Sub 'This will draw an Ellipse on the active window Sub Timer1_Timer() Dim Position As POINTAPI 'Get the cursor position GetCursorPos Position 'Draw the Ellipse on the Screen's DC Ellipse GetWindowDC(0), Position.x - 5, Position.y - 5, Position.x + 5, Position.y + 5 End Sub Sub Command1_Click() 'KPD-Team 1998 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net
Dim intCount As Integer, strString As String strString = "Cool, text on screen !" For intCount = 0 To 30 'Draw the text on the screen TextOut GetWindowDC(0), intCount * 20, intCount * 20, strString, Len(strString) Next intCount End Sub Private Sub Timer2_Timer() 'Draw the text to the active window TextOut GetWindowDC(GetActiveWindow), 50, 50, "This is a form", 14 End Sub
------------------------------- Réponse au message : -------------------------------
Bonjour, J'aimerai pouvoir connaitre l'application qui à le focus dans windows ?
Merci
Yann
|
|
mercredi 21 août 2002 à 11:31:00 |
Re : Application active

ypelissier
|
Merci beaucoup...
------------------------------- Réponse au message : -------------------------------
Y'a un API de window qui fait ca.... voici la description... Mais il reste qu'il ne te retourne que le Handle!!!
Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
The GetActiveWindow function retrieves the window handle to the active window associated with the thread that calls the function.
If the function succeeds, the return value is the handle to the active window associated with the thread that calls the function. If the calling thread does not have an active window, the return value is NULL.
Exemple...
'This Project needs '- two timers, interval=100 '- a button
'in general section Private Type POINTAPI x As Long y As Long End Type
Private Declare Function GetActiveWindow Lib "user32" () As Long Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function Ellipse Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Sub Form_Load() Timer1.Interval = 100 Timer1.Enabled = True Timer2.Interval = 100 Timer2.Enabled = True Command1.Caption = "Draw Text" End Sub 'This will draw an Ellipse on the active window Sub Timer1_Timer() Dim Position As POINTAPI 'Get the cursor position GetCursorPos Position 'Draw the Ellipse on the Screen's DC Ellipse GetWindowDC(0), Position.x - 5, Position.y - 5, Position.x + 5, Position.y + 5 End Sub Sub Command1_Click() 'KPD-Team 1998 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net
Dim intCount As Integer, strString As String strString = "Cool, text on screen !" For intCount = 0 To 30 'Draw the text on the screen TextOut GetWindowDC(0), intCount * 20, intCount * 20, strString, Len(strString) Next intCount End Sub Private Sub Timer2_Timer() 'Draw the text to the active window TextOut GetWindowDC(GetActiveWindow), 50, 50, "This is a form", 14 End Sub
------------------------------- Réponse au message : -------------------------------
Bonjour, J'aimerai pouvoir connaitre l'application qui à le focus dans windows ?
Merci
Yann
|
|
Cette discussion est classée dans : application, active
Répondre à ce message
Sujets en rapport avec ce message
Faut il des active X specifique a Win2000 ou NT pour une application Internet?? [ par Aktarez ]
Faut il des active X specifique a Win2000 ou NT pour une application Internet??je veux envoyer des info vers un ftp et avec win 2000, le prog me fais
trouver l'application active en VB .net [ par bb85 ]
En VB6 je sais le faire avec les API GetForegroundWindow et GetWindowText.Mon souci : refaire en VB .Net une petite application qui envoie par SendKey
détécter la form active de mon application [ par zmaai ]
Je cherche à détecter la form active dans mon application(par exemple en cliquant sur une command le nom de la form s'affiche dans une zone de text ou
APPLICATION ACTIVE [ par planchon_a ]
Bonjour, Je cherche à pouvoir détecter en VB6, quelle application de Windows est actuellement active...
fenetre active [ par Mekhanik ]
Salut je cherche une api qui me permette de determiner au sein d'une application mutlifenetre laquelle est active (genre photoshop lorsque plusieurs f
application active [ par GEX RIDER ]
je cherche le moyen de recupererune api qui peut donner le titre de la fenetre ou de l'application activemerci de m'aiderje veux veux bien aider aussi
rendre une application active à partir de son handle [ par kiakia ]
Voilà tout est presque dans le titre :Dsauf qu' il s'agit d'une console dos :p j'ai essayé plusieur fonction comme set.focus, put.focus mais j'arrive
Déterminer La form active dans Une Application MDI [ par VPNVB ]
Salutje veux developper un editeur de text (en mode MDI)mais comon déterminer le formulaire de document active par exempledans VB6, en peux écrir:Acti
Besoin de suggestion [ par djief ]
Salut Je suis à la recherche d'une suggestion. J'ai 3 combobox dans mon application. La premiere active la 2e qui active la 3e. La 3 dépend de la 2 et
Telecharger un fichier sans ACTIVE X [ par nicodada ]
J'ai fais une rechercher sur le SITE. Il me faut télécharger un fichier sur un HTTP, en utilisans un API mais qu'il ne fasse pas plante
Livres en rapport
|
Derniers Blogs
ASYNC/AWAIT: COMPRENDRE COMMENT CA MARCHEASYNC/AWAIT: COMPRENDRE COMMENT CA MARCHE par fathi
Tout le monde est unanime pour dire que la programmation multi-thread et asynchrone est en train de devenir un sujet incontournable. Beaucoup de choses sont arrivées avec le framework 4 pour le code parallèle (TPL, PLinq,.) et bientôt, on va avoir l...
Cliquez pour lire la suite de l'article par fathi PAS D'INTELLITRACE SUR MON SITE WEB DANS IIS !PAS D'INTELLITRACE SUR MON SITE WEB DANS IIS ! par Etienne Margraff
J'ai récemment eu un problème pour obtenir l'intelliTrace sur un site web dans IIS. Il n'y avait pas de message d'erreur, rien dans le journal d'évènement Windows, et après 3 appels à une voyante, 2 visites chez un marabou, j'ai failli me résign...
Cliquez pour lire la suite de l'article par Etienne Margraff OFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONSOFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONS par junarnoalg
De nombreuses entreprises font le choix de SharePoint Online, service fourni au travers de l'offre de Microsoft Office 365. S'il est vrai que ce choix apporte un grand nombre d'avantages; rapidité de mise en œuvre, disponibilité, large couvertu...
Cliquez pour lire la suite de l'article par junarnoalg PRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGEPRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGE par richardc
http://www.c2idotnet.com/articles/presentation-des-api-rest-de-windows-azure-lister-les-comptes-de-storage
Désolé pour "toto", mais c2i existait avant blogs.developpeur.org et c'est mon site "officiel" ;-) ...
Cliquez pour lire la suite de l'article par richardc
Logiciels
DocTranslate (V3.1.0.0)DOCTRANSLATE (V3.1.0.0)DocTranslate est un traducteur de document Microsoft Word, PowerPoint et Excel. Il permet d'autom... Cliquez pour télécharger DocTranslate Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|