AdjustWindowRect

AdjustWindowRect,AdjustWindowRectEx

VB声明

Declare Function AdjustWindowRect Lib "user32" Alias "AdjustWindowRect" (lpRect As RECT, ByVal dwStyle As Long, ByVal bMenu As Long) As Long

Declare Function AdjustWindowRectEx Lib "user32" Alias "AdjustWindowRectEx" (lpRect As RECT, ByVal dsStyle As Long, ByVal bMenu As Long, ByVal dwEsStyle As Long) As Long

说明

在给定一种窗口样式的前提下,计算获得目标客户区矩形所需的窗口大小

返回值

Long,如执行成功,则返回非零值;如失败,返回零值。会设置GetLastError

参数表

参数

类型及说明

lpRect

RECT,最初包含要求的客户区。由函数设为目标窗口矩形大小

dwStyle

Long,窗口样式

bMenu

Long,如窗口有菜单,则设为TRUE(非零)

dwEsStyle

Long,扩展窗口样式(只适用于AdjustWindowRectEx)

注解

在调用本函数前,先用GetWindowLong取得一个窗体的样式。如菜单占用两行以上的空间,则函数不能正确计算大小。如程序使用了多行标题,则应使用GetSystemMetrics

Top