Hey Guys
I have a problem here with my code. My aim is to inject this dll and when i press 8 or 2 a message box pops up. Its not a hook or something, Im just trying to learn some basic stuff

If you can explain a little how the function is looping that would help alot!
Here is my code:
[HTML]
#include <Windows.h>
#include <Stdio.h>
void Main_Thread()
{
if(GetAsyncKeyState(VK_NUMPAD8))
{
MessageBoxA(NULL, "You Pressed 8", "Succesfull", MB_OK);
}
if(GetAsyncKeyState(VK_NUMPAD2))
{
MessageBoxA(NULL, "You Pressed 2", "Succesfull", MB_OK);
}
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved ){
if ( dwReason == DLL_PROCESS_ATTACH ){
HANDLE hThread;
DWORD dwReason;
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Main_Thread, NULL, NULL, NULL);
CloseHandle(hThread);
}
return TRUE;
}
[/HTML]
Thanks in advance
