Advertisement
Guest User

Untitled

a guest
Jun 15th, 2011
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.12 KB | None | 0 0
  1.     <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
  2.     Private Shared Function FindWindow( _
  3.      ByVal lpClassName As String, _
  4.      ByVal lpWindowName As String) As IntPtr
  5.     End Function
  6.  
  7.     Private Const SW_SHOWNORMAL As Integer = 1
  8.     Private Const SW_SHOWMINIMIZED As Integer = 2
  9.     Private Const SW_SHOWMAXIMIZED As Integer = 3
  10.  
  11.     <DllImport("user32.dll")> _
  12.     Private Shared Function ShowWindowAsync(ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Boolean
  13.     End Function
  14.  
  15.             Dim SkypeTitulo As String = ""
  16.  
  17.             Dim hWnd As IntPtr
  18.             For Each p As Process In Process.GetProcessesByName("skype")
  19.                'hWnd = FindWindow(p.ProcessName, p.MainWindowTitle)
  20.         'FindWindow always returns 0
  21.                 hWnd = p.Handle
  22.             Next p
  23.             If Not hWnd.Equals(IntPtr.Zero) Then
  24.                 ' SW_SHOWMAXIMIZED to maximize the window
  25.                 ' SW_SHOWMINIMIZED to minimize the window
  26.                 ' SW_SHOWNORMAL to make the window be normal size
  27.                 ShowWindowAsync(hWnd, SW_SHOWNORMAL)
  28.             End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement