- Overcome OS Imposed Windows Form Minimum Size Limit
- 7 Answers 7
- Change The Maximum Window Size
- Memory Limits for Windows and Windows Server Releases
- Memory and Address Space Limits
- Physical Memory Limits: Windows 10
- Physical Memory Limits: Windows Server 2016
- Physical Memory Limits: Windows 8
- Physical Memory Limits: Windows Server 2012
- Physical Memory Limits: Windows 7
- Physical Memory Limits: Windows Server 2008 R2
- Physical Memory Limits: Windows Server 2008
- Physical Memory Limits: Windows Vista
- Physical Memory Limits: Windows Home Server
- Physical Memory Limits: Windows Server 2003 R2
- Physical Memory Limits: Windows Server 2003 with Service Pack 2 (SP2)
- Physical Memory Limits: Windows Server 2003 with Service Pack 1 (SP1)
- Physical Memory Limits: Windows Server 2003
- Physical Memory Limits: Windows XP
- Physical Memory Limits: Windows Embedded
- How graphics cards and other devices affect memory limits
Overcome OS Imposed Windows Form Minimum Size Limit
In an application I am developing, I need to be able to make a windows form smaller than the minimum height limit imposed by the operating system (36 px in Vista). I have tried intercepting WM_GETMINMAXINFO and providing my own information to override the OS limits, but this only works for the user. From code I can set the height to a value smaller than the limit, but my change only works until WM_WINDOWPOSCHANGED is posted to the message queue (which happens just after I change the height).
7 Answers 7
After much experimentation and trial-and-error, I have discovered a solution. I was overriding OnResize and conforming the size of the form to the ListBox in it (see my comment on John Saunders answer).
As I mentioned in my question, I noticed that the size of the form regresses after WM_WINDOWPOSCHANGED is sent. Further investigation revealed that the size regression actually begins when WM_WINDOWPOSCHANGING is sent.
WM_WINDOWPOSCHANGING is the sister message of WM_WINDOWPOSCHANGED which occurs before the window size actually changes. I don’t know why, but for some reason WM_WINDOWPOSCHANGING blindly conforms the size of the form to the OS specified limits (apparently it does not query the window with WM_GETMINMAXINFO). Thus, I needed to intercept WM_WINDOWPOSCHANGING and override it with the size I really wanted.
This means that I am no longer conforming the size of the form using OnResize, but instead I am conforming the form size when I receive WM_WINDOWPOSCHANGING. This is even better than OnResize, because there is no associated flicker which occurs when the size is changed and then changed again when the size is conformed during OnResize.
Also, it is necessary to intercept and override WM_GETMINMAXINFO, otherwise, even intercepting WM_WINDOWPOSCHANGING will do you no good.
Change The Maximum Window Size
A maximized window takes over all the space on the computer desktop with the exception of the space occupied by the taskbar, provided that it has not been set to hide automatically.
That’s usually the intended usage and many users are happy with the way it works. Some users however, especially those who run monitors with large resolutions, and those who want to keep an area on the desktop visible all the time, may want to change the default behavior.
The free software MaxMax can do that. It was originally developed to exclude the part of the screen that is occupied by the Windows Vista sidebar when maximizing, but can actually be used to define window margins for the maximize button in the Windows operating system.
The application displays the resolution limits in its interface on startup. By default, every maximized window is reduced by 160 pixels on the right side of the screen, optimized to keep the maximized windows from overshadowing the sidebars. All four screen margins can be configured separately, to define the exact boundaries for maximized windows in the operating system.
The program supports multi-monitor systems, and offers separate configurations for each computer monitor. A suppress key is set to Shift by default, which turns off the new maximize window size. It is possible to change that key to another one though.
Users who have configured the new maximum screen size need to enable the program in the system tray, by right-clicking on the icon and selecting Disable from the menu. This should switch the context menu entry to Enable indicating that the program is currently running.
MaxMax offers an interesting feature that can be useful for some Windows users who want part of the screen visible at all times, or want to limit the size of maximized windows to save screen estate (for instance to place two maximized windows next to each other without having to manually resize them).
The developer should consider adding a program whitelist, that would disable the program’s functionality for the whitelisted applications. Another interested feature would be to set a fix resolution for the maximized windows, instead of having to configure the margins.
MaxMax is compatible with 32-bit and 64-bit editions of the Windows operating system. Downloads are available at the developer homepage at KMTools.
Memory Limits for Windows and Windows Server Releases
This topic describes the memory limits for supported Windows and Windows Server releases.
Limits on memory and address space vary by platform, operating system, and by whether the IMAGE_FILE_LARGE_ADDRESS_AWARE value of the LOADED_IMAGE structure and 4-gigabyte tuning (4GT) are in use. IMAGE_FILE_LARGE_ADDRESS_AWARE is set or cleared by using the /LARGEADDRESSAWARE linker option.
4-gigabyte tuning (4GT), also known as application memory tuning, or the /3GB switch, is a technology (only applicable to 32 bit systems) that alters the amount of virtual address space available to user mode applications. Enabling this technology reduces the overall size of the system virtual address space and therefore system resource maximums. For more information, see What is 4GT.
Limits on physical memory for 32-bit platforms also depend on the Physical Address Extension (PAE), which allows 32-bit Windows systems to use more than 4 GB of physical memory.
Memory and Address Space Limits
The following table specifies the limits on memory and address space for supported releases of Windows. Unless otherwise noted, the limits in this table apply to all supported releases.
Memory type | Limit on X86 | Limit in 64-bit Windows | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
User-mode virtual address space for each 32-bit process | 2 GB Up to 3 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE and 4GT | 2 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE cleared (default) 4 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
User-mode virtual address space for each 64-bit process | Not applicable | With IMAGE_FILE_LARGE_ADDRESS_AWARE set (default): x64: WindowsВ 8.1 and Windows ServerВ 2012В R2 or later: 128 TB x64: Windows 8 and Windows Server 2012 or earlier 8 TB Intel Itanium-based systems: 7 TB 2 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE cleared | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Kernel-mode virtual address space | 2 GB From 1 GB to a maximum of 2 GB with 4GT | WindowsВ 8.1 and Windows ServerВ 2012В R2 or later: 128 TB Windows 8 and Windows Server 2012 or earlier 8 TB | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Paged pool | 384 GB or system commit limit, whichever is smaller. WindowsВ 8.1 and Windows ServerВ 2012В R2: 15.5 TB or system commit limit, whichever is smaller. Windows ServerВ 2008В R2, WindowsВ 7, Windows ServerВ 2008 and WindowsВ Vista: Limited by available kernel-mode virtual address space. Starting with WindowsВ Vista with Service PackВ 1 (SP1), the paged pool can also be limited by the PagedPoolLimit registry key value. Windows Home Server and Windows ServerВ 2003: 530 MB WindowsВ XP: 490 MB | 384 GB or system commit limit, whichever is smaller WindowsВ 8.1 and Windows ServerВ 2012В R2: 15.5 TB or system commit limit, whichever is smaller. Windows ServerВ 2008В R2, WindowsВ 7, Windows ServerВ 2008 and WindowsВ Vista: 128 GB or system commit limit, whichever is smaller Windows ServerВ 2003 and WindowsВ XP: Up to 128 GB depending on configuration and RAM. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nonpaged pool | 75% of RAM or 2 GB, whichever is smaller. WindowsВ 8.1 and Windows ServerВ 2012В R2: RAM or 16 TB, whichever is smaller (address space is limited to 2 x RAM). WindowsВ Vista: Limited only by kernel mode virtual address space and physical memory. Starting with WindowsВ Vista with SP1, the nonpaged pool can also be limited by the NonPagedPoolLimit registry key value. Windows Home Server, Windows ServerВ 2003 and WindowsВ XP: 256 MB, or 128 MB with 4GT. | RAM or 128 GB, whichever is smaller (address space is limited to 2 x RAM) WindowsВ 8.1 and Windows ServerВ 2012В R2: RAM or 16 TB, whichever is smaller (address space is limited to 2 x RAM). Windows ServerВ 2008В R2, WindowsВ 7 and Windows ServerВ 2008: 75% of RAM up to a maximum of 128 GB WindowsВ Vista: 40% of RAM up to a maximum of 128 GB. Windows ServerВ 2003 and WindowsВ XP: Up to 128 GB depending on configuration and RAM. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
System cache virtual address space (physical size limited only by physical memory) | Limited by available kernel-mode virtual address space or the SystemCacheLimit registry key value. WindowsВ 8.1 and Windows ServerВ 2012В R2: 16 TB. WindowsВ Vista: Limited only by kernel mode virtual address space. Starting with WindowsВ Vista with SP1, system cache virtual address space can also be limited by the SystemCacheLimit registry key value. Windows Home Server, Windows ServerВ 2003 and WindowsВ XP: 860 MB with LargeSystemCache registry key set and without 4GT; up to 448 MB with 4GT. | Always 1 TB regardless of physical RAM WindowsВ 8.1 and Windows ServerВ 2012В R2: 16 TB. Windows ServerВ 2003 and WindowsВ XP: Up to 1 TB depending on configuration and RAM. Physical Memory Limits: Windows 10The following table specifies the limits on physical memory for WindowsВ 10.
Physical Memory Limits: Windows Server 2016The following table specifies the limits on physical memory for Windows ServerВ 2016.
Physical Memory Limits: Windows 8The following table specifies the limits on physical memory for WindowsВ 8.
Physical Memory Limits: Windows Server 2012The following table specifies the limits on physical memory for Windows ServerВ 2012. Windows ServerВ 2012 is available only in X64 editions.
Physical Memory Limits: Windows 7The following table specifies the limits on physical memory for WindowsВ 7.
Physical Memory Limits: Windows Server 2008 R2The following table specifies the limits on physical memory for Windows ServerВ 2008В R2. Windows ServerВ 2008В R2 is available only in 64-bit editions.
Physical Memory Limits: Windows Server 2008The following table specifies the limits on physical memory for Windows ServerВ 2008. Limits greater than 4 GB for 32-bit Windows assume that PAE is enabled.
Physical Memory Limits: Windows VistaThe following table specifies the limits on physical memory for WindowsВ Vista.
Physical Memory Limits: Windows Home ServerWindows Home Server is available only in a 32-bit edition. The physical memory limit is 4 GB. Physical Memory Limits: Windows Server 2003 R2The following table specifies the limits on physical memory for Windows ServerВ 2003В R2. Limits over 4 GB for 32-bit Windows assume that PAE is enabled.
Physical Memory Limits: Windows Server 2003 with Service Pack 2 (SP2)The following table specifies the limits on physical memory for Windows ServerВ 2003 with Service PackВ 2 (SP2). Limits over 4 GB for 32-bit Windows assume that PAE is enabled.
Physical Memory Limits: Windows Server 2003 with Service Pack 1 (SP1)The following table specifies the limits on physical memory for Windows ServerВ 2003 with Service PackВ 1 (SP1). Limits over 4 GB for 32-bit Windows assume that PAE is enabled.
Physical Memory Limits: Windows Server 2003The following table specifies the limits on physical memory for Windows ServerВ 2003. Limits over 4 GB for 32-bit Windows assume that PAE is enabled.
Physical Memory Limits: Windows XPThe following table specifies the limits on physical memory for WindowsВ XP.
Physical Memory Limits: Windows EmbeddedThe following table specifies the limits on physical memory for Windows Embedded.
How graphics cards and other devices affect memory limitsDevices have to map their memory below 4 GB for compatibility with non-PAE-aware Windows releases. Therefore, if the system has 4GB of RAM, some of it is either disabled or is remapped above 4GB by the BIOS. If the memory is remapped, X64 Windows can use this memory. X86 client versions of Windows don’t support physical memory above the 4GB mark, so they can’t access these remapped regions. Any X64 Windows or X86 Server release can. X86 client versions with PAE enabled do have a usable 37-bit (128 GB) physical address space. The limit that these versions impose is the highest permitted physical RAM address, not the size of the IO space. That means PAE-aware drivers can actually use physical space above 4 GB if they want. For example, drivers could map the «lost» memory regions located above 4 GB and expose this memory as a RAM disk. |