none
How can I get keypress from windows calculator? RRS feed

  • Question

  • I am making a program which use for hiding files.

    I wanna the program and the file hide securely enough. I got an idea from some cellphone software that whenever the program starts, it will show a calculator. The MainWindow of the program only show while the user input the right password in the calculator.

    Whereas, as we know different windows version has different UI of calculator. If I rewrite a brand new UI for all version of windows, it is a huge work.

    So I have an idea that open the default calculator of windows, keep watch on its keypress. If the keypress equal the password, then kill the process of calculator and show the MainWindow of my program.

    Now the question is how can I get keypress from the windows calculator? Thank you.

    Sunday, June 2, 2019 2:30 PM

Answers

  • Why don't you simply provide your own keypad screen for login?

    Just drag and drop the controls on your form and wire your own code to process iuput, it would be way easier than capturing UI input of another program.

    I don't see it provides any benefit of "hiding" because your program need to be running in order to "listen" to input event of other applications, and using any debug tool to "look" at your program can reveil what program you're listening.

    Too much work for too little gain.

    ======

    And just to preempt any attempts to help answer this question, this technique can be used for malicious use and is the type of request we will not provide help for.


    Monday, June 3, 2019 1:30 AM
    Answerer

All replies

  • Why don't you simply provide your own keypad screen for login?

    Just drag and drop the controls on your form and wire your own code to process iuput, it would be way easier than capturing UI input of another program.

    I don't see it provides any benefit of "hiding" because your program need to be running in order to "listen" to input event of other applications, and using any debug tool to "look" at your program can reveil what program you're listening.

    Too much work for too little gain.

    ======

    And just to preempt any attempts to help answer this question, this technique can be used for malicious use and is the type of request we will not provide help for.


    Monday, June 3, 2019 1:30 AM
    Answerer
  • Why don't you simply provide your own keypad screen for login?

    Just drag and drop the controls on your form and wire your own code to process iuput, it would be way easier than capturing UI input of another program.

    I don't see it provides any benefit of "hiding" because your program need to be running in order to "listen" to input event of other applications, and using any debug tool to "look" at your program can reveil what program you're listening.

    Too much work for too little gain.

    ======

    And just to preempt any attempts to help answer this question, this technique can be used for malicious use and is the type of request we will not provide help for.


    As I said in the question, I wanna the UI the same as the windows calculator. Whereas, different version windows has different UI of windows calculator. If I make each UI for each windows version, it is a huge work.

    I did this because I want the program hide safely and hardly can find by someone. That's not too much work for too little gain but need for the end user.

    Monday, June 3, 2019 3:28 AM
  • Greetings Mywatermelon.

    Just because the calculator supplied with Windows is different for each version, does not mean a calculator you design has to also be different for each version. You can design one form how you like and it should work everywhere. It should be fairly simple.

    Monday, June 3, 2019 3:37 AM
  • Actually, if you only count Win7 onwards, you only need to implement 4 screen for Win7, 4 for Win8, 4 for Win8.1 and 4 for Win10. I wonder how "huge work" would it be for a total of just 16 screens, especially considering you can link the event handlers of multiple forms to the same handler.

    On the other hand, to "listen" for mouse and key events for all these version is significantly more difficult because of class name difference and so on. The difference in amount of effort is still not justified at all.

    Monday, June 3, 2019 3:59 AM
    Answerer
  • Sorry, but your requirement is silly.  Your app should have YOUR UI, not a UI that you have stolen from some other application.  Implementing a numeric keypad is a two-hour task, whereas trying to usurp the calculator will take a lot longer than that.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Monday, June 3, 2019 4:04 AM
  • Greetings Mywatermelon.

    Just because the calculator supplied with Windows is different for each version, does not mean a calculator you design has to also be different for each version. You can design one form how you like and it should work everywhere. It should be fairly simple.

    Thanks for your kindly suggestion.^_^
    Monday, June 3, 2019 6:08 AM
  • Actually, if you only count Win7 onwards, you only need to implement 4 screen for Win7, 4 for Win8, 4 for Win8.1 and 4 for Win10. I wonder how "huge work" would it be for a total of just 16 screens, especially considering you can link the event handlers of multiple forms to the same handler.

    On the other hand, to "listen" for mouse and key events for all these version is significantly more difficult because of class name difference and so on. The difference in amount of effort is still not justified at all.

    OK, it seems I have to do it like this.
    Monday, June 3, 2019 6:10 AM
  • Sorry, but your requirement is silly.  Your app should have YOUR UI, not a UI that you have stolen from some other application.  Implementing a numeric keypad is a two-hour task, whereas trying to usurp the calculator will take a lot longer than that.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Thanks for your reply. I will considering more about that. Thank you.
    Monday, June 3, 2019 6:11 AM