如何保存窗口的坐标 [英] How do I save the coordinates of windows
问题描述
我正在使用VC ++使用MFC
有4个相关函数可以获取表格,对话框,控件的坐标...
1. GetWindowRect(rect);
2. ScreenToClient(rect);
3. GetClientRect(rect);
4. ClientToScreen(rect);
1,2,3,4中的每一个都有4个坐标,如rect.left,rect.top,rect .right,rect.bottom
我想在用户点击sw_restore按钮时恢复listctrl窗口(或任何窗口)。
问题:
1.首先我保存4个案例中的一个的4个坐标。
2.当OnSize()发生时是type = SIZE_RESTORED
MoveWindow(a,b,c,d);
什么是=?,b =?,c =?,d =?
谢谢。
我的尝试:
这个问题浪费了10多天。
I am using VC++ using MFC
There are 4 related functions to get the coordinates of form, dialog, control...
1. GetWindowRect(rect);
2. ScreenToClient(rect);
3. GetClientRect(rect);
4. ClientToScreen(rect);
Each of 1,2,3,4 have 4 coordinates like as rect.left, rect.top, rect.right, rect.bottom
I want to restore listctrl window (or any windows) when user click the sw_restore button.
Questions:
1. First I save the 4 coordinates of one of above 4 cases.
2. When in the event of OnSize() that is type = SIZE_RESTORED
MoveWindow(a,b,c,d);
What is a = ?, b =?, c=?, d=?
Thank you.
What I have tried:
More than 10 days wasted for this problems.
推荐答案
我已经回复了这个问题来自如何恢复窗口位置和大小? [ ^ 。请不要重新发布。
I already responded to this question at How do I restore window position and size?[^]. Please do not repost.
使用文档开始(一如既往): CWnd :: MoveWindow [ ^ ] - 它解释了函数参数......
Start (as always) with the documentation: CWnd::MoveWindow[^] - it explains the function parameters...
这篇关于如何保存窗口的坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!