Skip to content

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

@Francesco149

Description

@Francesco149

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions