Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set focus with window handler
Message
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00403381
Message ID:
00403748
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform