Little background: I've just started win32, but need to get a function running in another thread to keep my UI untouched. The function looks something like:
void threadje( void *arg)
{
SetDlgItemInt(hwnd, ID_stcSleep, 10, false);
Sleep(1000);
}
I call this function in my WinMain function:
_beginthread(threadje, 0, (void*)hwnd);
I've been reading up on threads, however, it is quite hard to find some nice tutorials on what I want. I read somewhere that they just take void * as parameter, and I've copied most of the code found here from a site about threads (http://www.codeproject.com/KB/threads/MultithreadingTutorial.aspx).
The error I'm getting is hwnd still being undeclared, I do not understand this as I'm giving it as an argument with the function. Any help would be very well appreciated,
thank you