-
Form problem...
Basically, I want a timer event to occur when a form has got focus/activated/clicked etc. Problem is, neither Form_Click, or Form_GotFocus even work. So I’ve tried Form_Activate, and by in large it works except it falls over when another application is opened i.e. the activate event no longer works when the form gets focus again.
Any ideas? :|
-
i dont know what is your exact need but mousemove event of form may help you. can you make it more clear
and form_activate will work only till the form has focus.
-
From what I understand you want the timer event to take place everytime the form is displayed. Therefore call it from the form load event.
-
I'll take it from the top...
Every 60 mins I want to check if a specific form has focus, if it does then I show a Msgbox stating the number of messages in the user's mailbox. I also give them the option to open up outlook and view the inbox. Now as I said, if I stay within the confinds of my application the activate event works perfectly. The problem is, when somebody decides to open up outlook and then go back to my application the activate event no longer seems to work until other forms are opened and then closed.
I'll try the mousemove event and let you know if it works... ta
-
The Form_Load event wouldn't work I'm afraid, as the form I'm talking about remains opened at all times until the application is closed.
p.s. the mousemove_event hasn’t worked either :(
Thanks anyway
-
why not use GetForeGround window api?
with a timer?
-
-
da_silvy,
I compared the return value of the api call with the hWnd value of the form and it works great.
Really appreciated, thx. :)
-
no probs
it was just a suggestion, i thought it might be useful to you though ;)