INT_PTR DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_INITDIALOG: { FormationBhvr *formationBhvr = (FormationBhvr*)map->GetParamBlock()->GetOwner(); formationBhvr->InitDialog(hWnd); } break; case WM_DESTROY: { FormationBhvr *formationBhvr = (FormationBhvr*)map->GetParamBlock()->GetOwner(); ReleaseICustButton(formationBhvr->iMultPick); formationBhvr->iMultPick = NULL; } break; case WM_COMMAND: switch (LOWORD(wParam)) { //Select the formation that the delegates are currently in. case IDC_SETFORMATION: { FormationBhvr *formationBhvr = (FormationBhvr*)map->GetParamBlock()->GetOwner(); formationBhvr->SetFormation(t); } break; //Pick multiple followers case IDC_NAMESEL: { FormationBhvr *formationBhvr = (FormationBhvr*)map->GetParamBlock()->GetOwner(); formationBhvr->PickWhom(); formationBhvr->SetFollowerNodeText(); } break; } } return FALSE; }