Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set focus with window handler
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00403381
Message ID:
00403748
Vues:
17
for activate window try this code:

Public Declare Function SetFocusAPI Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function SetActiveWindow Lib "user32" (ByVal hwnd As Long) As Long


Public Function MakeWindowActive(ByVal hwnd As Long)
On Error Resume Next
Dim res As Long
res = SetActiveWindow(hwnd)
res = SetFocusAPI(hwnd)
If IsIconic(hwnd) Then res = ShowWindow(hwnd, 9)
res = SetForegroundWindow(hwnd)
End Function
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform