Glossary Item Box
This function allows an application to register a status callback function to be called during the processing of an image with the completed percentage of the filter process. The callbacks to your application do not start simply when the filter is invoked. They begin when the user selects the OK type option on the filter's user interface. If the filter has no user interface the callback will begin when the filter starts its processing of the image which will be immediately upon calling ImgPlugInInvoke in this case.
|
Parameter |
Type |
Description |
|
lpStatFn |
STATUSPROC |
The function to call during the filter process. |
|
lInterval |
LONG |
(not used) |
|
dwUser |
DWORD |
Any user information to be passed on to the status function. |
Example
// status function typedef
typedef int (WINAPI *STATUSPROC)(HANDLE,UINT,DWORD);
Return Value
This function returns IMG_OK if the host is available otherwise it returns IMG_ERR and ImgGetStatus will return IMGPI_UNAVAIL.
Comments
This function is almost identical in functionality to ImgSetDefaultStatusProc with the exception that the lInterval is not used. The actual plug-in modules call back to the a plug-in host with status messages when they see fit. The host has no control over the plug-ins'callback intervals.
You can turn off the status callbacks by calling this function with NULL as the value for lpStatFn.
Example
STATUSPROC ShowStatus(HANDLE hImage, int nPercent, DWORD dwUserInfo)
{
SetStatusBar( nPercent );
// Function to update your Status bar
return 1;
}
ImgPlugInSetStatusProc ( (STATUSPROC)ShowStatus, 0, 0 ) ;
int iErr = IMG_OK ;
// assume the host is already loaded.
if ( iErr == IMG_OK ) {
iErr = ImgPlugInLoadSpecific( somecool.8bf ) ;
if ( iErr == IMG_OK )
ImgPlugInInvoke( hImage, hWnd, rect ) ;
}
Copyright 2008 Data Techniques, Inc. All Rights Reserved