Re: win32event.WaitForInputIdle() returns too soon
- From: "Hans" <NoSpam@xxxxxxxxx>
- Date: Sat, 30 Jun 2007 22:24:35 +0200
"Gabriel Genellina" <gagsl-py2@xxxxxxxxxxxx> schreef in bericht
news:mailman.184.1183090500.22759.python-list@xxxxxxxxxxxxx
En Thu, 28 Jun 2007 19:15:40 -0300, Hans <NoSpam@xxxxxxxxx> escribió:
I'm sending keyboard and mouse events to a seperate windows application.
I use win32event.WaitForInputIdle() before calling e.g.
win32api.keybd_event()
However it seems that WaitForInputIdle() returns too soon because some
of my
events get lost. Now I'v created my own WaitForInputIdle() which calls
From the Microsoft docs for WaitForInputIdle: "The WaitForInputIdle
function only works with GUI applications. If a console application calls
the function, it returns immediately, with no wait."
A typical Python script is a console application.
--
Gabriel Genellina
Well, this is weird. I searched for doc on the internet and that description
differs:
The process you're waiting for needs bo have a message queue (it does in my
case), not the process that calls WaitForInputIdle.
Hans
Waits until the specified process is waiting for user input with no input
pending, or until the time-out interval has elapsed.
DWORD WINAPI WaitForInputIdle(
HANDLE hProcess,
DWORD dwMilliseconds
);
Parameters
hProcess
[in] A handle to the process. If this process is a console application or
does not have a message queue, WaitForInputIdle returns immediately.
dwMilliseconds
[in] The time-out interval, in milliseconds. If dwMilliseconds is
INFINITE, the function does not return until the process is idle.
.
- References:
- win32event.WaitForInputIdle() returns too soon
- From: Hans
- Re: win32event.WaitForInputIdle() returns too soon
- From: Gabriel Genellina
- win32event.WaitForInputIdle() returns too soon
- Prev by Date: Re: win32event.WaitForInputIdle() returns too soon
- Next by Date: Re: Python's "only one way to do it" philosophy isn't good?
- Previous by thread: Re: win32event.WaitForInputIdle() returns too soon
- Next by thread: Re: Getting some element from sets.Set
- Index(es):
Relevant Pages
|