网站首页  词典首页

请输入您要查询的函数:

 

术语 mapdialogrect
释义 MapDialogRect
语法:
BOOL MapDialogRect( HWND hDlg,
LPRECT lpRect
);
MapDialogRect函数
该MapDialogRect函数转换对话框中指定单位屏幕单位(像素)。替换函数在指定坐标的转换,这使得结构,可以用来创建一个对话框,在对话框或位置控制RECT结构坐标。
参数
hDlg
[in]句柄一个对话框。这个函数只接受处理的对话框的创建函数一回,对其他窗口句柄无效。
lpRect
[中,out]指向一个矩形结构,它包含对话框坐标转换。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
该MapDialogRect函数假定的RECT结构初步坐标代表对话框单位。要转换的对话框中,这些单位为像素坐标,函数检索当前的Level和垂直对话框的基本单位,然后应用下面的公式:
左= MulDiv(左,baseunitX,4);
右边= MulDiv(右,baseunitX,4);
顶部MulDiv(顶部,baseunitY,8);
底部MulDiv(底部,baseunitY,8);
如果对话框模板有DS_SETFONT或DS_SHELLFONT作风,基础单元的平均宽度和高度,以像素为单位的字符,由模板中指定的字体。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
对话框概述,GetDialogBaseUnits,RECT
==英文原文==MapDialogRect Function
The MapDialogRect function converts the specified dialog box units to screen units (pixels). The function replaces the coordinates in the specified RECT structure with the converted coordinates, which allows the structure to be used to create a dialog box or position a control within a dialog box.
Syntax
BOOL MapDialogRect( HWND hDlg,
LPRECT lpRect
);
Parameters
hDlg
[in] Handle to a dialog box. This function accepts only handles returned by one of the dialog box creation functions; handles for other windows are not valid.
lpRect
[in, out] Pointer to a RECT structure that contains the dialog box coordinates to be converted.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
The MapDialogRect function assumes that the initial coordinates in the RECT structure represent dialog box units. To convert these coordinates from dialog box units to pixels, the function retrieves the current horizontal and vertical base units for the dialog box, then applies the following formulas:

left = MulDiv(left, baseunitX, 4);
right = MulDiv(right, baseunitX, 4);
top = MulDiv(top, baseunitY, 8);
bottom = MulDiv(bottom, baseunitY, 8);
  
If the dialog box template has the DS_SETFONT or DS_SHELLFONT style, the base units are the average width and height, in pixels, of the characters in the font specified by the template.
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.
See Also
Dialog Boxes Overview , GetDialogBaseUnits , RECT
==原始网址==http://msdn.microsoft.com/en-us/library/ms645502(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 9:25:18