Création d’une fonction de rappel d’état
L’exemple suivant est une fonction de rappel simple status. Inscrivez ce rappel à l’aide de la macro capSetCallbackOnStatus .
TCHAR gachAppName[] = TEXT("Application Name"); // Application name.
TCHAR gachBuffer[100]; // Global buffer.
// StatusCallbackProc: status callback function.
// hWnd: capture window handle.
// nID: status code for the current status.
// lpStatusText: status text string for the current status.
//
LRESULT PASCAL StatusCallbackProc(HWND hWnd, int nID,
LPTSTR lpStatusText)
{
if (!hWnd)
return FALSE;
if (nID == 0) {
// Clear old status messages.
SetWindowText(hWnd, gachAppName);
return (LRESULT) TRUE;
}
// Show the status ID and status text.
_stprintf_s(gachBuffer, TEXT("Status# %d: %s"), nID, lpStatusText);
SetWindowText(hWnd, gachBuffer);
return (LRESULT) TRUE;
}
Rubriques connexes
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour