Task:
Notification that a (possibly) lengthy operation is taking place.
Activation:
Always activated
Parameters:
lParam points to a structure of type scLlMeterInfo:
_nSize: Size of the structure
_hWnd: Handle of the List & Label main window
_nTotal: Total count of objects
_nCurrent: Index of object currently being processed
_nJob: Job ID, tells you what LL is doing:
Value |
Meaning |
LL_METERJOB_SAVE |
saving the objects |
LL_METERJOB_LOAD |
loading the objects |
LL_METERJOB_CONSISTENCYCHECK |
internal consistency check |
Hints:
By using this callback, the host application can implement a wait dialog box. We suggest using this callback if the object count exceeds 200 objects to reduce unnecessary screen flickering. To get a percentage value, use MulDiv(100, _nCurrent, _nTotal).
Example:
// functions used here for a meter dialog must be replaced by
own functions
case LL_INFO_METER:
{
scLlMeterInfo* pMI =
(scLlMeterInfo*)lParam;
static HLLJOB hMeterJob =
0;
// is actual version?
if (pMI->_nSize ==
sizeof(scLlMeterInfo))
{
// do I have to do
something?
if (pMI->_nTotal >
0)
{
// get parent window
handle for Dialog
HWND
hWndParent = pMI->_hWnd ? pMI->_hWnd :
hwndMyFrame;
//
start:
if (pMI->_nCurrent
==
0)
{
// open
meter bar with
0%!
hMeterJob = WaitDlgStart(hWndParent, "wait a moment",
0);
}
else
{
//
end:
if
(pMI->_nCurrent == pMI->_nTotal)
{
// end meter
bar!
WaitDlgEnd(hMeterJob);
}
else
// somewhere in between 0 and
100
{
// set meter value to MulDiv(100, _nCurrent,
_nTotal)
WaitDlgSetText(hMeterJob, "still working...",
MulDiv(100, pMI->_nCurrent,
pMI->_nTotal));
}
}
}
}
}
break;