Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add Python API for PrintWindow Function #2195

Closed
songyuc opened this issue Mar 6, 2024 · 1 comment
Closed

Feature Request: Add Python API for PrintWindow Function #2195

songyuc opened this issue Mar 6, 2024 · 1 comment

Comments

@songyuc
Copy link

songyuc commented Mar 6, 2024

Hello pywin32 maintainers,

I am reaching out to discuss the potential inclusion of a Python API for the PrintWindow function within the pywin32 library.

Background

I am currently working on a Windows automation testing project, which requires capturing screenshots of application windows. This functionality is crucial for validating the state of different UI elements and ensuring our applications are functioning as expected, especially when windows are minimized or not in the foreground.

The Request

While pywin32 provides a wide range of useful APIs for Windows interaction, it appears that PrintWindow is not currently one of them. The PrintWindow function is particularly useful because it can capture screenshots of a window without bringing it to the foreground, and this feature would greatly enhance our testing capabilities.

Therefore, I am kindly requesting the consideration of adding a Python API for the PrintWindow function to the pywin32 library. This addition would be beneficial not only for my current project but I believe it would also be a valuable asset to many others in the community who face similar challenges.

Alternative Solutions

I understand that we can currently use ctypes to call PrintWindow indirectly, but having a direct API through pywin32 would simplify the process and reduce the boilerplate code required to achieve this functionality.

Contribution

I am more than willing to contribute to the development of this feature if that would be helpful. I can provide use cases, sample code, or even assist with the implementation if given some guidance on how you would like it structured within the library.

I appreciate your time and consideration of this feature request, and I am looking forward to the possibility of contributing to this excellent project.

Best regards,
Yucheng Song

@mhammond
Copy link
Owner

mhammond commented Mar 6, 2024

Thanks for your interest. I think this would be a simple change, an addition to (probably) win32gui.i, plus ideally a trivial test.

@songyuc songyuc closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants