2012-11-11 4 views
0

원격 데스크톱을 사용하여 Windows XP Professional SP3 및 한 화면이있는 랩톱에서 두 대의 모니터가있는 Windows 7 Professional이 실행되는 원격 PC에 연결합니다.원격 데스크톱 세션 후 창 크기/위치가 변경됨

노트북 해상도는 약 1024x768이며 원격 PC의 각 모니터는 약 1600x900입니다.

원격 데스크톱 세션을 시작하기 전에 Windows 7 PC의 두 번째 모니터에있는 모든 창을 첫 번째 모니터로 이동합니다. (랩톱과 PC는 모두 같은 사무실 영역에 있습니다.)

원격 데스크톱 세션이 작동하지만 랩톱에서 세션을 닫고 원격 Windows 7 PC에서 작업을 마치면 일반적으로 많은 위치를 재조정하고 크기를 조정해야합니다 창의 원래 배열로 돌아갈 수 있습니다.

현재 구성에서는 위의 "재배치 및 크기 조정"단계를 피할 수 있습니까?

랩톱에 Windows 7 Professional이있는 경우이 문제를 해결하는 데 도움이됩니까?

답변

0

아마도 이것을 수퍼 유저로 옮겨야 할 것입니다.하지만 StackOverflow에 대해 질문 했으므로 설명하는대로 프로그램을 구현할 수 있습니다. 의사에서

:

EnumWindows, SetWindowPosGetWindowRect 모든 Win32 함수가
class WindowPosition { 
    IntPtr hWnd; 
    RECT Location; 
} 

List<WindowPosition> positions = null; 

void OnCaptureWindowPositionHotkey() { 
    positions = new List<WindowPosition>(); 
    EnumWindows(enumStoreWindows, null); 
} 

void OnResetWindowPositionHotkey() { 
    EnumWindows(enumStoreWindows, null); 
} 

void enumSetWindows(IntPtr hwnd, IntPtr obj) { 
    positions.Add(new WindowPosition() { 
     hWnd = hwnd, 
     Location = GetWndLocation(hwnd) 
    }; 
} 

RECT GetWndLocation(IntPtr hwnd) { 
    RECT outrect = null; 
    GetWindowRect(hwnd, out outrect); 
    return outrect; 
} 

void enumSetWindows(IntPtr hwnd, IntPtr obj) { 
    var loc = (from wl in positions 
       where wl.hWnd == hwnd 
       select wl).FirstOrDefault(); 
    if (loc == null) return; 
    SetWindowPos(hwnd, null, 
     loc.Location.X, 
     loc.Location.Y, 
     loc.Location.Width, 
     loc.Location.Height, 
     0); 
} 

. 참조 : http://msdn.microsoft.com/en-us/library/windows/desktop/ms633497(v=vs.85).aspx, http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspxhttp://msdn.microsoft.com/en-us/library/windows/desktop/ms633519(v=vs.85).aspx.