I thought that CreateThread was an __stdcall, thus not usable.
Testing now to check.
---------- Post added at 10:25 PM ---------- Previous post was at 10:16 PM ----------
Sorry for double post
//same function I use for my Console app
Code:
DWORD WINAPI CastLine(LPVOID arg)
{
while(true)
{
HWND hWnd = FindWindowA(NULL, (LPCSTR)("World of Warcraft"));
PostMessage(hWnd, WM_KEYDOWN, VK_F1, 0);
PostMessage(hWnd, WM_KEYUP, VK_F1, 0);
Sleep(19000);
}
return 0;
}
call
Code:
CreateThread(NULL, 0, CastLine, NULL, 0, &threadid1);
error
Code:
error C3641: 'CastLine' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
error C2664: 'CreateThread' : cannot convert parameter 3 from 'DWORD (__stdcall *)(LPVOID)' to 'LPTHREAD_START_ROUTINE'