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
|

BasicInstinct

-------------------------------
Réponse au message :
-------------------------------
>
> 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)
>
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> >
> > '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)
> >
> >

BasicInstinct

> >
> >
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > 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
> >
>