G
Guest
Hi!
The C# version of CreateWaitableTimer and SetWaitableTimer should be
System.Threading.Timer.
1. Can this timer wake the system from standby / hibernate? I miss the
parameter "fResume". It is true, if the system should be restored.
BOOL WINAPI SetWaitableTimer(
HANDLE hTimer,
const LARGE_INTEGER* pDueTime,
LONG lPeriod,
PTIMERAPCROUTINE pfnCompletionRoutine,
LPVOID lpArgToCompletionRoutine,
BOOL fResume
);
2. If I try to import the Kernel32 functions it is working for
CreateWaitableTimer but I have a problem with the SetWaitableTimer function -
the parameters are showing the wrong signature:
[DllImport("Kernel32.dll", SetLastError = true)]
public static extern IntPtr CreateWaitableTimer(IntPtr lpSecurityAttributes,
bool manualReset, string timerName);
Wrong signature:
[DllImport("Kernel32.dll", SetLastError = true)]
public static extern bool SetWaitableTimer(IntPtr hTimer, LARGE_INTEGER
dueTime, long lPeriod, IntPtr pfnCompletionRoutine, IntPtr
lpArgToCompletionRoutine, bool fResume);
dueTime should be a pointer ... ?
Does anyone know what I should do?
Thanks a lot
Ralf
The C# version of CreateWaitableTimer and SetWaitableTimer should be
System.Threading.Timer.
1. Can this timer wake the system from standby / hibernate? I miss the
parameter "fResume". It is true, if the system should be restored.
BOOL WINAPI SetWaitableTimer(
HANDLE hTimer,
const LARGE_INTEGER* pDueTime,
LONG lPeriod,
PTIMERAPCROUTINE pfnCompletionRoutine,
LPVOID lpArgToCompletionRoutine,
BOOL fResume
);
2. If I try to import the Kernel32 functions it is working for
CreateWaitableTimer but I have a problem with the SetWaitableTimer function -
the parameters are showing the wrong signature:
[DllImport("Kernel32.dll", SetLastError = true)]
public static extern IntPtr CreateWaitableTimer(IntPtr lpSecurityAttributes,
bool manualReset, string timerName);
Wrong signature:
[DllImport("Kernel32.dll", SetLastError = true)]
public static extern bool SetWaitableTimer(IntPtr hTimer, LARGE_INTEGER
dueTime, long lPeriod, IntPtr pfnCompletionRoutine, IntPtr
lpArgToCompletionRoutine, bool fResume);
dueTime should be a pointer ... ?
Does anyone know what I should do?
Thanks a lot
Ralf