VC遍歴フォームコントロールの実装
3665 ワード
フォームを巡回するすべてのコントロールコードは次のとおりです.
buttonのようなクラスだけを手に入れたいなら.コードは次のとおりです.
原文住所:http://blog.csdn.net/guanchanghui/article/details/1491715
CWnd* pwndChild = GetWindow(GW_CHILD);
while (pwndChild)
{
//....to do something
pwndChild = pwndChild->GetNextWindow();
}
buttonのようなクラスだけを手に入れたいなら.コードは次のとおりです.
// Button ,
CWnd* pWnd = GetWindow(GW_CHILD);
char cClassName[255]={0};
while(pWnd)
{
// , Edit,Button,Static
GetClassName(pWnd->GetSafeHwnd(),cClassName,255);
if(strcmp(cClassName,"Button") ==0) // Button
{
CXTButton *pBtn = (CXTButton*) pWnd;
pBtn->SetXButtonStyle(BS_XT_XPFLAT);
pBtn->SetColorFace(BUTTON_BKCOLOR); //
}
pWnd = pWnd->GetWindow(GW_HWNDNEXT);
}
原文住所:http://blog.csdn.net/guanchanghui/article/details/1491715