4,564,803 th visitor since 2017.2.1 ( Today : 2 )
Programming
No. 194
Name. swindler
Subject. Button Caption 변경
Main Cate. Win32
Sub Cate.
Date. 2005-09-07 11:15
Hit. 9271 (211.109.70.164)
File.
Button Caption을 변경하는 법

CWnd* pB=GetDlgItem(ID_GEN_BUTTON);
pB->SetWindowText("Re-Text");



cf)
CScrollBar* pSB=(CScrollBar*) GetDlgItem(IDC_LOYAL);
pSB->SetScrollRange(nMin, nMax);


ID를 CWnd포인터로 변환해주는
CWnd::GetDlgItem();
-> 임시적인 포인터로 저장하지 않음.

CWnd pointer를 ControlID로 변환하려면
CWnd::GetDlgCtrlID(); 사용

SetWindowText(hwnd,lpszString);

Text얻기
iLength=GetWindowText(hwnd,pszBuffer,iMaxLength);
iLength=GetWindowTextLength(hwnd);

CWnd* GetDlgItem(int nID) const;
void CWnd::GetDlgItem(int nID, HWND * phWnd) const;


[바로가기 링크] : http://coolx.net/cboard/develop/194



tallboy MFC로만 한다면야 GetDlgItem 은 너무 번잡스럽다는 생각도
드네요..ㅋㅋ Class Wizard 로 변수로 정의하면 쉽게 할 수 있으니 말이죠...^^
2005-09-17
swindler 여기 댓글 지금봤다. 근데 봐바. 카테고리가 Win32 잖아. MFC가 아니라 ㅋㅋ 2007-02-20
Name
Password
Comment
Copyright © 1999-2017, swindler. All rights reserved. 367,611 visitor ( 1999.1.8-2004.5.26 ), 2,405,771 ( -2017.01.31)

  2HLAB   2HLAB_Blog   RedToolBox   Omil   Omil_Blog