static INT_PTR MyDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_INITDIALOG: // add initialization code here return TRUE; case WM_COMMAND: // add command handling code here return TRUE; case WM_CLOSE: EndDialog(hWnd, 0); return TRUE; } return FALSE; } ... ParamBlockDesc2 pbDesc(...); pbDesc.SetUserDlgProc(&MyDlgProc);
class MyPBAccessor : public PBAccessor { public: virtual void Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t); virtual void Get(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t, Interval& valid); }; void MyPBAccessor::Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t) { // add set value code here } void MyPBAccessor::Get(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t, Interval& valid) { // add get value code here } ... ParamBlockDesc2 pbDesc(...); MyPBAccessor pbAccessor; pbDesc.SetUserDlgProc(&MyDlgProc); pbDesc.SetUserPropDesc(0, "My Parameter", TYPE_INT, pbAccessor);This example shows how to use the SetUserDlgProc function along with a user-defined parameter block accessor to define and use a custom dialog for a parameter block. The user-defined parameter accessor is used to get and set the parameter value when the user interacts with the custom dialog. Package library: Autodesk 3ds Max SDK.