It launching a new iexplore only when existing iexplore is there and I'm getting dwthreadid but when I transfer hwnd to threadid always shows same wrong id.
ThreadID = hnd
lhWnd = FindWindowEx(AddressOf EnumThreadWndActive, lhWnd, "IEFrame", vbNullString)
pid = GetWindowThreadProcessId(hwnd, lpId)
and tried with below code also
If GetWindowThreadProcessId(lhWnd, tId) <> 0 Then 'Get the window's thread id
If tId = pid Then InstanceToWnd = hwnd: ' If pid matches then exit
Expected the foll.functionality:
I wanted to open iexplore and when ever ipress the button next next iexplore should be open with different threadid using createprocess.
In next command button based on that threadid I wanted to check whether iexplore window is active or not and another 3rd command button to close the particular Active iexplore based on threadid.