[Request] Checking a windows state.[Solved]
I want to check a process out side of visual basic's window state such as Minimized , Maximized , etc.
Private Function GetActiveWindowTitle() As String
Dim MyStr As String
MyStr = New String(Chr(0), 100)
GetWindowText(GetForegroundWindow, MyStr, 100)
MyStr = MyStr.Substring(0, InStr(MyStr, Chr(0)) - 1)
Return MyStr
End Function
If GetActiveWindowTitle() = "Untitled - Notepad" Then
'Whatever you want to get done. Auto spam?
End If