I have researched the forum on dialog units. I have found
much info. But I cannot determine how to do one simple
(at least in concept) thing. Determine the precise
location of a dialog on the screen when I create it.
I am using a 1280x1024 pixels resolution, so I will base
my question these dimensions.
Suppose that I want to create a dialog with its left top
corner in the middle of the screen, that is at 640x512
pixels. The "Dialog New" statement requires that these
coordinates be specified in dialog units. However, the
"Dialog Pixels hDlg,... To Units ..." statement and the
"Dialog Units hDlg,... To Pixels ..." require that the
dialog handle, that is the dialog, exists before I can
convert pixels to dialog units. I want the correct dialog
units before the dialog exists so that I can precisely
position it when I create it.
I have worked with GetDialogBaseUnits() without success,
and Lance points out that the function does not
necessarily return the info needed to make the
conversions.
I have researched and tried many approaches and none
work.
How can I get the pixels in dialog units or the
dimensions of my desktop screen in dialog units, before I
create a dialog so that I can use the units with "Dialog
New". I need to be able to do this to be able to
precisely set the coordinates, in units, for a "Dialog
New" statement.
What have I missed? Or can someone tell me what I need to
do?
Thanks,
Terry
-------------
Terry
much info. But I cannot determine how to do one simple
(at least in concept) thing. Determine the precise
location of a dialog on the screen when I create it.
I am using a 1280x1024 pixels resolution, so I will base
my question these dimensions.
Suppose that I want to create a dialog with its left top
corner in the middle of the screen, that is at 640x512
pixels. The "Dialog New" statement requires that these
coordinates be specified in dialog units. However, the
"Dialog Pixels hDlg,... To Units ..." statement and the
"Dialog Units hDlg,... To Pixels ..." require that the
dialog handle, that is the dialog, exists before I can
convert pixels to dialog units. I want the correct dialog
units before the dialog exists so that I can precisely
position it when I create it.
I have worked with GetDialogBaseUnits() without success,
and Lance points out that the function does not
necessarily return the info needed to make the
conversions.
I have researched and tried many approaches and none
work.
How can I get the pixels in dialog units or the
dimensions of my desktop screen in dialog units, before I
create a dialog so that I can use the units with "Dialog
New". I need to be able to do this to be able to
precisely set the coordinates, in units, for a "Dialog
New" statement.
What have I missed? Or can someone tell me what I need to
do?
Thanks,
Terry
-------------
Terry
Comment