From my understanding a program.exe , use the SendMessage() located in user32.dll.so .
But also my program.exe must receive some messages ,for example when user click minimize or close buttons . How these messages are sent to program.exe? From where they came?What dll? For example if winecfg have "Allow window manager to control the window" ,how my program.exe will be closed if user click on close button (X on top bar) ,what message my program will receive?
Sorry if this seams stupid questions ,but I try to figure out what wine component send to my app the close message for example
The window manager sends ClientMessage with type WM_PROTOCOLS and the protocol value WM_DELETE_WINDOW.
This is handled in dlls/winex11.drv/event.c: X11DRV_ClientMessage() -> handle_wm_protocols().