繁体   English   中英

如何找到对话框窗口在桌面上的位置?

[英]How do I find the position of my Dialog Window on the desktop?

我正在寻找相对于“桌面窗口”相对于自身的“对话窗口”坐标?

以下两个都不满足我的需求。 刚从0,0开始

定义从0,0开始的Dialog窗口的尺寸

HWND hWnd = ::GetForegroundWindow();
::GetClientRect(hWnd, &rectWin);
c.Format("%d  %d  %d  %d", rectWin.top, rectWin.bottom, rectWin.left, rectWin.right);
MessageBox(c);

定义从0,0开始的Desktop窗口的尺寸

HWND hWnd = ::GetDesktopWindow();
::GetClientRect(hWnd, &rectWin);
c.Format("%d  %d  %d  %d", rectWin.top, rectWin.bottom, rectWin.left, rectWin.right);
MessageBox(c);

暂无
暂无

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

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