Hi!
Take a look to the GetWindowInfo API function in the MSDN help. You can call it from VFP. The structure it returns contains the dwWindowStatus flag. Following is from the help:
"The window status. If this member is WS_ACTIVECAPTION, the window is active. Otherwise, this member is zero. "
Than you can check in the timer event if the window is active to see if refreshing is required.
If you just looking for the minimized state of window, just check if _Screen.WindowState=1 in the timer event.
HTH.
>I have a question regarding the following.
>
>From my reading I understood that activate event only is triggered when
>you launce a form within a form.
>My question is.
>Are there any way or metode to get the same function when running a stand alone
>app (.exe).
>When the app is not active I want to disable a timer.
>Timer.interval=0
>
>I have 5 different apps communicating with a PLC. There is a lot of traffic
>on the com port. When one app is not active I want to disable the timer.
>The timer only trigger a Refresh and the refresh metode of my classes does communication with the PLC.
>
>In my old C code WM_ACTIVATE fuction like this but I'm not sure with VFP.
>
>
>Best regards Per
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.