创建状态回调函数
以下示例是一个简单的状态回调函数。 使用 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;
}
相关主题
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈