This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Dan.O'Donovan, berker.peksag, docs@python, eryksun, python-dev
Date 2016-09-28.21:33:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475098434.25.0.917002233494.issue21903@psf.upfronthosting.co.za>
In-reply-to
Content
The GetWindowRect example seems fine, for the most part. The docs don't have to show it being called. If I were to call it, I'd use GetForegroundWindow to get a window handle. GetActiveWindow returns the active window attached to the current thread's message queue, but a console application probably doesn't own a window. (The console window is owned by conhost.exe.)

A more pressing matter is the GetModuleHandle examples, which need to either be fixed or replaced. GetModuleHandle returns a module's base address, and in a 64-bit process the result could be truncated when returned as the default C int type. GetModuleHandleW.restype has to be set to a pointer type. Setting it to a Python function, such as the ValidHandle example, has the same truncation problem. In general, a ValidHandle checker would have to be implemented as an errcheck function.
History
Date User Action Args
2016-09-28 21:33:54eryksunsetrecipients: + eryksun, docs@python, python-dev, berker.peksag, Dan.O'Donovan
2016-09-28 21:33:54eryksunsetmessageid: <1475098434.25.0.917002233494.issue21903@psf.upfronthosting.co.za>
2016-09-28 21:33:54eryksunlinkissue21903 messages
2016-09-28 21:33:53eryksuncreate