최상단 광고

2012년 4월 9일 월요일

DeferWindowPos


여러개의 윈도우 위치(multiple-window-position)를 위한 메모리를 할당하고 구조체에 Handle을 리턴한다.
여러개의 윈도우를 재배치 할때는 화면의 껌뻑임을 줄이기 위해 DeferWindowPos 함수를 사용한다.

사용방법은 메모리를 할당 한 후 사용하고 해제한다.

1.BeginDeferWindowPos(메모리 할당)

HDWP BeginDeferWindowPos(
  int nNumWindows   // number of windows
);
여러개의 윈도우 위치(multiple-window-position)를 위한 메모리를 할당하고 구조체에 Handle을 리턴한다.


2.DeferWindowPos

HDWP DeferWindowPos(
  HDWP hWinPosInfo,      // handle to internal structure
  HWND hWnd,             // handle to window to position
  HWND hWndInsertAfter,  // placement-order handle
  int x,                 // horizontal position
  int y,                 // vertical position
  int cx,                // width
  int cy,                // height
  UINT uFlags            // window-positioning flags
);

열거된 여러개의 윈도우 위치(multiple-window-position)를 업데이트한다.
업데이트된 구조체의 핸들을 리턴한다.
hWinPosInfo : 한개이상의 윈도우에 대한 크기, 위치정보를 포함한 multiple-window-position 구조체 핸들
              이 구조체는 비공개 구조체로 BeginDeferWindowPos에 의해 리턴되거나 최근에 콜한 DeferWindowPos에 의해 리턴된다.
hWnd : handle to window to position
hWndInsertAfter : placement-order handle(SetWindowPos 참조)
x,y : 위치
cx, cy : 크기
uFlag : window-positioning flags(SetWindowPos 참조)

리턴값 : 업데이트된 구조체

3.EndDeferWindowPos(메모리 해제 및 변경)

BOOL EndDeferWindowPos(
  HDWP hWinPosInfo   // handle to internal structure
);
한번의 리플레쉬로 한개이상의 윈도우의 위치,사이즈를 동시에 변경한다.

댓글 없음: