I want this code to run in the background but still be active:

Private Sub frmMain_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress

        lblTest.Text &= e.KeyChar

    End Sub

Recommended Answers

All 5 Replies

Well according to your title you want to make the keyloger be invisible and if I take a look at your code it like you want it to be invisible when a certain key(s) is/are pressed. so there are many ways to make a program be invisible. first if you were asking on just making it invisible when you running it you just need to enter this code on Form load.

Me.Visible = False()

or if you want to make it be invisible when you have pressed a certain key then your code should look like this.

If certainkeypressed Then
Me.Visible = False()
Else
' If the key has not been pressed yet keep on being visible
Me.Visible = True()
End If
End If

That it and I'm sure you can see that you will have to change the certainkeypressed to that key you want. Hope this answered your Question.

Thanks for your reply mr hacker.

Well according to your title you want to make the keyloger be invisible and if I take a look at your code it like you want it to be invisible when a certain key(s) is/are pressed. so there are many ways to make a program be invisible. first if you were asking on just making it invisible when you running it you just need to enter this code on Form load.

I would like to clarify what I want. When I run the program, and type anything, the text is shown in the label. However, I want to the program to work when for example I work in Word Document, so the program wont be running on top anymore, but will still update the label while I'm typing in Word.

commented: Ok I think i get you now, you want the keyloger to be invisible but do take or record the keys pressed. Well in that case it so very simple there are 2 ways that I know you can do that. The first way is to make your prgram be ontop most and then make it b +0

Ok I think I get you now, you want the keyloger to be invisible but do take keys pressed. Well in that case it so very simple there are 2 ways that I know you can do that. The first way is to make your program be ontop most and then make it be invisible by clicking the form(s) and go to properties then on the forecolor choose Trnansparent then on the BackColor also choose Transparent or Black color But black color do show a form incase it not responding so I prefere you use the Transparent. Now on your TextBox where you will be using to capture the logs select it and go to Properties make it be invisible then all the job left now is on the timer that you will be using to regord the pressed keys this has to record the selected key at the right time. You can also make the program be invisible but make sure the timer that will be recording the pressed keys is started on Form Load then now all matters for you keyloger to record the pressed keys is that it has to be running it dosn't metter whether it visible or invisible. If you still have a problem please post that potion of code you have a problem on so that I and other members will be able to help you.

Also make the stle be none not sizable .

Thanks. However I didn't really understand how to:

make your program be ontop most

Could you please tell me in detail how to make this possible?

And also, is it mandetory to have a timer, or could I make the prgram work without one?
If not, could you support me with some code to make it poossible?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.