I'm trying to send BM_CLICK to a window in another process.
When the target button get clicked, the target window pops up a modal dialog, then my calling thread never return even I send the timeout to 1 second.
SendMessageTimeout(handle, BM_CLICK, 0, 0, SMTO_ABORTIFHUNG | SMTO_NORMAL, 1000, NULL);
What's the reason of this? Is there any idea I can prevent this?
There are some potential solutions:
- Use PostMessage with WM_LBUTTONDOWN and WM_LBUTTONUP to simulate the click
- If I remember correctly, PostMessage doesn't support BM_CLICK, isn't it?