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

idea: storing the windows' previous style as a window property #3

Open
Francesco149 opened this issue Nov 19, 2018 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@Francesco149
Copy link
Owner

win32 allows storing string properties into windows:

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setpropa

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getpropa

in theory I could serialize the current window attributes and store them in the window itself when i capture it so it can be restored without having to implement a system to store the window attributes on disk or having to run a daemon process to keep track of them

this only works if you have enough privileges to mess with the window, so if you run a program as admin and then weebp as a user it will fail to store the window properties, but that's fine, I don't think capturing the window would work either in such a situation

this is a bit of a hack but I think it's still more elegant than making weebp rely on any files/locations on disk and adding a bunch of code to serialize, deserialize and clean up this cache

another option is GWL_USERDATA but it's only the size of a pointer and it's used by many programs to store their own data (such as instance pointers) so SetProp is better

@Francesco149 Francesco149 added the enhancement New feature or request label Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant