Advertisement
Holey_yan

[VB.NET] GetWindowsTitle

Oct 19th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.46 KB | None | 0 0
  1. Private Function GetWindowsTitle() As String
  2.     Dim TitleName As String = String.Empty
  3.     For Each p As Process In Process.GetProcesses(System.Environment.MachineName)
  4.         If (p.MainWindowHandle <> IntPtr.Zero) Then
  5.             If Not (String.IsNullOrWhiteSpace(p.MainWindowTitle)) Then
  6.                 TitleName &= p.MainWindowTitle & ","
  7.             End If
  8.         End If
  9.     Next
  10.     Return TitleName.TrimEnd(",").Replace(",", vbNewLine)
  11. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement