Send a key code to an application without activating it first?

前端 未结 5 554
野性不改
野性不改 2020-12-24 11:59

I\'m trying to send the spacebar key to an application without activating it first. The following code almost does what I want but it brings the application to the foregroun

5条回答
  •  有刺的猬
    2020-12-24 12:47

    There are courses of investigation.

    1. If the application is one you have developed yourself you have the following options:

      *simply have a public property exposed and set that to the key you want to send it. *have your application polling a folder for a file and you send your instructions via that.

    2. With a windows API hook of some type you can get control of the application without activating it. I am pretty certain if I put my mind to it I could take control of anything on the computer.

    In simple terms think out of the box, it does not necessarily need to be a key press you send, you just want to instruct it to do something. There is loads of options Interface Marshalling, Interops, OLE, DDE, looks like I have turned up on this site just in time!

提交回复
热议问题