Results 1 to 3 of 3

Thread: [2008] Sendkeys sends key 2 times Q.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    74

    [2008] Sendkeys sends key 2 times Q.

    the thing is that Im trying to open new tab in firefox(CTRL+t), but for some weird reason instead it opens 2 tabs yet the code looks like this:
    Any idea how can i send this 1 time?:

    sendkays code:
    Code:
     SendKeys.SendWait("^(t)")
    Fulll code:
    Code:
            '' Check if firefox is running & open new tab
            ''----------------------------------------------
            Dim ProcessList As System.Diagnostics.Process()
            ProcessList = System.Diagnostics.Process.GetProcesses()
            Dim Proc As System.Diagnostics.Process
    
            For Each Proc In ProcessList
                If Proc.ProcessName.ToLower = "firefox" Then
                    'MsgBox("Name {0} ID {1}   " & Proc.ProcessName & "    " & Proc.Id)
                    AppActivate(Proc.ProcessName)
    
                    SendKeys.SendWait("^(t)") ' open new tab
    
                    Exit For
                End If
            Next

    M.V.B. 2008 Express Edition

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [2008] Sendkeys sends key 2 times Q.

    Hi,

    Could it be possible that, when you opens Firefox it has already one tabpage and then with your app. it fires again and create a second tabpage.
    Just a thought.

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    74

    Re: [2008] Sendkeys sends key 2 times Q.

    well in the current code the firefox is already open, so I make firefox window active & send CTRL+t to open 1 more tab & according to code it should send CTRL+t 1 time. but the thing is that it sends it 2 times. & instead of 1 2 tabs are opened.

    M.V.B. 2008 Express Edition

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width