MCPcopy Create free account
hub / github.com/bruderstein/nppPluginManager / alignWith

Method alignWith

NppPlugin/src/StaticDialog.cpp:191–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point)
192{
193 RECT rc, rc2;
194 ::GetWindowRect(handle, &rc);
195
196 point.x = rc.left;
197 point.y = rc.top;
198
199 switch (pos)
200 {
201 case PosAlign::left:
202 {
203 ::GetWindowRect(handle2Align, &rc2);
204 point.x -= rc2.right - rc2.left;
205 break;
206 }
207 case PosAlign::right:
208 {
209 ::GetWindowRect(handle, &rc2);
210 point.x += rc2.right - rc2.left;
211 break;
212 }
213 case PosAlign::top:
214 {
215 ::GetWindowRect(handle2Align, &rc2);
216 point.y -= rc2.bottom - rc2.top;
217 break;
218 }
219 case PosAlign::bottom:
220 {
221 ::GetWindowRect(handle, &rc2);
222 point.y += rc2.bottom - rc2.top;
223 break;
224 }
225 }
226
227 ::ScreenToClient(_hSelf, &point);
228}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected