GetWindowRect获得窗口尺寸的问题

论坛 期权论坛 脚本     
匿名技术用户   2021-1-12 18:59   101   0

GetWindowRect函数获得的窗口尺寸应该是窗体相对于屏幕左上角的尺寸,也就是说获得的left和top值应该是大于0的。可是当在OnInitDialog中使用此函数时,获得的尺寸的left和top值始终是0,0。在MSDN上查阅了OnInitDialog,上面写道:This message is sent to the dialog box during the Create, CreateIndirect, or DoModal calls, which occur immediately before the dialog box is displayed.也就是说当调用该消息函数时窗体还未显示出来,此时使用GetWindowRect所获得的窗口的left,top值是不正确的。

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP