MCPcopy Create free account
hub / github.com/AgoraIO/API-Examples / OnPaint

Method OnPaint

windows/APIExample/APIExample/APIExampleDlg.cpp:159–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157// this is automatically done for you by the framework.
158
159void CAPIExampleDlg::OnPaint()
160{
161 if (IsIconic())
162 {
163 CPaintDC dc(this); // device context for painting
164
165 SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
166
167 // Center icon in client rectangle
168 int cxIcon = GetSystemMetrics(SM_CXICON);
169 int cyIcon = GetSystemMetrics(SM_CYICON);
170 CRect rect;
171 GetClientRect(&rect);
172 int x = (rect.Width() - cxIcon + 1) / 2;
173 int y = (rect.Height() - cyIcon + 1) / 2;
174
175 // Draw the icon
176 dc.DrawIcon(x, y, m_hIcon);
177 }
178 else
179 {
180 CDialogEx::OnPaint();
181 }
182}
183
184// The system calls this function to obtain the cursor to display while the user drags
185// the minimized window.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected