I have to track the running time of a program. That program exposes the following window
At the same time I launch my program which in a timer does:
private void TimerCheckGroups_Tick(object sender, EventArgs e)
{
IntPtr windowPtr = FindWindowByCaption(IntPtr.Zero, "Execution");
if (windowPtr != IntPtr.Zero)
Console.Beep();<--------
}
But the beep line never gets hit. Have I misunderstood the meaning of a window caption?
--ADD-- I'll try to make the execution phases clearer.
Startup----> launch my logger.
User-------> launches program A that launches program B (not visible) that launches window C. C has caption Execution.
When I launch the solution proposed by dontbyteme the only the B program appears so only 1 window.
In short
logger: not visible since it's a tray program
program A: visible since it's the main program
program B: not visible since it's set to Notvisible
program C: not visible why?!?!?!?
--SOLUTION THANX TO JARRETT--
logger stays idle with a timer monitoring processes
program A starts but nobody cares about it. Then program A launches program B
when program B is awake i find the window and start logging