I have a windows forms application where i add the mainloop in the constructor of the form like this:
Application.Idle += new EventHandler(Update);
that works fine - however, my update function is not called when I minimize the application window. What do I need to do in order to get my update function called also while the window is minimized?
You can use a timer as Henk suggests, but simply add a flag that signals that the method is still processing.
So, set a delay time of, say, 50ms, and code up the event handler like so:
where
_isProcessing
is a private boolean variable on your form.If you expect the operations to take less than 50ms each, then aggregate the operations somehow (maybe a queue would be appropriate).