URGENT! Donne focus à une appli non VB

cs_tiger76 Messages postés 7 Date d'inscription lundi 27 janvier 2003 Statut Membre Dernière intervention 14 février 2003 - 28 janv. 2003 à 16:57
BasicInstinct Messages postés 1471 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 - 28 janv. 2003 à 17:37
Je lance 2 applications à partir d'une application VB et j'aimerai rendre la main à la 1ère application.

Si vous pouvez m'aider...n'hésitez pas

3 réponses

BasicInstinct Messages postés 1471 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 12
28 janv. 2003 à 17:17
'j'ai pas testé, mais ca doit marcher
'dans 1 module
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetForegroundWindow Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long

dans ton code:

Hwn = findwindow(vbnullstring,CaptionDeLaForm)
Hwn=SetForegroundWindow(hwn)

:clown) BasicInstinct :clown)
0
cs_tiger76 Messages postés 7 Date d'inscription lundi 27 janvier 2003 Statut Membre Dernière intervention 14 février 2003
28 janv. 2003 à 17:28
Je viens de tester, et ca ne marche pas non plus.
Je précise quand même que les 2 applis sont non Vb (par exemple calc et cmd)
0
BasicInstinct Messages postés 1471 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 12
28 janv. 2003 à 17:37
chez moi, ca ca marche :))


Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long

Private Sub Form_Load()
 Hwn = FindWindow(vbNullString, "Calculatrice")
 Hwn = SetForegroundWindow(Hwn)
End Sub


:clown) BasicInstinct :clown)
0