![]() Same as the last function, you can choose whether or not the function is case sensitive. Loadįor Each fWnd As FoundWindow In FindWindowsIndexOf( "TeST", False )ĭebug.WriteLine(fWnd.strWindowName & " : " & ) Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase. GetClassName(foundWindow.hWnd, sbClassName, 256)įoundWindow.strClassName = sbClassName.ToString If windowCaption.IndexOf(strIndexOf) > -1 ThenįoundWindow.hWnd = FindWindow(vbNullString, p.MainWindowTitle)įoundWindow.strWindowName = p.MainWindowTitleĭim sbClassName As New ( "", 256) ![]() Public Function FindWindowsIndexOf( ByVal strIndexOf As String, ByVal boolCase As Boolean ) As List( Of FoundWindow)ĭim foundWindows As New List( Of FoundWindow)įor Each p As Process In Process.GetProcessesĭim windowCaption As String = p.MainWindowTitle ''' As this function only loops through running processes main windows, it may miss some windows. ''' A list of FoundWindow's containing the window name, class and handle ''' Whether the function is should check for case ''' The string that you wish to check for in the window captions ''' This function is used to loop through all running processes, checking their main windows to see which ones contain a specific string Private Shared Function FindWindow( ByVal lpClassName As String, ByVal lpWindowName As String ) As IntPtr Private Shared Sub GetClassName( ByVal hWnd As System.IntPtr, ByVal lpClassName As, ByVal nMaxCount As Integer )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |