Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which thread calls the windows proc callback function?

I am a bit unsure which thread calls the wndproc callback function. Is it the main thread from the application, like in the message loop or is a seperate windows thread ? The function has access to class objects and I dont want there to be any corruption of data if 2 thread happend to access the class object at the same time.

like image 224
Fredrik Boston Westman Avatar asked Sep 21 '26 16:09

Fredrik Boston Westman


1 Answers

Yes, it is main thread of application.

An application's main thread starts its message loop after initializing the application and creating at least one window. After it is started, the message loop continues to retrieve messages from the thread's message queue and to dispatch them to the appropriate windows. The message loop ends when the GetMessage function removes the WM_QUIT message from the message queue.

Source: About Messages and Message Queues

like image 137
szulak Avatar answered Sep 24 '26 06:09

szulak