CodePudding user response:
Task manager to check the number of GDI handle, should be constantly CreateSolidBrush GDI leaks cause resource depletionThe static CBrush mBrush;
If (mBrush m_hObject==NULL)
{
MBrush. CreateSolidBrush (RGB (255, 0, 0));
}
Return (HBRUSH) mBrush;
CodePudding user response:
Search "GDI leak detection"CodePudding user response:
CreateSolidBrush continuously create, do not need to create repeatedly, reuseCodePudding user response:
Create a is enough, gets the if found guilty of empty is created,
CodePudding user response:
The dialog initialization, create good, then use it.Try
The GetStockObject
It is not necessary, but It is not harmful) to delete stock objects by calling DeleteObject.
CodePudding user response:
GDI to more than 9999,