Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);
       }
Posted
Updated 16-Feb-18 19:56pm
Comments
Jon McKee 17-Feb-18 1:25am    
Disclaimer: I have no solution or information to add to your problem so ignore the rest of my statement if that's all you're after.

One of the fundamental principles of modern operating systems is the default separation of processes - both in memory and access. The two recent major exploits (Spectre and Meltdown) both break this contract which is why freaking out was the common reaction. Without explicit permission by other applications for your application to extract their data (screen position, data entered, etc) or "hacks" I'm not sure this is possible. Even if possible, I'm not sure it's a net positive as it would represent a real, tangible problem.
[no name] 17-Feb-18 2:29am    
What's the use case?

1 solution

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.
 
Share this answer
 
Comments
Member 13625198 17-Feb-18 2:46am    
I am trying to build this for a call center industry so that they can protect customer's information. Sometime customer wants to make payment over the phone and gives our credit card information, so the representative can enter this information somewhere and take a pic or memorize it and misuse it. So I want to prevent this fraud.
phil.o 17-Feb-18 4:06am    
If the representative enters the information, what would prevent him/her to note the number elsewhere if you were to implement this "security measure"?
OriginalGriff 17-Feb-18 4:31am    
Have ever heard of "pen and paper"?

This is a ridiculous "security" measure - all you are doing is preventing the people who are given direct access to the information from seeing the information they just entered. That's not security, it's plain silly! And it'll prove to your (probably lowly paid already) call center staff that you don't trust them one tiny bit, and that is death to morale (and paradoxically increases the risk of fraud).
Member 13625198 17-Feb-18 6:04am    
Have you ever heard of "paperless environment"? And it's not about low paid or high paid call center. It's about one odd guy who is not serious about their job and wants make easy money. See, if you cannot help, that's okay. Thank you so much.
OriginalGriff 17-Feb-18 6:12am    
Several times - and it generally means even more paper flowing through the system. :sigh:
And seriously: if you want to demotivate your staff, and encourage them to try and "rip you off" then show them you don't trust them at all.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900