Basculer vers un programme

daddam Messages postés 6 Date d'inscription dimanche 1 avril 2001 Statut Membre Dernière intervention 23 mars 2006 - 17 avril 2003 à 09:50
BasicInstinct Messages postés 1470 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 - 17 avril 2003 à 10:13
Bonjour,

Je cherche comment faire pour basculer vers un programme déja lancé et le mettre en premier plan.

1 réponse

BasicInstinct Messages postés 1470 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 12
17 avril 2003 à 10:13
faut recuperer son handle (api findwindow)
puis passer la fenetre au 1er plan (api setforegroundwindow)

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()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim lHandle As Long
'First we're going to retrieve the handle of this window
' "ThunderRT5Form" is the classname of a VB-window
lHandle = FindWindow("ThunderRT5Form", Me.Caption)
'Set this window to the foreground
lHandle = SetForegroundWindow(lHandle)
End Sub

:clown) BasicInstinct :clown)
0
Rejoignez-nous