Where is the last window size and position of various Microsoft applications stored in Windows?

Talk about anything
william_ahk
Posts: 471
Joined: 03 Dec 2018, 20:02

Where is the last window size and position of various Microsoft applications stored in Windows?

Post by william_ahk » 30 Nov 2022, 07:45

Does anyone know where it's stored? Like explorer, notepad, mspaint, etc.

User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Where is the last window size and position of various Microsoft applications stored in Windows?

Post by jNizM » 30 Nov 2022, 09:23

Each program stores information about its windows in its own way.

e.g. for Explorer:
HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile

william_ahk
Posts: 471
Joined: 03 Dec 2018, 20:02

Re: Where is the last window size and position of various Microsoft applications stored in Windows?

Post by william_ahk » 30 Nov 2022, 23:25

@jNizM Ah I thought there's a global storage for window position. I was wondering whether AHK Gui can utilize that.
Btw is it possible for Explorer to not remember the last window position and always use a default one? I want it to be always maximized every time. Currently I'm using this hack to force the window maximized:

Code: Select all

#e::Run ::{20D04FE0-3AEA-1069-A2D8-08002B30309D},, Max

User avatar
lmstearn
Posts: 681
Joined: 11 Aug 2016, 02:32
Contact:

Re: Where is the last window size and position of various Microsoft applications stored in Windows?

Post by lmstearn » 04 Dec 2022, 05:29

Sure, modify the keys as shown by copying the co-ordinates of the resolution of choice into the appropriate values pictured :
Keys.JPG
Keys.JPG (28.17 KiB) Viewed 1641 times
It won't show the folder as maximised, rather the folder as restored with maximum dimensions. Not a recommended method for multi-monitor setups. :P
:arrow: itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH

william_ahk
Posts: 471
Joined: 03 Dec 2018, 20:02

Re: Where is the last window size and position of various Microsoft applications stored in Windows?

Post by william_ahk » 06 Dec 2022, 22:33

@lmstearn Thanks! That's good enough for me :thumbup:

Post Reply

Return to “Off-topic Discussion”