To be honest. I've got dome flash games which I'd like to slow down :o)
Main Topics
Browse All TopicsHi all,
I am looking for a way to slow down my pc.
Anyone have any example code of how to do this please?
Thanks
St3vo
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I think I would try installing a virtual machine. On a virtual machine you can set how much memory it has access to, etc. Once it is running in a virtual OS under Windows, you can find the process it is running under and lower it's priority. This would at least give you more options to play with in the process of slowing it down. As a side benefit, any other flash games you want to play could be run in the same environment, and anything running in the main OS would still be able to operate at near normal speeds (minus the memory, processor time, etc for the virtual machine).
Just a thought.
ST3V0,
I have not tried this, but this delay code does consume a bunch of CPU time/cycles. It "could" slow things down enough for you, but it is a delay loop with Application.ProcessMessage
You might put it in a separate executable and keep it running (change the thing to suit your needs so it runs forever until you Stop it via Stop which is a global variable and is set True.
I don't know....
John
No, to test it, I'd just make a simple exe file with two buttons. One Go one Stop.
Set the delay to like 120000... should be 2 minutes. (Math is NOT my forte)!
In the go button event do Delay(120000).
The stop button should have a Stop := True. Make sure you have a var; Stop : Boolean;
Click Go run your game. See if its slower since this delay will eat CPU time.
It may not do much if anything perceivable, but could slow ya down a bit.
John
ST3V0,
You come up with the good Q's!!!
I don't know. If you really want to write something in a Delphi app, the only other thing I could think of would be a combination of the above and "maybe" doing a search of the hard drive for some file or text in a file. This would waste some hard drive read/ write cycles as well as some more CPU time.
On my website I have a GUI find in file text search program. Search form some fairly long non-existent string in all files starting in your root C drive.
You may have start up the delay too.
http://www.jcitssystems.co
So... I'm out of thoughts!
John
If your trying to slow down an application/process (vs the whole PC), then one idea might be to control the Suspend/Resume of the main thread in order to "slow" the process down. Example below, assuming you don't mind starting the process via your app ( you could also use OpenProcess to get a handle to the process).
Russell
----
function CreateSlowProcessThread(lp
var dwIndex: Integer;
begin
// Pacify the compiler
result:=0;
// Resource protection
try
// Resume thread
ResumeThread(lpProcessInfo
// While the thread is running
while (WaitForSingleObject(lpPro
begin
// Suspend / resume four times per second to smooth things out
for dwIndex:=0 to 3 do
begin
// Suspend the process thread
SuspendThread(lpProcessInf
// Delay
Sleep(Trunc(lpProcessInfo^
// Resume the thread
ResumeThread(lpProcessInfo
// Delay
Sleep(Trunc(lpProcessInfo^
end;
end;
finally
// Close handles
CloseHandle(lpProcessInfo^
CloseHandle(lpProcessInfo^
end;
end;
procedure CreateSlowProcess(Command:
var lpPi: PProcessInformation;
lpSi: TStartupInfo;
lpMsg: TMsg;
dwThread: DWORD;
hWait: Array [0..0] of THandle;
begin
// Clear startup info param
FillChar(lpSi, SizeOf(lpSi), 0);
// Set startup param info
lpSi.cb:=SizeOf(lpSi);
lpSi.dwFlags:=STARTF_USESH
lpSi.wShowWindow:=SW_SHOWN
// Allocate memory for process info
lpPi:=AllocMem(SizeOf(TPro
// Resource protection
try
// Call createprocess to run the bootstrap version of the program
if CreateProcess(nil, PChar(Command), nil, nil, True, CREATE_SUSPENDED or IDLE_PRIORITY_CLASS, nil, nil, lpSi, lpPi^) then
begin
// Set thread priority
SetThreadPriority(lpPi^.hT
// Use dword values in structure to save wait and run times
lpPi^.dwProcessId:=Trunc(1
lpPi^.dwThreadId:=1000 - lpPi.dwProcessId;
// Create thread to run
hWait[0]:=CreateThread(nil
// Check handle
if (hWait[0] > 0) then
begin
// Resource protection
try
// Wait for the secondary thread to complete
while (MsgWaitForMultipleObjects
begin
// Handle waiting messages
while PeekMessage(lpMsg, 0, 0, 0, PM_REMOVE) do
begin
// Translate and dispatch
TranslateMessage(lpMsg);
DispatchMessage(lpMsg);
end;
end;
finally
// Close the handle
CloseHandle(hWait[0]);
end;
end;
end;
finally
// Free memory
FreeMem(lpPi);
end;
end;
---- example usage ----
// Start a directory listing throttled down by 75%
CreateSlowProcess('cmd /k dir c:\ /s', 75);
As I said before the entire cheat engine program is open source. You can get it from www.cheatengine.org or here is the direct link: http://www.cheatengine.org
The file that does what you want is in this folder: "\ce54releasesvn\CEHook". It contains the source dll that the main cheatengine.dpr uses to do many things including speed hacking a process. That is contained in "\ce54releasesvn\CEHook\sp
Business Accounts
Answer for Membership
by: mikelittlewoodPosted on 2008-12-01 at 05:39:34ID: 23068210
Why would you want to slow down your pc?