コード例 #1
0
ファイル: main.cpp プロジェクト: kolyden/mirror
void Benchmark(int n)
{
    T o;
    for(int i = 0; i < n; i++)
        o.Add(AsString(i));
    String h = "0";
    TimeStop tm;
    for(int i = 0; i < 100; i++) {
        for(int j = 0; j < 10000; j++)
            o.Insert(0, h);
        o.Remove(0, 10000);
    }
    RLOG(n << ": " << tm.Elapsed() << " ms");
}
コード例 #2
0
ファイル: GdbCmd.cpp プロジェクト: AbdelghaniDr/mirror
String Gdb::FastCmd(const char *command)
{
	if(!dbg || !dbg->IsRunning() || IdeIsDebugLock()) return Null;
	bool lock = false;
	if(command) {
		LLOG("FastCmd: " << command);
		dbg->Write(String(command) + "\n");
		PutVerbose(command);
	}
	String result;
	TimeStop ts;
	while(dbg) {
		String s;
		if(TTYQuit())
			Stop();
		if(!dbg->Read(s)) {
			LLOG(result);
			PutVerbose(result);
			PutVerbose("dbg terminated");
			break;
		}
		if(!s.IsEmpty() && Result(result, s)) {
			LLOG(result);
			LLOG("Result length: " << result.GetLength());
			if(result.GetLength() < 1000)
				PutVerbose(result);
			break;
		}
		if(s.GetCount() == 0)
			Sleep(0);
		if(ts.Elapsed() > 500) {
			if(!lock) {
				lock = true;
				Lock();
			}
			Ctrl::ProcessEvents();
		}
	}
	if(lock)
		Unlock();
#ifdef _DEBUG
	if(command)
		LLOG("Fast cmd Time of `" << command <<"` " << ts);
#endif
	return result;
}
コード例 #3
0
ファイル: RasterPlayer.cpp プロジェクト: AbdelghaniDr/mirror
void RasterPlayerThread(RasterPlayer *animatedClip) {
	TimeStop t;
	dword tFrame = 0;
	while (!animatedClip->IsKilled()) {
		INTERLOCKED_(mutex) {
			int ind = animatedClip->ind + 1;
			if (ind > animatedClip->GetPageCount() - 1)
				ind = 0;
			tFrame += dword(animatedClip->delays[ind]/animatedClip->speed);
		}
		while (t.Elapsed() < tFrame && !animatedClip->IsKilled())
			Sleep(10);
		PostCallback(callback(animatedClip, &RasterPlayer::NextFrame));
	}
INTERLOCKED_(mutex) {
	animatedClip->running = false;
}
}
コード例 #4
0
ファイル: Threads.cpp プロジェクト: dreamsxin/ultimatepp
void Threads::Process(const FractalJobHandeler & job)
{
	ProgressInfo statTotal(statusBar);

	rows = inp_row.GetData();
	cols = inp_col.GetData();
	densityR = picbox.GetSize().cy / rows;
	densityC = picbox.GetSize().cx / cols;
	maxIter = inp_iter.GetData();
	logmax= log10((double)maxIter);
	max_threads = inp_threads.GetData();
	
	statTotal.Set(0,rows*cols);
	
	TimeStop startTime;
	
	for (int r = 0; r < rows; r++){
		for (int c = 0; c < cols; c++)
		{
			while(threads >= max_threads)
				waitforfinish.Wait();
			
			AtomicInc(threads);
			Thread().Run(callback4(this, &Threads::ThreadRenderJob, r, c, job, 0));
			
			INTERLOCKED_(job_lock)
				active.Add((r * cols + c), 0);
			
			statTotal.Text(Format("Invoking calculations for sector R:%02d  C:%02d",r,c));
			time.Set(FormatTS(startTime.Elapsed()));
			picbox.Refresh();
			statTotal.Set(r * cols + c,rows*cols);
			ProcessEvents();
		}
	}
	
	while(threads > 0)
		waitforfinish.Wait();

	time.Set(FormatTS(startTime.Elapsed()));
	picbox.Refresh();
}
コード例 #5
0
ファイル: main.cpp プロジェクト: ultimatepp/mirror
void MouseKeyboard::OnButKey() {
	String fileTest = AppendFileName(GetDesktopFolder(), "test.txt");
	SaveFile(fileTest, "Please wait a second...");
	LaunchFile(fileTest);
	{
		TimeStop t;
		uint64 windowId;
		while(INT64_MAX == (windowId = GetWindowIdFromCaption("test.txt", false))) {
			if (t.Elapsed() > 10000)
				break;
		}
		if (windowId != -1) {
			Sleep(1000);
			Mouse_SetPos(200, 200, windowId);			
			Mouse_LeftClick();
    		Keyb_SendKeys("{HOME}This text is added by Keyb_SendKeys.\n");
    		Keyb_SendKeys("Some chars just for test: \\/:;,.ºª^[]{}´?¿~#@!¡\n");
    		Keyb_SendKeys("These are accented: äáéíóúñÄÁÉÍÓÚÑ\n");
    		//Keyb_SendKeys("And these are not latin at all: 雅言 한국말 韓國말 조선어 朝鮮語\n");
    		Keyb_SendKeys("And these are not latin at all: 韓于页\n");
		}
	}
}
コード例 #6
0
ファイル: ScatterCtrl.cpp プロジェクト: andreincx/upp-mirror
void ScatterCtrl::Paint(Draw& w)
{
    GuiLock __;
    if (IsNull(highlight_0) && highlighting) {
        highlighting = false;
        KillTimeCallback();
    }
    if (!IsNull(highlight_0) && !highlighting) {
        highlighting = true;
        SetTimeCallback(-200, THISBACK(TimerCallback));
    }
    TimeStop t;
    lastRefresh0_ms = GetTickCount();
    if (IsEnabled()) {
        if (mode == MD_DRAW) {
            ScatterCtrl::SetDrawing(w, GetSize(), 1);
            PlotTexts(w, GetSize(), 1);
        } else {
            ImageBuffer ib(GetSize());
            BufferPainter bp(ib, mode);
            ScatterCtrl::SetDrawing(bp, GetSize(), 1);
            w.DrawImage(0, 0, ib);
            PlotTexts(w, GetSize(), 1);
        }
        if (HasFocus()) {
            w.DrawLine(0, 0, GetSize().cx, 0, 2, LtGray());
            w.DrawLine(0, 0, 0, GetSize().cy, 2, LtGray());
            int delta = -2;
#ifdef PLATFORM_WIN32
            delta = 0;
#endif
            w.DrawLine(GetSize().cx+delta, 0, GetSize().cx+delta, GetSize().cy, 2, LtGray());
            w.DrawLine(0, GetSize().cy+delta, GetSize().cx, GetSize().cy+delta, 2, LtGray());
        }
    }
    lastRefresh_ms = t.Elapsed();
}
コード例 #7
0
ファイル: Debug.cpp プロジェクト: Sly14/upp-mirror
bool Pdb::RunToException()
{
	DR_LOG("RunToException");
	LLOG("RUN TO EXCEPTION");
	TimeStop ts;
	bool disasfocus = disas.HasFocus();
	bool locked = false;
	bool frestored = false;
	invalidpage.Clear();
	mempage.Clear();
	int opn = 0;
	for(;;) {
		if(terminated) {
			if(locked)
				Unlock();
			return false;
		}
		opn++;
		DR_LOG("WaitForDebugEvent");
		if(WaitForDebugEvent(&event, 0)) {
			DR_LOG("WaitForDebugEvent ended");
			debug_threadid = event.dwThreadId;
			opn = 0;
			running = false;
			switch(event.dwDebugEventCode) {
			case EXCEPTION_DEBUG_EVENT: {
				DR_LOG("EXCEPTION_DEBUG_EVENT");
				LLOG("Exception: " << FormatIntHex(event.u.Exception.ExceptionRecord.ExceptionCode) <<
				     " at: " << FormatIntHex(event.u.Exception.ExceptionRecord.ExceptionAddress) <<
				     " first: " << event.u.Exception.dwFirstChance);
				SaveForeground();
				const EXCEPTION_RECORD& x = event.u.Exception.ExceptionRecord;
				if(findarg(x.ExceptionCode, EXCEPTION_BREAKPOINT, EXCEPTION_SINGLE_STEP,
				                            STATUS_WX86_BREAKPOINT, STATUS_WX86_SINGLE_STEP) < 0)
				{
					LLOG("Non-debug EXCEPTION");
					if(event.u.Exception.dwFirstChance) {
						LLOG("First chance " << FormatIntHex(x.ExceptionCode));
						break;
					}
					String desc = Format("Exception: [* %lX] at [* %16llX]&",
					                     (int64)x.ExceptionCode, (int64)x.ExceptionAddress);
					for(int i = 0; i < __countof(ex_desc); i++)
						if(ex_desc[i].code == x.ExceptionCode)
							desc << "[* " << DeQtf(ex_desc[i].text) << "]&";
					if(x.ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
						desc << (x.ExceptionInformation[0] ? "[*@3 writing]" : "[*@4 reading]");
						desc << Format(" at [* %08llX]", (int64)x.ExceptionInformation[1]);
					}
					ToForeground();
					PromptOK(desc);
				}
#ifdef CPU_64
				if(!win64 && x.ExceptionCode == EXCEPTION_BREAKPOINT && !break_running) // Ignore x64 breakpoint in wow64
					break;
#endif
				if(break_running)
					debug_threadid = mainThreadId;
				break_running = false;
				ToForeground();
				if(disasfocus)
					disas.SetFocus();
				if(locked)
					Unlock();
				if(refreshmodules)
					LoadModuleInfo();
				LLOG("event.dwThreadId = " << event.dwThreadId);
				bool isbreakpoint = findarg(x.ExceptionCode, EXCEPTION_BREAKPOINT, STATUS_WX86_BREAKPOINT) >= 0;
				for(int i = 0; i < threads.GetCount(); i++) {
					Thread& t = threads[i];
					(Context&)t = ReadContext(threads[i].hThread);
					if(event.dwThreadId == threads.GetKey(i)) {
						LLOG("Setting current context");
						if(isbreakpoint
#ifdef CPU_64
						   && bp_set.Find((win64 ? t.context64.Rip : t.context32.Eip) - 1) >= 0
#else
						   && bp_set.Find(t.context32.Eip - 1) >= 0
#endif
						) // We have stopped at breakpoint, need to move address back
					#ifdef CPU_64
							if(win64)
								t.context64.Rip--;
							else
					#endif
								t.context32.Eip--;
						context = t;
					}
				}
				RemoveBp();
				return true;
			}
			case CREATE_THREAD_DEBUG_EVENT:
				DR_LOG("CREATE_THREAD_DEBUG_EVENT");
				LLOG("Create thread: " << event.dwThreadId);
				AddThread(event.dwThreadId, event.u.CreateThread.hThread);
				break;
			case EXIT_THREAD_DEBUG_EVENT:
				DR_LOG("EXIT_THREAD_DEBUG_EVENT");
				LLOG("Exit thread: " << event.dwThreadId);
				RemoveThread(event.dwThreadId);
				break;
			case CREATE_PROCESS_DEBUG_EVENT:
				DR_LOG("CREATE_PROCESS_DEBUG_EVENT");
				LLOG("Create process: " << event.dwProcessId);
				processid = event.dwProcessId;
				AddThread(event.dwThreadId, event.u.CreateProcessInfo.hThread);
				CloseHandle(event.u.CreateProcessInfo.hFile);
				CloseHandle(event.u.CreateProcessInfo.hProcess);
				break;
			case EXIT_PROCESS_DEBUG_EVENT:
				DR_LOG("EXIT_PROCESS_DEBUG_EVENT");
				LLOG("Exit process: " << event.dwProcessId);
				if(locked)
					Unlock();
				terminated = true;
				return false;
			case LOAD_DLL_DEBUG_EVENT: {
				DR_LOG("LOAD_DLL_DEBUG_EVENT");
				LLOG("Load dll: " << event.u.LoadDll.lpBaseOfDll);
				CloseHandle(event.u.LoadDll.hFile);
				refreshmodules = true;
				break;
			}
			case UNLOAD_DLL_DEBUG_EVENT:
				DR_LOG("UNLOAD_DLL_DEBUG_EVENT");
				LLOG("UnLoad dll: " << event.u.UnloadDll.lpBaseOfDll);
				refreshmodules = true;
				break;
			case RIP_EVENT:
				DR_LOG("RIP_EVENT");
				LLOG("RIP!");
				Exclamation("Process being debugged died unexpectedly!");
				terminated = true;
				if(locked)
					Unlock();
				return false;
			}
			DR_LOG("ContinueDebugEvent");
			ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_EXCEPTION_NOT_HANDLED);
			running = true;
		}
		if(ts.Elapsed() > 200) {
			DR_LOG("ts.Elpsed() > 200");
			if(!lock) {
				Lock();
				locked = true;
			}
			if(!frestored) {
				RestoreForeground();
				frestored = true;
			}
		}
		if(lock) {
			DR_LOG("GuiSleep");
			GuiSleep(opn < 1000 ? 0 : 100);
			Ctrl::ProcessEvents();
		}
		else {
			DR_LOG("Sleep");
			Sleep(opn < 1000 ? 0 : 100);
		}
	}
}
コード例 #8
0
ファイル: main.cpp プロジェクト: AbdelghaniDr/mirror
void Test()
{
	Puts("SysInfo functions demo");
	
	Puts("\nSpecial folders");
	Puts(Format("Desktop:          %s", GetDesktopFolder()));
	Puts(Format("Programs:         %s", GetProgramsFolder()));
	Puts(Format("Application Data: %s", GetAppDataFolder()));
	Puts(Format("Music:            %s", GetMusicFolder()));
	Puts(Format("Pictures:         %s", GetPicturesFolder()));
	Puts(Format("Video:            %s", GetVideoFolder()));
	Puts(Format("Personal:         %s", GetPersonalFolder()));
	Puts(Format("Templates:        %s", GetTemplatesFolder()));
	Puts(Format("Download:         %s", GetDownloadFolder()));
//	Puts(Format("Root:             %s", GetRootFolder()));
	Puts(Format("Temp:             %s", GetTempFolder()));
	Puts(Format("Os:               %s", GetOsFolder()));
	Puts(Format("System:           %s", GetSystemFolder()));
	
	Puts("\nNetwork info");
	String nname, domain, ip4, ip6;
	if (GetNetworkInfo(nname, domain, ip4, ip6))
		Puts(Format("Name '%s', Domain '%s', IP4 '%s', IP6 '%s'", nname, domain, ip4, ip6));
	else
		Puts("Problem reading newtwork data");
	
	Puts("\nNetwork adapter info");
	Array <NetAdapter> netAdapters = GetAdapterInfo();
	for (int i = 0; i < netAdapters.GetCount(); ++i) 
		Puts(Format("- %s %s %s\n  %s\n  IP4: %s IP6: %s", netAdapters[i].type, 
						netAdapters[i].mac, netAdapters[i].fullname, 
						netAdapters[i].description, netAdapters[i].ip4, netAdapters[i].ip6));
	
	Puts(Format("\nFirst free available socket port from 49152 is %d", GetAvailableSocketPort(49152)));
	
	Puts("\nSystem info:");		
	String manufacturer, productName, version, mbSerial;
	Date releaseDate;
	int numberOfProcessors;
	GetSystemInfo(manufacturer, productName, version, numberOfProcessors, mbSerial);
	Puts(Format("System manufacturer '%s', product name '%s',\n version '%s', number of processors: %d"
		", motherboard serial: '%s'", manufacturer, productName, version, numberOfProcessors, mbSerial));
 	
 	Puts(Format("Real CPU Speed: %.3f GHz", GetCpuSpeed()/1000.));
 	
 	Puts("\nBattery info");
 	bool present;
 	//int designCapacity,lastFullCapacity;
	//String batVendor, type, model, serial;
	if (!GetBatteryInfo(present/*, designCapacity, lastFullCapacity, batVendor, type, model, serial*/))
		Puts("There is no battery");
	else {
		//Puts(Format("Vendor: %s, Type: %s, Model: %s, Serial: %s", batVendor, type, model, serial));
		//Puts(Format("Design capacity: %d mAh, Last full capacity: %d mAh", designCapacity, lastFullCapacity));
		if (!present)
			Puts("Battery not installed");
		else {
 			bool discharging;
 			int percentage, remainingMin;
 			GetBatteryStatus(discharging, percentage, remainingMin); 
			Puts(Format("Working with battery: %s, Percentage: %d%%, Remaining: %d min", discharging ? "yes": "no", percentage, remainingMin));
		}
	}
 	String biosVersion, biosSerial;
 	Date biosReleaseDate;
	GetBiosInfo(biosVersion, biosReleaseDate, biosSerial);
	Puts(Format("\nBios version '%s',\n release date '%s', serial: '%s'", biosVersion, AsString(biosReleaseDate), biosSerial));
	String vendor, identifier, architecture; 
	int speed;
	for (int i = 0; i < numberOfProcessors; ++i) {
		GetProcessorInfo(i, vendor, identifier, architecture, speed);		
		Puts(Format("\nProcessor #%d: Vendor '%s',\n identifier '%s',\n architecture '%s', speed %d MHz", i, vendor, identifier, architecture, speed));	
	}
	Puts("\nPress enter to continue...");	TestGetchar();
	
	Puts("\nMemory info:");	
	int memoryLoad;
	uint64 totalPhys, freePhys, totalPageFile, freePageFile, totalVirtual, freeVirtual;
	if (!GetMemoryInfo(memoryLoad, totalPhys, freePhys, totalPageFile, freePageFile, totalVirtual, freeVirtual))
		Puts("Impossible to get memory information");
	else {
		Puts(Format("Percent of memory in use: %d%c", memoryLoad, '%'));
		Puts(Format("Total physical memory:    %s bytes (%s)", Format64(totalPhys), BytesToString(totalPhys)));
		Puts(Format("Free physical memory:     %s bytes (%s)", Format64(freePhys), BytesToString(freePhys)));	
		Puts(Format("Total paging file:        %s bytes (%s)", Format64(totalPageFile), BytesToString(totalPageFile)));	
		Puts(Format("Free paging file:         %s bytes (%s)", Format64(freePageFile), BytesToString(freePageFile)));	
		Puts(Format("Total virtual memory:     %s bytes (%s)", Format64(totalVirtual), BytesToString(totalVirtual)));	
		Puts(Format("Free virtual memory:      %s bytes (%s)", Format64(freeVirtual), BytesToString(freeVirtual)));
	}
	Puts("\nOs info:");
	String kernel, kerVersion, kerArchitecture, distro, distVersion, desktop, deskVersion;
	if (!GetOsInfo(kernel, kerVersion, kerArchitecture, distro, distVersion, desktop, deskVersion))
		Puts("Error getting Os info");
	else { 	
		Puts(Format("Kernel:  %s, version: %s,\n architecture: %s", kernel, kerVersion, kerArchitecture));
		Puts(Format("Distro:  %s, version: %s", distro, distVersion, desktop, deskVersion));
		Puts(Format("Desktop: %s, version: %s", desktop, deskVersion));
	}
	String compiler, mode;
	Time tim;
	int compilerVersion, bits;
	GetCompilerInfo(compiler, compilerVersion, tim, mode, bits);
	Puts(Format("\nProgram compiled with %s version %d. Compilation date: %s. Mode: %s. Bits: %d", compiler, compilerVersion, Format(tim), mode, bits));
	
	Puts("\nDefault exes info:");
	const char *ext[] = {".html", ".doc", ".png", ".pdf", ".txt", ".xyz", ""};
	for (int i = 0; *ext[i] != 0; ++i) 
		Puts(Format("Default program for '%s' is '%s'", ext[i], GetExtExecutable(ext[i])));
	
	Puts("\nPress enter to continue...");	TestGetchar();
	
	Puts("\nDrives list:");
	Vector<String> drives;
	drives = GetDriveList();
	for (int i = 0; i < drives.GetCount(); ++i) {
		Puts(Format("Drive path:'%s'", drives[i]));
		String type, volume, fileSystem;
		//uint64 serial;
		int maxName;
		bool mounted = GetDriveInformation(drives[i], type, volume, /*serial,*/ maxName, fileSystem);
		if (mounted) {
			Puts(Format(" Type: '%s', Volume: '%s', "/*Serial: %0n,*/"\n MaxName: %d, File System: %s", type, volume, /*serial, */maxName, fileSystem));
			uint64 freeBytesUser, totalBytesUser, totalFreeBytes;
			if(!GetDriveSpace(drives[i], freeBytesUser, totalBytesUser, totalFreeBytes))
				Puts(" Mounted but no access to drive");
			else {
				Puts(Format(" Free Bytes User:  %s (%s)", Format64(freeBytesUser), BytesToString(freeBytesUser)));
				Puts(Format(" Total Bytes User: %s (%s), Total Free Bytes: %s (%s)", Format64(totalBytesUser), BytesToString(totalBytesUser), Format64(totalFreeBytes), BytesToString(totalFreeBytes)));
			}
		} else
			Puts (" Not mounted");
	}
	Puts("\nOther Info:");
	int64 id = GetProcessId();
	Puts(Sprintf("Process Id:          %ld", id));
	Puts(Format("Process name:        '%s'", GetProcessName(id)));
	Puts(Format("Process file name:   '%s'", GetProcessFileName(id)));
	int priority = GetProcessPriority(id);
	Puts(Format("Process priority is: %s", priority >= 0? AsString(priority): "Not accesible"));
	Puts(Format("Now changed to high priority: %s", SetProcessPriority(id, 8)? "Yes": "No"));
	priority = GetProcessPriority(id);
	Puts(Format("Process priority is: %s", priority >= 0? AsString(priority): "Not accesible"));

	Window_SaveCapture(0, AppendFileName(GetDesktopFolder(), "Desktop")); 
	Puts ("Screenshot saved in " + AppendFileName(GetDesktopFolder(), "Desktop"));
	
	Puts("\nLaunch file 'test.txt':");
	String fileTest = AppendFileName(GetTempFolder(), "test.txt");
	String strTest = "\nIf modify 'test.txt' it will ask you to save or not the file" 
					 "\nIf you answer Yes or No the program will be terminated" 
					 "\nIf you answer Cancel or wait more than 2 seconds the program will be killed" 
					 "\nClick enter in the command window to continue";
	SaveFile(fileTest, "This is a test" + strTest);
	Puts(strTest);
	
	LaunchFile(fileTest);
	{
		TimeStop t;
		int64 windowId;
		while(-1 == (windowId = GetWindowIdFromCaption("test.txt", false))) {
			if (t.Elapsed() > 10000)
				break;
		}
		if (windowId != -1) {
			Sleep(1000);
			long left, top, right, bottom;
			Window_GetRect(windowId, left, top, right, bottom);	
			Puts(Format("Editor window is located at %d, %d, %d, %d", (int)left, (int)top, (int)right, (int)bottom));
			Puts("Editor window id is " + Format64(windowId)); 
			            
			long x, y;
			Mouse_GetPos(x, y);
			Puts(Format("Mouse pos is %d, %d", (int)x, (int)y));
			Mouse_SetPos(200, 200, windowId);

#if defined(PLATFORM_WIN32) || !defined(flagNO_XTEST)	
			Mouse_LeftClick();
    		Keyb_SendKeys("{HOME}This text is added by Keyb_SendKeys.\n");
    		Keyb_SendKeys("And the window resized and moved by Window_SetRect.\n", 0, 0);
    		Keyb_SendKeys("And a window capture in c:\\Windowgrab.bmp.\n", 0, 0);
    		Keyb_SendKeys("Some chars just for test: \\/:;,.ºª^[]{}´?¿~#@!¡\n", 0, 0);  		
#endif
#if defined(PLATFORM_WIN32)			
    		Window_SetRect(windowId, 10, 10, 800, 400);
#endif    	
    		Window_SaveCapture(windowId, AppendFileName(GetDesktopFolder(), "Windowgrab"));
		}
	}
	Puts("\nPress enter to terminate 'test.txt'");	TestGetchar();

	int64 processId;
	TimeStop t;
	while(-1 == (processId = GetProcessIdFromWindowCaption("test.txt", false))) {
		if (t.Elapsed() > 10000)
			break;
	}
	if (processId == -1) 
		Puts("Window was closed before!");
	else {
		Puts("Ending process in max 2 seconds");
		if (!ProcessTerminate(processId, 2000)) 
			Puts("Impossible to end process");
		else
			Puts("Process terminated");
	}
	Puts("\nPress enter to continue...");	TestGetchar();
	
	Puts("\nWindows list:");
	Array<int64> widL, pidL;
	Array<String> name, fileName, caption;
	GetWindowsList(widL, pidL, name, fileName, caption);
	for (int i = 0; i < widL.GetCount(); ++i) {
		Puts(Format("Window hwnd: %6.f, processId: %6.f, Name: %s", (double)widL[i], (double)pidL[i], name[i]));
		Puts(Format(" File name: %s", fileName[i]));
		Puts(Format(" Window caption: '%s'", caption[i]));
		if ((i/20) > (i-1)/20) {
		    Puts("\nPress enter to continue with the next 20 windows...");	TestGetchar();
		}
	}
	Puts("\nPress enter to continue...");	TestGetchar();
	
	Puts("\nProcess list:");
	pidL.Clear(); 
	Array<String> pNames;
	if (!GetProcessList(pidL, pNames))
		Puts("Error getting process info");
	else {	
		for (int i = 0; i < pidL.GetCount(); ++i) {
			int priority = GetProcessPriority(pidL[i]);
			Puts(Format("Id %6.f: Priority: %s, Program: %s", (double)pidL[i], priority >= 0? AsString(priority): "Not accesible", pNames[i]));
		}
	}
	Puts("\nPress enter to end...");	TestGetchar();
}