Someone can explain me how to convert dialog box units to screen coordinates values ?
I saw that there is MapDialogRect function, but its converting RECT, i want to convert the x,y and cx,cy values to screen coordinate values and i dont really understand how to achieve this.
Thanks in advance.
If you already have a window handle, then just use the
MapDialogRectfunction. As others have noted,MapDialogRecttakes aRECT, so if you don’t have aRECT, you can create one.If your problem is that you don’t have a dialog box handle in the first place, then the documentation for the
MapDialogRectfunction tells you how to perform the calculations: Determine the the average character dimensions for the dialog box (which the documentation callsbaseunitXandbaseunitY) and then plug it into the formulas.Note that this calculates the client rectangle of the dialog box. You still have to add non-client space. It’s not clear what you’re trying to do, so I don’t know whether adding non-client space is appropriate or not.