I've made a program that can send BN_CLICK messages to buttons from other programs using SendMessageTimeout(), and it works fine for buttons that are obviously standard Windows buttons. But there are some windows in programs I've been trying to use that function as buttons, but don't do anything in response to being sent a BN_CLICK message. Is there maybe a more general way of simulating a click on a window that would work even if it's not a standard Windows button control? I'd really like something that doesn't depend on the screen coordinates of the window, so it could be done without the window being displayed on the screen at the time.