General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only