if (!bProgMsgInit) ProgressMsgInit();
xpicbProgress(const char* msg, PRInt32 val, PRInt32 max){	Boolean indeterminateFlag = false;	Rect	r;	Str255	installingStr, fileStr, ofStr;	char	*valStr, *maxStr;	GrafPtr oldPort;	GetPort(&oldPort);		if (gWPtr)	{		SetPort(gWPtr);		if (gControls->tw->progressBar)		{			if (max!=0 && !bMaxDiscovered)			{				SetControlData(gControls->tw->progressBar, kControlNoPart, kControlProgressBarIndeterminateTag,								sizeof(indeterminateFlag), (Ptr) &indeterminateFlag);				SetControlMaximum(gControls->tw->progressBar, max);				bMaxDiscovered = true;			}			else if (!bMaxDiscovered)			{				if (gWPtr)					IdleControls(gWPtr);				if (gControls->tw->xpiProgressMsg)				{						HLock((Handle)gControls->tw->xpiProgressMsg);					SetRect(&r, (*gControls->tw->xpiProgressMsg)->viewRect.left,								(*gControls->tw->xpiProgressMsg)->viewRect.top,								(*gControls->tw->xpiProgressMsg)->viewRect.right,								(*gControls->tw->xpiProgressMsg)->viewRect.bottom );					HUnlock((Handle)gControls->tw->xpiProgressMsg);					if (msg)					{						EraseRect(&r);						TESetText(msg, strlen(msg), gControls->tw->xpiProgressMsg);						TEUpdate(&r, gControls->tw->xpiProgressMsg);					}				}			}						if (bMaxDiscovered)			{				SetControlValue(gControls->tw->progressBar, val);								if (gControls->tw->xpiProgressMsg)				{					GetIndString(installingStr, rStringList, sInstalling);					GetIndString(fileStr, rStringList, sFileSp);					GetIndString(ofStr, rStringList, sSpOfSp);					HLock((Handle)gControls->tw->xpiProgressMsg);					SetRect(&r, (*gControls->tw->xpiProgressMsg)->viewRect.left,								(*gControls->tw->xpiProgressMsg)->viewRect.top,								(*gControls->tw->xpiProgressMsg)->viewRect.right,								(*gControls->tw->xpiProgressMsg)->viewRect.bottom );					HUnlock((Handle)gControls->tw->xpiProgressMsg);														valStr = ltoa(val);					maxStr = ltoa(max);									EraseRect(&r);					if (valStr && maxStr)					{						TESetText(&installingStr[1], installingStr[0], gControls->tw->xpiProgressMsg);						TEInsert(&fileStr[1], fileStr[0], gControls->tw->xpiProgressMsg);						TEInsert(valStr, strlen(valStr), gControls->tw->xpiProgressMsg);						TEInsert(&ofStr[1], ofStr[0], gControls->tw->xpiProgressMsg);						TEInsert(maxStr, strlen(maxStr), gControls->tw->xpiProgressMsg);						TEUpdate(&r, gControls->tw->xpiProgressMsg);					}										if (valStr)						free(valStr);					if (maxStr)						free(maxStr);				}			}		}	}		SetPort(oldPort);	return;}