Tag Archives: Update Progress Bar

Show,Update,End Progress Bar of Max SDK With C#

Show,Update,End Progress Bar of Max SDK With C#

public uint ProgressBarFunc(ref IntPtr ppContext)
{
	return 0;
}
delegate uint ProgressBarDelegate(ref IntPtr ppContext);

public void ShowProgressBar()
{
        //yourInterface is IInterface of Max SDK ,You can take pointer on BeginEditParams from UtilityObj
	ProgressBarDelegate progressBarDelegate = new ProgressBarDelegate(ProgressBarFunc);
	IntPtr progressBarFunc = Marshal.GetFunctionPointerForDelegate(progressBarDelegate);
	yourInterface.ProgressStart("Progress Started", false, progressBarFunc, IntPtr.Zero); 
        //If false parametre is true ,cancel btn of progress bar will be show.
	yourInterface .ProgressUpdate(0, false, "Progress Update");
	yourInterface .ProgressEnd();
}