Skip to content

FindWindow... Looping help

Matt LaVoice

Asked Jun 22, 2006, 5:51 PM EDT2 answers
Share
LinkedInX
Im new to c# and managed to get findwindow working so that it detects if a window with a giving name is open or not but my problem is it only checks once and thats right when the program is started. How would I go about calling the check every X amount of seconds? Thanks in advance for your help

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    still haven't figured this out. No one knows how to run loops?
    0
  • Mike Gold
    0

    You probably need to call FindWindow in a timer event.  Set the timer interval for x milliseconds.

    1) Drag the Windows timer onto the form

    2)  Set the timer interval in the properties window

    2) Start the timer in the OnLoad event of the form

    3) handle the timer event in a event_handler and call FindWindow inside

    -Mike G

    0