Results 1 to 9 of 9

Thread: Form problem...

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    England
    Posts
    36

    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? :|

  2. #2
    Hyperactive Member abhid's Avatar
    Join Date
    Nov 2001
    Location
    3rd rock from the sun
    Posts
    467
    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.

  3. #3
    PORRASTAR
    Guest
    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.

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    England
    Posts
    36
    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
    Last edited by WuzZ; Nov 19th, 2001 at 04:45 AM.

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    England
    Posts
    36
    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

  6. #6
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    why not use GetForeGround window api?

    with a timer?

  7. #7

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    England
    Posts
    36
    I'll look it up...

  8. #8

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    England
    Posts
    36
    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.

  9. #9
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    no probs

    it was just a suggestion, i thought it might be useful to you though

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width