Question

Say I open paint.exe from a c++ code using windows apis or just by clicking it.

After app opened up. I resized it(by hand or programmaticly) . And closed the app.

Next time I open it, it gives me the size from where I left off.

Is there a place where I can query the default size of apps(sizes when you see the apps when you first open it (for the very fist time) before you re size any windows)

And If i can, maybe I can call SetWindowPos to set the original position for that app.

Maybe this is not exactly a programming question.

Was it helpful?

Solution

This is always going to be different between applications.

Most application will remember their window size/position by using the registry. In the case of "paint", it stores this information in the registry at:

HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\View

Notepad stores similar information in HKCU\Software\Microsoft\Notepad - in an entirely different schema of registry key values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top