Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
- Private Shared Function FindWindow( _
- ByVal lpClassName As String, _
- ByVal lpWindowName As String) As IntPtr
- End Function
- Private Const SW_SHOWNORMAL As Integer = 1
- Private Const SW_SHOWMINIMIZED As Integer = 2
- Private Const SW_SHOWMAXIMIZED As Integer = 3
- <DllImport("user32.dll")> _
- Private Shared Function ShowWindowAsync(ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Boolean
- End Function
- Dim SkypeTitulo As String = ""
- Dim hWnd As IntPtr
- For Each p As Process In Process.GetProcessesByName("skype")
- 'hWnd = FindWindow(p.ProcessName, p.MainWindowTitle)
- 'FindWindow always returns 0
- hWnd = p.Handle
- Next p
- If Not hWnd.Equals(IntPtr.Zero) Then
- ' SW_SHOWMAXIMIZED to maximize the window
- ' SW_SHOWMINIMIZED to minimize the window
- ' SW_SHOWNORMAL to make the window be normal size
- ShowWindowAsync(hWnd, SW_SHOWNORMAL)
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement