LRESULT CounterOnInitDialog( IN HWND hWnd, IN UINT uMsg, IN WPARAM wp, IN LPARAM lp ) { PDIALOG_OBJECT Object; PCOUNTER_CONTEXT Context; PTREELIST_OBJECT TreeList; PMSP_DTL_OBJECT DtlObject; HWND hWndRect; HWND hWndDesktop; RECT Rect; TVINSERTSTRUCT tvi = {0}; ULONG Number; ULONG NumberOfGroups; Object = (PDIALOG_OBJECT)SdkGetObject(hWnd); Context = SdkGetContext(Object, COUNTER_CONTEXT); DtlObject = Context->DtlObject; hWndDesktop = GetDesktopWindow(); hWndRect = GetDlgItem(hWnd, IDC_TREE_RECT); GetWindowRect(hWndRect, &Rect); MapWindowRect(hWndDesktop, hWnd, &Rect); ShowWindow(hWndRect, SW_HIDE); TreeList = TreeListCreate(hWnd, TRUE, IDC_TREE_COUNTER, &Rect, hWnd, CounterFormatCallback, CounterColumnCount); Context->TreeList = TreeList; for(Number = 0; Number < CounterColumnCount; Number += 1) { TreeListInsertColumn(TreeList, Number, CounterColumn[Number].Align, CounterColumn[Number].Width, CounterColumn[Number].Name ); } SetWindowText(hWnd, L"Probe Summary"); SdkSetMainIcon(hWnd); NumberOfGroups = CounterInsertGroup(Object); if (!NumberOfGroups) { return TRUE; } if (DtlObject->Type != DTL_REPORT) { Context->TimerId = SetTimer(hWnd, COUNTER_TIMER_ID, 1000, NULL); } else { CounterUpdate(TreeList); } return TRUE; }
size_t IdeaCounterGenFill(IdeaGeneratorStatus status, uint64_t *buffer, size_t length) { if(length == 0 || buffer == NULL || status.privateData == NULL) return 0; InternalStatus *internalStatus = (InternalStatus *) status.privateData; size_t i; for(i=0; i<length; i++) { IterativeGenUpdateStatus(internalStatus); buffer[i] = CounterUpdate(internalStatus); } return i; }
LRESULT CounterOnTimer( IN HWND hWnd, IN UINT uMsg, IN WPARAM wp, IN LPARAM lp ) { PDIALOG_OBJECT Object; PCOUNTER_CONTEXT Context; PTREELIST_OBJECT TreeList; Object = (PDIALOG_OBJECT)SdkGetObject(hWnd); Context = SdkGetContext(Object, COUNTER_CONTEXT); TreeList = Context->TreeList; CounterUpdate(TreeList); return 0; }
uint64_t IdeaCounterGenInteger(IdeaGeneratorStatus status) { InternalStatus *internalStatus = (InternalStatus*) status.privateData; return CounterUpdate(internalStatus); }