Re: Activity timers
I am not sure, but according the documentation just one of this events will
be signaled. This events are manual reset events according the documentation
too. I think, then calling ResetEvent(Inactive) before calling the second
Wait would be necessary. ResetEvent(Active) would be necessary too after the
correpsonding Wait.
Edgar.
"voidcoder" <voidcoder@xxxxxxxxx> wrote in message
news:OP2k2kQZFHA.2796@xxxxxxxxxxxxxxxxxxxxxxx
> Could someone pls tell me why the following code does never
> return from the second WaitForSingleObject call !?
>
> HANDLE Active = OpenEvent(EVENT_ALL_ACCESS, FALSE,
> TEXT("PowerManager/SystemActivity_Active"));
> HANDLE Inactive = OpenEvent(EVENT_ALL_ACCESS, FALSE,
> TEXT("PowerManager/SystemActivity_Inactive"));
>
> if (WaitForSingleObject(Inactive, INFINITE) == WAIT_OBJECT_0)
> {
> if (WaitForSingleObject(Active, INFINITE) == WAIT_OBJECT_0) // <-
> Stall forever
> {
> // Some code
> }
> }
>
> I'd like to handle Inactive-to-Active transition state using activity
> timers but do not understand windows behaviour ... I'm able to
> wait for "Inactive" event, howether it stalls inside the second wait for
> "Active" event independent from the actual activity on the system.
> Any ideas?
>
> Thanks.
>
>
.
Relevant Pages
- RE: MS Security update 891781 - Microsoft Security Bulletin MS05-0
... There is virtually no documentation on this from Microsoft, ... and moved it to it's calling page, ... I know it's not as pretty, but it's a workaround, ... var properties = new Object; ... (microsoft.public.windowsxp.security_admin) - Re: SwingWorker.execute() does nothing
... You would do well to follow that advise as well, being the person who started the "bonehead" theme, as well as calling the person who was involved in the design decision an "idiot". ... SwingWorker is involved only because _you_ brought it into the picture by using the Dialog instance in the same section code as the SwingWorker. ... likelihood that someone will be showing a modal progress dialog or other such thing during a long-running operation, and given the natural tendency to want to pop up the dialog *first* and *then* start the operation. ... The logical conclusion from your assertion is that every single class method in the Java API should include documentation that says "if placed after a call to Dialog.setVisible, this method will not execute until after the user has dismissed the Dialog". ... (comp.lang.java.programmer) - Re: New Orleans Vote
... Speaking of "documentation", the NEXT time you document what you claim ... support your skewed views - will be the FIRST time. ... what you refer to as my "grade school name calling" was nothing ... (alt.smokers.cigars) - Re: Swing didnt Swing - Help!!
... directory structure that goes with them, ... all covered in Jeff's documentation, ... There are also event log entries that will help identify if there's an issue ... Calling an illegal alien an "undocumented worker" is like calling a ... (microsoft.public.windows.server.sbs) - Re: SBS 2003 and MS Accounting 2008
... Installed the client on a laptop as documentation ... says and I am unable to open the comapny that I created on the server. ... Help Help what am I doing wrong. ... Calling an illegal alien an "undocumented worker" is like calling a ... (microsoft.public.windows.server.sbs) |
|