CWnd::OnCompacting

Syntax

afx_msg void OnCompacting( UINT nCpuTime );

Parameters

nCpuTime

Specifies the ratio of CPU time currently spent by Windows compacting memory. For example, 8000h represents 50 percent of CPU time.

Remarks

Called for all top-level windows when Windows detects that more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.

When a CWnd object receives this call, it should free as much memory as possible, taking into account the current level of activity of the application and the total number of applications running in Windows. The application can call the GetNumTasks Windows function to determine how many applications are running.

This message-handler member function calls the Default member function. Override this member function in your derived class to handle the WM_COMPACTING message.

See Also

::GetNumTasks, CWnd::Default, WM_COMPACTING