> At Saturday 20/1/2007 21:35, jbd wrote: > Check also whether WaitForInputIdle returns 0, and not WAIT_TIMEOUT > (meaning that the process is not ready yet)
That's why i'm doing. Moreover, i'm using INFINITE as a timeout. ret = win32event.WaitForInputIdle(handle, win32event.INFINITE) if ret != 0: raise SystemExit("Problem during process wait") > But since you're already using messages, maybe the easiest way is > making the target application broadcast a message telling "I'm ready > now", and when the caller sees it, it knows it can post the message. > Use RegisterWindowMessage on both applications, with the same name, > to obtain a unique message identifier. > Use HWND_BROADCAST as the first argument to PostMessage to broadcast > it to all top level windows. Ok. Thanks for the tip. The fact is really don't know when the target application is really ready. I'll have to spy it on Monday =) Is there way to detect that a entry in a menu is not activated ? > Yes, it appears that you cannot retrieve the return value of > PostMessage. Anyway it won't tell you much. The caller can communicate > its own window handle to the target application, using the wParam or > lParam arguments when it sends some message. This way, the target > application can reply to the caller when he has completed processing the > operation (either ok or with an error). Ok, i'm gonna look into it ! Thanks a lot for having taking time to respond. _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32