link1278 link1279 link1280 link1281 link1282 link1283 link1284 link1285 link1286 link1287 link1288 link1289 link1290 link1291 link1292 link1293 link1294 link1295 link1296 link1297 link1298 link1299 link1300 link1301 link1302 link1303 link1304 link1305 link1306 link1307 link1308 link1309 link1310 link1311 link1312 link1313 link1314 link1315 link1316 link1317 link1318 link1319 link1320 link1321 link1322 link1323 link1324 link1325 link1326 link1327 link1328 link1329 link1330 link1331 link1332 link1333 link1334 link1335 link1336 link1337 link1338 link1339 link1340 link1341 link1342 link1343 link1344 link1345 link1346 link1347 link1348 link1349 link1350 link1351 link1352 link1353 link1354 link1355 link1356 link1357 link1358 link1359 link1360 link1361 link1362 link1363 link1364 link1365 link1366 link1367 link1368 link1369 link1370 link1371 link1372 link1373 link1374 link1375 link1376 link1377 link1378 link1379 link1380 link1381 link1382 link1383 link1384 link1385 link1386 link1387 link1388 link1389 link1390 link1391 link1392 link1393 link1394 link1395 link1396 link1397 link1398 link1399 link1400 link1401 link1402 link1403 link1404 link1405 link1406 link1407 link1408 link1409 link1410 link1411 link1412 link1413 link1414 link1415 link1416 link1417 link1418 link1419

Главная страница | назад

Article #17035: MapDialogRect vs. GetWindowRect

 Question and Answer Database
FAQ2035C.txt MapDialogRect vs. GetWindowRect
Category :Windows API
Platform :All
Product :C++Builder ALL
I've loaded a dialog from a resource file, and i've used
MapDialogRect to calculate its screen position. The
coordinates returned by MapDiagRect, however, have no
apparent relationship to the coordinates returned by
GetWindowRect. Why?
There are actualy two problems inherent in what you are
trying to do. First off, GetWindowRect returns the rectangle
of the external bounding frame of the window --- which is to
say, the title bar and frame are within the rectangle ---
while MapDialogRect returns the rectangle for the client
area. (That can be demonstrated by calling GetClientRect on
the area and comparing its values to the values returned by
the two previous functions.)
The other problem is this: while GetWindowRect returns a
rectangle whose coordinates are screencoordinates, that is,
they are relative to the upper left hand corner of your
screen, MapDialogRect returns a rectangle whose coordinates
are relative to the client area of the parent window. Thus,
while the rectangles actually describe the same window, they
are applied to different coordinate schemes, and so look
different upoon inspection.
7/2/98 10:32:32 AM

Last Modified: 01-SEP-99