❔ How do I look a bool method every 5 minutes?
So I have a bool method called WindowWatch(), and it works and returns true and false when I need it to. How do I make it so that I do it every 5 minutes? I feel like I'm not using the boolean method properly.
Basically what I am trying to do is run WindowWatch() every five minutes.
Code: https://pastebin.com/tvhXgY6k
Pastebin
using System.Reflection;using System.Runtime.InteropServices;using ...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
3 Replies
1. You could use Timer class:
And set _timer.Enabled = false to stop.
2. Set WindowWatch to void. If you want to return something, make an Action<bool> callback instead.
I'm also surprised you need to go this low level importing the DLL. You'd think there would be a Net api for this, maybe in NuGet
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.