0

I've tons of list controls on an mfc dialog, For some of these controls I named IDs that have same prefix. I see (NAME) attribute in the properties window that has the same name as the ID value. I wanted to extract the name of these list controls and perform certain operations based on prefix.

This is where I am stuck. I need a function like GetCntrlName that returns me those IDs as strings. Am I thinking correct?

HWND hwnd = ::GetTopWindow(this->GetSafeHwnd());
while(hwnd){
    UINT nID = ::GetDlgCtrlID(hwnd);
    //::GetCntrlName(hwnd, nID, buffer, bufferLength);

    hwnd = ::GetNextWindow(hwnd, GW_HWNDNEXT);
}
Prashant
  • 91
  • 3
  • 8
  • 3
    Windows doesn't keep a list of control names, those are all converted into numbers at compile time. – Mark Ransom Mar 10 '15 at 23:43
  • Try having a look at http://stackoverflow.com/questions/201593/is-there-a-simple-script-to-convert-c-enum-to-string to see if it solves your problem. – Mark Ransom Mar 10 '15 at 23:47

0 Answers0