|
-
Jul 31st, 2016, 11:11 PM
#1
Thread Starter
Banned
[SOLVED] FindWindow function to find Google Chrome personal user's windows.
Hello,
So I have created and running multiple google chrome instances with different users. Link : http://image.prntscr.com/image/286c7...a5e58c5501.png
I would like to find particular instance and bring it to front. But it's not working as expected.
For example, For the "Person 12 - Goole Chrome" window, I tried to find with this but didn't work. Link : http://image.prntscr.com/image/15837...c8072627e2.png
When I tried with notepad, it worked. Is there any other way to find the Google Chrome personal user's window and bring it to front ?
PHP Code:
Public Class Form1
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)>
Private Shared Function FindWindow(
ByVal lpClassName As String,
ByVal lpWindowName As String) As IntPtr
End Function
<DllImport("user32.dll")>
Private Shared Function SetForegroundWindow(ByVal hWnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim Name As String = "Person 12 - Goole Chrome"
Dim ptr As IntPtr = FindWindow(Nothing, Name)
SetForegroundWindow(ptr)
End Sub
End Class
Thank You!
Last edited by abhishek009; Aug 3rd, 2016 at 12:43 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|