我想创建一个应用程序是visual studio,它隐藏在任何应用程序中输入的所有数字 [英] I want to create an application is visual studio which hides all numbers entered in any application

查看:77
本文介绍了我想创建一个应用程序是visual studio,它隐藏在任何应用程序中输入的所有数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个在后端运行的应用程序。此应用程序应识别用户输入的文本是否为数字然后转换显示为密码char,或隐藏该文本或黑色该区域。基本上没有人能够看到任何正在输入的数字。



我尝试了什么:



我试图创建一个胜利形式,出现在该区域以覆盖它,但无法获得完美的Caret位置。



I want to create an application that would run in the back-end. This application should identify if the text entered by the user and if it's a number then convert show that as a password char, or hide that text or black that area. Basically no one should be able to see any numbers that is being typed.

What I have tried:

I tried to create a win form that would appear on the area to cover it, but not able to get perfect Caret position.

private void reportMoveToolStripMenuItem_Click()
       {
           // This is an event handler triggered by a menu item (or button).
           _reporterWin.BackColor = Color.Black;
           _reporterWin.Height = 20;
           _reporterWin.FormBorderStyle = FormBorderStyle.None;
           _reporterWin.TopMost = true;

           PositionReporterEdge(); // Position the window.
           _reporterWin.Show();
       }

       /// <summary>
       /// Position the "Reporter" form next to the current form.
       ///////////
       private void PositionReporterEdge()
       {
           int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
           int screenWidth = Screen.PrimaryScreen.WorkingArea.Width;

           Point parentPoint = this.Location;

           int parentHeight = this.Height;
           int parentWidth = this.Width;

           int childHeight = _reporterWin.Height;
           int childWidth = _reporterWin.Width;

           int resultX;
           int resultY;

           if ((parentPoint.Y + parentHeight + childHeight) > screenHeight)
           {
               // If we would move off the screen, position near the top.
               resultY = parentPoint.Y + 50; // move down 50
               resultX = parentPoint.X;
           }
           else
           {
               // Position on the edge.
               resultY = parentPoint.Y + parentHeight;
               resultX = parentPoint.X;
           }

           // set our child form to the new position
           _reporterWin.Location = new Point(resultX, resultY);
       }

推荐答案

决定非平凡:你需要从全局键盘钩开始拿起什么是打字,然后搞乱你从未见过的应用程序,以防止它显示数字。那可能是不可能的,只是因为有些应用程序同时在两个地方显示输入:例如打开LibreOffice Calc,然后在单元格中键入1234。它显示 - 当你输入 - 在单元格中(右对齐),在公式栏中(左对齐)。



我正在努力寻找一个好理由 想要做到这一点:我能想出的就是恶意活动;我无法看到合法用途。这意味着即使有办法,我们也不会告诉你。
Decidedly non-trivial: You need to start with a global keyboard hook to pick up what is being typed, and then mess with an app you've never seen to prevent it displaying the number. That's ... probably not possible, if only because some apps show input in two places simultaneously: open LibreOffice Calc for example, and type 1234 into a cell. It shows - while you type - in the cell (right justified), and in the formula bar (left justified).

And I am struggling for a "good reason" to want to do this: all I can come up with is malicious activity; I can't see an legitimate use for this. And that means that even if there was a way, we wouldn't tell you.


这篇关于我想创建一个应用程序是visual studio,它隐藏在任何应用程序中输入的所有数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆