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

Method SetExtent

LegacyUpdate/ProgressBarControl.cpp:150–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150STDMETHODIMP CProgressBarControl_IOleObject::SetExtent(DWORD dwDrawAspect, SIZEL *psizel) {
151 if (psizel == NULL) {
152 return E_POINTER;
153 }
154
155 if (dwDrawAspect != DVASPECT_CONTENT) {
156 return DV_E_DVASPECT;
157 }
158
159 // Convert from HIMETRIC
160 HDC hdc = GetDC(NULL);
161 int ppiX = GetDeviceCaps(hdc, LOGPIXELSX);
162 int ppiY = GetDeviceCaps(hdc, LOGPIXELSY);
163 ReleaseDC(NULL, hdc);
164
165 m_pParent->m_width = MAP_LOGHIM_TO_PIX(psizel->cx, ppiX);
166 m_pParent->m_height = MAP_LOGHIM_TO_PIX(psizel->cy, ppiY);
167
168 if (m_pParent->m_innerHwnd) {
169 SetWindowPos(
170 m_pParent->m_innerHwnd, NULL,
171 0, 0,
172 m_pParent->m_width, m_pParent->m_height,
173 SWP_NOZORDER | SWP_NOACTIVATE
174 );
175 }
176
177 return S_OK;
178}
179
180STDMETHODIMP CProgressBarControl_IOleObject::DoVerb(LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) {
181 switch (iVerb) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected