MCPcopy Create free account
hub / github.com/LegacyUpdate/LegacyUpdate / OnDraw

Method OnDraw

LegacyUpdate/ProgressBarControl.cpp:286–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284#pragma mark - IViewObjectEx
285
286STDMETHODIMP CProgressBarControl::OnDraw(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue) {
287 if (lprcBounds == NULL || hdcDraw == NULL) {
288 return E_POINTER;
289 }
290
291 switch (dwDrawAspect) {
292 case DVASPECT_CONTENT:
293 case DVASPECT_OPAQUE:
294 case DVASPECT_TRANSPARENT:
295 break;
296
297 default:
298 return DV_E_DVASPECT;
299 }
300
301 if (m_innerHwnd) {
302 // Set size
303 LONG width = lprcBounds->right - lprcBounds->left;
304 LONG height = lprcBounds->bottom - lprcBounds->top;
305 SetWindowPos(
306 m_innerHwnd, NULL,
307 lprcBounds->left, lprcBounds->top,
308 width, height,
309 SWP_NOZORDER | SWP_NOACTIVATE
310 );
311 }
312
313 return S_OK;
314}
315
316#pragma mark - IOleInPlaceObject
317

Callers 1

DrawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected