2010년 2월 17일 수요일

화면좌표에 Windows 위치 설정

CRect Screen;
SystemParametersInfo(SPI_GETWORKAREA,0,&Screen,0);
Screen.NormalizeRect();
Scalex=Screen.Width();
Scaley=Screen.Height();

#2
CClientDC dc(AfxGetMainWnd());
int H, W;
H = GetDeviceCaps(dc, VERTRES);
W = GetDeviceCaps(dc, HORZRES);


#3
// WINDOWPLACEMENT structure
WINDOWPLACEMENT wp; // Get dialog window placement
AfxGetMainWnd()->GetWindowPlacement(&wp); // Increment bottom section of dialog
wp.rcNormalPosition.bottom += 100; // Set dialog's new window placement
AfxGetMainWnd()->SetWindowPlacement(&wp);


#4
CRgn crgn;
RECT r;
AfxGetMainWnd()->GetWindowRect(&r);
r.bottom = r.bottom*2; // souble the 'length' of the dialog
crgn.SetRectRgn(&r);
AfxGetMainWnd()->SetWindowRgn((HRGN)crgn, TRUE);

#5
RECT r;
AfxGetMainWnd()->GetWindowRect(&r);
r.bottom = r.bottom*2; // double the 'length' of the dialog
MoveWindow(&r);

출처 : Tong - 공원님의 ┣ ★ 먹고사는일(VC++)통

댓글 없음:

댓글 쓰기