BOOL CALLBACK DialogProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { switch( uMsg ) { case WM_INITDIALOG: { DWORD dwThreadId; int i; i = 0; for( i = 0; i < MAX_THREADS; i++ ) { CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc, pMem[i], 0, &dwThreadId ); } } SetTimer( hWnd, 100, 100, NULL ); return TRUE; case WM_TIMER: { BYTE byMsg[256]; sprintf( byMsg, WIDE("Thread: %d"), nThreads ); SetDlgItemText( hWnd, TXT_MESSAGE, byMsg ); if( !nThreads ) { DWORD dwThreadId; int i; DebugDumpMem(); nThreads = -1; /* i = 0; for( i = 0; i < MAX_THREADS; i++ ) { CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc, pMem[i], 0, &dwThreadId ); } Sleep(1); */ } // if( !nThreads ) // DebugDumpMemEx( TRUE ); } return TRUE; case WM_COMMAND: switch( LOWORD( wParam ) ) { case IDOK: case IDCANCEL: EndDialog( hWnd, 0 ); } break; case WM_DESTROY: return TRUE; } return FALSE; }
int CPROC MEMDUMP( PSENTIENT ps, PTEXT parameters ) { PTEXT pName; pName = GetParam( ps, ¶meters ); if( pName ) { DebugDumpMemFile( GetText( pName ) ); } else DebugDumpMem(); return FALSE; }
int main( void ) { CDATA result; result = Color(127,127,127); while( PickColorEx( &result, result, 0, 256, 150 ) ) { printf( WIDE("Guess what! We got a color: %08") _32fX WIDE("\n"), result ); { uint32_t free,used,chunks,freechunks; Sleep( 1000 );// wait a moment for the dialog to really go away. GetMemStats( &free, &used, &chunks, &freechunks ); printf( WIDE("Debug: used:%") _32f WIDE(" free:%") _32f WIDE(" chunks:%") _32f WIDE(" freechunks:%") _32f WIDE("\n") , used,free,chunks,freechunks ); DebugDumpMem(); } } printf( WIDE("Color Dialog was canceled.\n") ); return 0; }