简体   繁体   English

窗户把手和窗户尺寸

[英]Window Handle and window dimension

The MFC application that i created is dialog based. 我创建的MFC应用程序是基于对话框的。 Just one dialog thats all. 仅一个对话框即可。 How do I get the window handle to this window, while the application is performing the InitDialog. 在应用程序执行InitDialog的同时,如何获取该窗口的窗口句柄。 I need to find out its dimension as well. 我还需要找出它的尺寸。 GetForegroundWindow not necessarily gives you the handle to this window that is loading up GetForegroundWindow不一定会为您提供正在加载的该窗口的句柄

Check the m_hWnd member of your dialog object. 检查对话框对象的m_hWnd成员。 GetClientRect() should work to give you the size of client (interior) of the dialog. GetClientRect()应该可以为您提供对话框的客户端(内部)大小。 GetWindowRect() will give you the total size including window borders, but the position will be off. GetWindowRect()将为您提供包括窗口边框在内的总大小,但该位置将关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM