I want to create a class library project in C# and attach it to a procces.
I've already did this in C++, my code is
#include <windows.h>
void Thread()
{
// here i just do my stuff
}
int WINAPI DllMain(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
if(reason==DLL_PROCESS_ATTACH)
{
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Thread, 0, 0, 0);
}
return 1;
}
This works very well for me.
Is possible to do this in C#?
Thanks, I hope i'll find an answer and accept it.