I see no reason you couldn’t use the exact same functions, all you need to do
is P/Invoke them.
CreateWaitableTimer:
http://pinvoke.net/default.aspx/kern...eWaitableTimer
SetWaitableTimer:
http://pinvoke.net/default.aspx/kern...tWaitableTimer
SetSuspendState:
http://pinvoke.net/default.aspx/powr...pendState.html
Brendan
"MD" wrote:
> Hi
> I'm porting a piece of code from C++ to C#.
> This code makes automatic suspend and resume of OS in a loop (N times),
> i.e. that the application N times does something, then suspends OS,
> after OS resume (NOT manual, but from the timer) it returns to the
> beginning of the loop etc.
> In C++ the flow looks like this:
> for (...)
> {
> // do something
>
> CreateWaitableTimer (...)
> SetWaitableTimer (...) // The last parameter (fResume) is true
> SetSuspendState (...)
> }
>
>
>
> I know to make suspend in C#. The problem is with timer. How to do the
> same in C#?
>
> Thanks in advance!
>
>