I'm making a simple console program that will use FindWindow to get the HWND of another program that is open. I'm then looping in a while loop trying to use SendMessage(), but when I'm running the program it never actually leaves the loop where it's trying to send the message.
I've tried printing out the master_window_handle to make sure it's giving me back a Window and that is working fine. I'm certain the program I'm sending the message to is working correctly when processing messages because it is already receiving other messages. Any help would be greatly appreciated. Thanks!
The SendMessage function does not return a bool (or int) indicating success. In this case, the return value of the SendMessage function is whatever the WndProc of "Master" returns for this particular message. If it returns zero (not sure what it will return if it is a void function), then send_successful will be zero. The infinite loop is likely due to the WndProc returning zero or due to the WndProc being a void function.