So we have an application that I am not ready to describe in full before we take it to the market, but I will give the details necessary.

We currently have an application that takes a snapshot of an active window of a particular application based on a region that is selected by the user. This data is simply a number that is read using OCR and sends this number to a particular device for that device to display. It is much more complicated but this is the part that I want to ask about. Sometimes these different types of particular applications do not have an active window setup so if the user moves the window then we no longer can read that region with OCR unless they update the new region.

I have read into something known as microsoft hooks. Here is the link

My question here is this something that can be used at all and would it be ethical? We don't need access to any sensitive info but I myself am not sure if I should use this.

Im sorry the description of my software is very vague. We just don't have it fully protected yet so I don't want to just announce it. I only need some help seeing if hook can be used in this type of way.


  • 2
    Sounds about as ethical as a keylogger. Depends entirely on how you use it. Is the user fully informed about what you're up to or is this some shady thing only explained deep in the bowels of one of those EULAs that no one reads? Commented Mar 1, 2018 at 5:06
  • We have no problem telling the user how we are doing it.
    – RSon1234
    Commented Mar 1, 2018 at 5:31
  • Hmm, I doubt the users would care but the creators of the system that you're integrating with that focing you through these rediculous hoops, do they consent to the automation of this process? Are you violating any agreement with them? Or do you not care what they think? Commented Mar 1, 2018 at 5:34
  • I care what they think from a legal standpoint. That part we are letting our legal team handle. If it is in fact illegal according to what these creators say then we cant do it. But if they dont mention anything about it and we are not violating anything then i might. I just wanted to get a feel for the ethics of it if it is in fact legal. I dont want to be some shady guy that does stuff basically
    – RSon1234
    Commented Mar 1, 2018 at 5:40
  • Do it openly and with informed consent of all involved parties and I think it's fine. You might be eliminating someones job by automating it away but I believe any job that can be done by software shouldn't be done by humans because humans are far to valuable to be exploited like that. Commented Mar 1, 2018 at 5:43

1 Answer 1


Microsoft Windows is built around hooks. Most of them are hidden behind their api but once your application becomes anything more then trivial you can't get around using hooks once in a while.

It's not a matter of ethics, it's just how windows is built.

To put it even stronger: a windows program that uses the windows ui can't work without using hooks.

The act of using hooks to interface with other programs can't be considered evil or not evil. It's what you do with your program that makes it evil or not.

  • By that logic, viruses using the windows api are ethical because "it's just how windows is built." Of course what is ethical is subjective, but I don't think we can claim that if the functionality exists, any program using it must be ethical in principle.
    – Neil
    Commented Mar 1, 2018 at 9:08
  • 3
    @Neil My argument is that the discussion about ethical or not is moot. The simple act of using hooks can't tell you if it's ethical or not. It's what you do using this technique that makes it ethical or not.
    – Pieter B
    Commented Mar 1, 2018 at 9:16
  • 1
    Then I misunderstood your argument, sorry.
    – Neil
    Commented Mar 1, 2018 at 9:18
  • 2
    Bashing nails with a hammer is ethical, bashing someone's head in is not. As such it's not really possible to discuss if using a hammer is ethical. Commented Mar 1, 2018 at 10:33
  • 1
    what if it was a very evil person and a very valuable nail? (asking for a friend)
    – Ewan
    Commented Mar 1, 2018 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.