Message277664
| 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. |
|