Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Run function after X miliseconds
Re: Run function after X miliseconds [message #417961 is a reply to message #417956] Mon, 18 January 2010 10:43 Go to previous messageGo to previous message
Sir Kane
Messages: 1701
Registered: March 2003
Location: Angerville
Karma:
General (1 Star)
DWORD CALLBACK ThreadProc(void* pArg){
	DWORD delay;
	delay = PtrToUlong(pArg);
	Sleep(delay);
	//Do your shit here
}

HANDLE hThread;
DWORD tid;
hThread = CreateThread(NULL, 0, ThreadProc, ULongToPtr(delay), 0, &tid);
CloseHandle(hThread);


Might want to make it thread save, though.


Proud N9500 and proud N6270 user. Creator of the IEE libraries (original bhs.dll) and the RB series software.
http://n00bstories.com/image.fetch.php?id=1189992501http://www.n00bstories.com/image.fetch.php?id=1257492907
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Hud Help
Next Topic: Islands gmax files?
Goto Forum:
  


Current Time: Wed Feb 26 23:28:26 MST 2025

Total time taken to generate the page: 0.01736 seconds