how to stimulat Ctrl+alt+i and Ctrl+alt+n keyboard key press in vb.net?

Recommended Answers

All 21 Replies

SendKeys.Send Method

"Caution: If your application is intended for international use with a variety of keyboards, the use of Send could yield unpredictable results and should be avoided."

In an input control, such as a textbox, the keyeventargs of the keydown event give you access to information on whether the alt and/or control keys were pressed as well as which regular input key:

Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown
    If e.Alt AndAlso e.Control Then
        If e.KeyCode = Keys.N Then
            MessageBox.Show("N")
        ElseIf e.KeyCode = Keys.I Then
            MessageBox.Show("I")
        End If
    End If
End Sub

thnk but ,want to stimulat Ctrl+alt+i keyboard key press in vb.net, not find what key was press.

Oh you mean simulate If you want to do this for a specific process the Process Class will allow you to send any keypress combination to the process.

simulate , that was a typo
and seem this site dont have an edit button after sign out .
and Keyboard.SendKey
"^%n"
("^%{n}") combination dont work.

Are you trying to send this to a form you created in VB .NET or to a window in another program?

Also, you can edit a post after you sign out and sign back in. However, there is a 30 min cutoff. After 30 mins you are no longer able to edit a post. If you don't press the refresh button on your browser after clicking "Save Changes", and edit the post again, the previous update is lost. Also, you need to refresh your browser to update the posting time.

trying to send it to to a window in another program yahoo

why a cutoff after 30 min , user has the right to edit any post posted by him on other site why not here ,
it would be bettter for user and other member , that way atleast the post wont appear mess.

look at this ex , post got reposted , the sever at your site was slow to upate at first
any way keep up the good work.

If you want to interact with a webpage you can load the pages directly into your app.

it is for mssngr

There is an API for yahoo messenger that will allow you to incorporate it into your app.

tinstaa frgt messenger , what about Ctrl+alt+n keyboard key press to a window in another program in vb.net.

The process class in my previous post.

but hw to simulate Ctrl+alt+n process

Redirect the standard input of the process. All the information is included in links in that page, especially the StartInfo property

^+%n dont work
post any ex.

Sorry been tied up. I'll try and put something together tomorrow.

1 wk no ex.

O.K. just a couple of points. A) The program you want to send a key combinations to need to be programmed to accept this combination. B) Windows always intercepts key presses and somewhat redirects these if the program you want to send these to doesn't accept these. So here is a small snippet using notepad to send keys to:

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Shell("notepad", vbNormalFocus)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        AppActivate("notepad")
        SendKeys.Send("text1")
        SendKeys.Send("{TAB}")
        SendKeys.Send("text2")
        SendKeys.Send("{TAB}")
        SendKeys.Send("{ENTER}")
        SendKeys.Send("^(a)") 'for Ctrl-A for select all
        SendKeys.Send("^(n)") 'create new notepad
        SendKeys.Send("^(s)") 'for control and S - save notepad
    End Sub
End Class

Process 'YahooMessenger' was not found.

Have you tried using all teh key events together?

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.