I am trying to set hook on keyboard with SetWindowsHookEx and I want the program to keep running so I added while(TRUE) after the hook setted.
int main()
{
SetHook();
while (TRUE)
{
}
return 0;
}
Now, this is not working for me so I searched about it and I saw this:
int main()
{
SetHook();
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
}
return 0;
}
Why is this working and while(TRUE) isn't?
Thanks