Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Contoh berikut adalah fungsi panggilan balik status sederhana. Daftarkan panggilan balik ini dengan menggunakan makro 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;
}
Topik terkait