I have a application that checks mail every 10 minutes
when mail is found it pops up a window above the tray.(i don't like the windows balloon :))
The popup may not open is the active window is Maximized (IsZoomed), this is for if i'm playing a game.
The problem is that this window gets the focus.
lets say i'm working in MSWord and my program fires the popupscreen, i loose the focus on MSWord
i must either click MSWord or wait for the popup to disapear after 10 seconds
is there a way to popup a window that does not recieve focus or after opening the window, give the focus back to the the active window.
i tried the following things:
This doesn't work because these api's only work on the apllications thread
Then i tried
Dim p As Process
For Each p In Process.GetProcesses(System.Environment.MachineName)
Dim fw As Integer = FindWindow(vbNullString, p.MainWindowTitle)
If IsZoomed(fw) <> 0 Then
But now i cannot see wich of the FindWindows is the active one in Windows :(