Sending keystroke from Delphi to another app
Posted on 1998-03-28
Generally, I'm using a Delphi app to update some files on remote computers. I need to be able to close out several applications that may be open. I'm able to identify if the apps in question are open, and close them, but several require additional effort. Namely, one always pops up a "Do you want to save your changes" button, which I need to respond to. The second is an app that also requires having a button clicked (or sending Alt+O).
My problem concerns passing a keyboard command (in my case, Alt+O) to the button in the other application. I can, I think, I identify the handle of the window I want to pass this to, but I'm just not getting the code right, because it isn't responding. I have a feeling it has to do with using WM_SYSCHAR OR WM_SYSKEYDOWN but like I said before, I'm just not getting the code exact enough for it to work. Unfortunately, no examples I've seen have been specific enough to use.
Could someone give me a specific example. the previous question here does not provide me an answer because I've been down those roads, but apparently I'm doing something slightly wrong.